/* ==========================================================================
   DrinkDuel — Components & UI Controls
   Tactile, finger-friendly, modern glassmorphism
   ========================================================================== */

/* Buttons */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 60px;
    padding: 14px 24px;
    border-radius: 18px;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #ffffff;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.4),
                inset 0 1px 1px rgba(255, 255, 255, 0.35);
    transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.12s ease,
                background 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    will-change: transform;
}

.btn:active {
    transform: translateY(3px) scale(0.975);
    box-shadow: 0 2px 8px -1px rgba(0, 0, 0, 0.5),
                inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.btn-xl {
    min-height: 80px;
    font-size: 1.45rem;
    border-radius: 24px;
    box-shadow: 0 12px 32px -6px rgba(0, 0, 0, 0.5),
                inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

.btn-primary {
    background: linear-gradient(180deg, #3a86ff 0%, #0056d6 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-success {
    background: linear-gradient(180deg, #2ecc71 0%, #1e824c 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-danger {
    background: linear-gradient(180deg, #ff4757 0%, #c0392b 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-gold {
    background: linear-gradient(180deg, #f39c12 0%, #d35400 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.btn-warning {
    background: linear-gradient(180deg, #ffd166 0%, #f39c12 100%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #111111 !important;
    font-weight: 900;
    text-shadow: none;
}

.btn-glass {
    background: var(--surface-glass-strong);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-glass-border);
    color: var(--text-primary);
}

.btn-glass:active {
    background: rgba(255, 255, 255, 0.25);
}

/* Glass Card Container */
.glass-card {
    background: rgba(18, 22, 34, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.5),
                inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

/* Compact Scoreboard Header */
#scoreboard-header {
    position: relative;
    width: 100%;
    min-height: 48px;
    padding: calc(var(--safe-top) + 8px) 12px 8px 12px;
    background: rgba(10, 12, 18, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    z-index: 50;
    box-sizing: border-box;
    flex-shrink: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#scoreboard-header.hidden {
    display: none !important;
}

.round-badge {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #ffd166;
    background: rgba(255, 209, 102, 0.15);
    padding: 4px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 209, 102, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.scoreboard-players {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}
.scoreboard-players::-webkit-scrollbar {
    display: none;
}

.sb-player-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 3px 6px 3px 4px;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sb-player-chip.loser-highlight {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.25);
    animation: pulse-border 1.2s infinite;
}

.sb-donut {
    width: 22px;
    height: 22px;
    transform: rotate(-90deg);
}

.sb-donut circle {
    fill: none;
    stroke-width: 4;
}

.sb-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Custom Text Inputs */
.input-field {
    width: 100%;
    min-height: 56px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 12px 18px;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.input-field:focus {
    border-color: #3a86ff;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 4px rgba(58, 134, 255, 0.25);
}

.input-field::placeholder {
    color: var(--text-muted);
    font-weight: 500;
}

/* Dev Menu Modal */
.avatar-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    padding: 6px 2px;
    min-height: 70px;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}

.avatar-option:active:not(.taken) {
    transform: scale(0.92);
}

.avatar-option.selected {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.avatar-option.taken {
    opacity: 0.25;
    filter: grayscale(1);
    pointer-events: none;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#dev-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 200;
    display: flex;
    flex-direction: column;
    padding: calc(var(--safe-top) + 20px) 20px calc(var(--safe-bottom) + 20px) 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

#dev-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.dev-modal-content {
    background: #141724;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 90vh;
}
