/* Global styles & Variables */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --bg-dark: #090514;
    --bg-darker: #05030c;
    --primary: #511ca8;
    --primary-light: #9b51e0;
    --accent: #ffd35c;
    --text-light: #f5f2fa;
    --text-muted: #a395c9;
    
    /* Neon Color Theory Choice Tones */
    --red-choice: #ff3355;     /* High-energy, warm coral-red */
    --blue-choice: #0088ff;    /* Calming, crisp sky-blue */
    --yellow-choice: #ffcc00;  /* Bright, warm golden-yellow */
    --green-choice: #00cc66;  /* Balanced, fresh emerald-green */
    
    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    --border-glow: 1px solid rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-light) !important;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background animated gradient */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 10% 20%, rgba(81, 28, 168, 0.22) 0px, transparent 50%),
        radial-gradient(at 90% 10%, rgba(155, 81, 224, 0.16) 0px, transparent 40%),
        radial-gradient(at 50% 80%, rgba(9, 5, 20, 0.98) 0px, transparent 100%);
}

.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle at 50% 0%, rgba(255, 211, 92, 0.05) 0%, transparent 60%);
}

/* Header & Logo */
header, .app-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(16, 10, 38, 0.8) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 0.85rem 1.75rem;
    position: sticky;
    top: 0;
    z-index: 1040;
}

.logo {
    letter-spacing: -0.5px;
    background: linear-gradient(45deg, #ffd35c, #ff6b6b, #9b51e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
    font-weight: 800;
}

/* Glassmorphism Card Style */
.card-glass {
    background: rgba(255, 255, 255, 0.04) !important;
    border: var(--border-glow) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

/* Pin Display Animation */
.pin-display {
    letter-spacing: 6px;
    text-shadow: 0 0 25px rgba(255, 211, 92, 0.4);
    animation: pulse 2s infinite;
}

/* QR Code Display Container */
.qrcode-card {
    background: #ffffff;
    padding: 12px;
    border-radius: 20px;
    display: inline-block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(255, 211, 92, 0.3);
    border: 3px solid rgba(255, 211, 92, 0.8);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.qrcode-card:hover {
    transform: scale(1.03);
    box-shadow: 0 12px 35px rgba(255, 211, 92, 0.5);
}

.qrcode-card img, .qrcode-card canvas {
    display: block;
    margin: 0 auto;
    border-radius: 10px;
    pointer-events: none; /* Prevents browser extension hover triggers on the raw image */
}

/* Navbar Action Icons */
.nav-control-btn {
    width: 38px;
    height: 38px;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.nav-control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(255, 211, 92, 0.4);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Player Bubbles Playground in Lobby */
.players-playground {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    scrollbar-width: thin;
    scrollbar-color: var(--accent) rgba(255, 255, 255, 0.05);
}

.players-playground::-webkit-scrollbar {
    width: 6px;
}

.players-playground::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

/* Player Bubble in Lobby - Straight, modern badges */
.player-bubble {
    background: rgba(255, 255, 255, 0.09);
    padding: 0.45rem 0.95rem;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-light) !important;
    border: var(--border-glow);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin: 4px;
    transform: none !important;
}

.player-bubble:hover {
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 6px 18px rgba(255, 211, 92, 0.35);
    z-index: 5;
}

/* Reconnection Status Toast */
.reconnect-toast {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translate(-50%, -20px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* Comic Animal Avatar Styles */
.avatar-badge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    user-select: none;
}

.avatar-lg {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(255, 255, 255, 0.2);
    border: 4px solid rgba(255, 255, 255, 0.2);
    margin: 0 auto;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
    user-select: none;
    position: relative;
}

.avatar-lg:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 35px rgba(255, 211, 92, 0.4);
}

.avatar-edit-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--accent);
    color: #111;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border: 2px solid #111;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Avatar Picker Grid */
.avatar-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 12px;
    max-height: 420px;
    overflow-y: auto;
    padding: 10px 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) rgba(255, 255, 255, 0.05);
}

.avatar-picker-grid::-webkit-scrollbar {
    width: 6px;
}

.avatar-picker-grid::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

.avatar-choice-btn {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    border: 2.5px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.3rem;
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease, border-color 0.18s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.avatar-choice-btn:hover {
    transform: scale(1.15) rotate(4deg);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
    z-index: 2;
}

.avatar-choice-btn.selected {
    border-color: #ffffff !important;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 10px rgba(255, 211, 92, 0.9);
    transform: scale(1.12);
    z-index: 3;
}

/* ================= PODIUM CEREMONY STYLES ================= */
.podium-stage {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 16px;
    margin: 1.5rem auto 2rem;
    max-width: 680px;
    min-height: 310px;
    position: relative;
}

.podium-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    opacity: 0;
    transform: translateY(50px) scale(0.8);
    transition: all 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.podium-step.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.podium-step-1 { order: 2; z-index: 3; }
.podium-step-2 { order: 1; z-index: 2; }
.podium-step-3 { order: 3; z-index: 1; }

.podium-avatar {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    margin-bottom: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    position: relative;
    user-select: none;
}

.podium-step-1 .podium-avatar {
    width: 84px;
    height: 84px;
    font-size: 3.1rem;
    border: 3px solid #ffd700;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
}

.podium-step-2 .podium-avatar {
    border: 3px solid #c0c0c0;
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.4);
}

.podium-step-3 .podium-avatar {
    border: 3px solid #cd7f32;
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.4);
}

.podium-nickname {
    font-weight: 700;
    font-size: 1.15rem;
    color: #ffffff;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.podium-score {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 8px;
}

.podium-pillar {
    width: 100%;
    border-radius: 16px 16px 8px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 6px;
    font-weight: 900;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 2px 6px rgba(255, 255, 255, 0.3);
    position: relative;
}

.podium-step-1 .podium-pillar {
    height: 170px;
    background: linear-gradient(180deg, #ffd700 0%, #b8860b 100%);
    color: #1a1500;
}

.podium-step-2 .podium-pillar {
    height: 130px;
    background: linear-gradient(180deg, #e0e0e0 0%, #757575 100%);
    color: #111111;
}

.podium-step-3 .podium-pillar {
    height: 100px;
    background: linear-gradient(180deg, #cd7f32 0%, #794412 100%);
    color: #ffffff;
}

.podium-rank-num {
    font-size: 2.2rem;
    line-height: 1;
    font-weight: 900;
}

.podium-icon-symbol {
    font-size: 2.3rem;
    margin-top: 4px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

/* Player Top-Right Podium Trophy/Medal Badge */
.player-rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.player-rank-badge.gold {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #111111;
    border: 2px solid #fff;
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.8);
}

.player-rank-badge.silver {
    background: linear-gradient(135deg, #f5f5f5, #9e9e9e);
    color: #111111;
    border: 2px solid #fff;
    box-shadow: 0 0 15px rgba(200, 200, 200, 0.7);
}

.player-rank-badge.bronze {
    background: linear-gradient(135deg, #e69138, #8c4600);
    color: #ffffff;
    border: 2px solid #ffd8a8;
    box-shadow: 0 0 15px rgba(230, 145, 56, 0.7);
}

.player-rank-badge.normal {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.avatar-choice-btn .avatar-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    margin-top: 2px;
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Timer Circle */
.timer-circle {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    border: 4px solid var(--accent);
    background: radial-gradient(circle, rgba(255, 211, 92, 0.25) 0%, rgba(9, 5, 20, 0.85) 80%);
    box-shadow: 0 0 25px rgba(255, 211, 92, 0.5), inset 0 0 15px rgba(255, 211, 92, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffffff !important;
    text-shadow: 0 0 12px rgba(255, 211, 92, 0.9), 0 2px 4px rgba(0, 0, 0, 0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.timer-circle-sm {
    width: 60px;
    height: 60px;
    font-size: 1.3rem;
    border-width: 3px;
}

/* Bar Chart Race Leaderboard */
.leaderboard-list {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    min-height: 400px;
}

.leaderboard-item {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: var(--border-glow);
    padding: 1rem 2rem;
    border-radius: 14px;
    height: 65px;
    transition: top 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.leaderboard-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(134, 68, 232, 0.25), rgba(70, 23, 143, 0.5));
    border-right: 3px solid var(--primary-light);
    z-index: 0;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.leaderboard-bar.first-place {
    background: linear-gradient(90deg, rgba(255, 211, 92, 0.35), rgba(216, 158, 0, 0.6));
    border-right: 4px solid var(--accent);
    box-shadow: 0 0 15px rgba(255, 211, 92, 0.4);
}

.leaderboard-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.rank {
    font-size: 1.5rem;
    font-weight: 800;
    width: 45px;
    color: var(--text-light) !important;
}

.rank-1 { color: #ffd700 !important; }
.rank-2 { color: #c0c0c0 !important; }
.rank-3 { color: #cd7f32 !important; }

.nickname {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-light) !important;
}

.score {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent) !important;
    position: relative;
    z-index: 1;
}

/* Player Shape-Only Choice Buttons */
.player-shape-btn {
    min-height: 140px;
    height: 32vh;
    max-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    transition: transform 0.12s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.player-shape-btn i {
    font-size: 4rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.player-shape-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}

.player-shape-btn:active {
    transform: scale(0.95);
    filter: brightness(0.9);
}

.player-shape-btn.red { background-color: var(--red-choice); color: #ffffff; }
.player-shape-btn.blue { background-color: var(--blue-choice); color: #ffffff; }
.player-shape-btn.yellow { background-color: var(--yellow-choice); color: #1a1a1a; }
.player-shape-btn.green { background-color: var(--green-choice); color: #ffffff; }

.host-option-card {
    min-height: 100px;
    border-radius: 16px;
    padding: 1.25rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    border: var(--border-glow);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease, filter 0.35s ease, box-shadow 0.35s ease;
    position: relative;
}

.host-option-card.red { background: linear-gradient(135deg, var(--red-choice), #c01838); }
.host-option-card.blue { background: linear-gradient(135deg, var(--blue-choice), #005ec4); }
.host-option-card.yellow { background: linear-gradient(135deg, var(--yellow-choice), #d49b00); color: #111111; }
.host-option-card.green { background: linear-gradient(135deg, var(--green-choice), #00994d); }

/* Pop-out Animation for Correct Answer on Host Screen */
.host-option-card.is-correct-reveal {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.8), 0 0 20px rgba(0, 204, 102, 0.9) !important;
    border: 3px solid #ffffff !important;
    animation: correctPopOut 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes correctPopOut {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1.05); }
}

/* Dimmed Style for Incorrect Options on Host Screen */
.host-option-card.is-incorrect-dim {
    opacity: 0.32;
    filter: grayscale(0.6);
    transform: scale(0.97);
}

.host-option-card .shape-badge {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.host-option-card.yellow .shape-badge {
    background: rgba(0, 0, 0, 0.15);
}

.host-option-card .option-text {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
}

/* Feedback Screen */
.feedback-screen.correct {
    border: 2px solid var(--green-choice) !important;
}

.feedback-screen.incorrect {
    border: 2px solid var(--red-choice) !important;
}

.feedback-screen.correct .feedback-title { color: #4cd137 !important; }
.feedback-screen.incorrect .feedback-title { color: #ff4757 !important; }

/* Utilities & Animations */
.letter-spacing-1 {
    letter-spacing: 2px;
}

.letter-spacing-2 {
    letter-spacing: 4px;
}

.animate-spin {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.min-vh-70 {
    min-height: 70vh;
}

/* Dropdown Stacking & Elevation */
.dropdown {
    position: relative;
}

.dropdown-menu {
    z-index: 1060 !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8) !important;
    border: var(--border-glow) !important;
}

.card-glass {
    position: relative;
}

/* ================= MOBILE-FIRST PLAYER UI ================= */
.player-wrapper {
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

/* Touch prevention & instantaneous fast-tap */
.player-shape-btn,
.avatar-choice-btn,
.btn-enter-game,
.nav-control-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* Mobile Header Player Chip (Top-Right: Avatar + Points) */
.player-chip {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50px;
    padding: 3px 12px 3px 4px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    margin-left: auto;
}

.player-chip-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-right: 6px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.player-chip-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95px;
    color: var(--accent);
    font-weight: 700;
}

.player-chip-score {
    font-weight: 800;
    color: #ffffff;
    font-size: 0.95rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* Mobile Cards (Join, Lobby, Waiting, Feedback) */
.mobile-card {
    border-radius: 28px !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    background: rgba(18, 12, 38, 0.8) !important;
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Phone-Optimized Form Inputs */
.player-input {
    height: 58px;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.45) !important;
    border: 2px solid rgba(255, 255, 255, 0.14) !important;
    color: #ffffff !important;
    transition: all 0.25s ease;
}

.player-input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 22px rgba(255, 211, 92, 0.4) !important;
    transform: translateY(-1px);
    background: rgba(0, 0, 0, 0.6) !important;
}

.player-input-pin {
    font-size: 2rem;
    letter-spacing: 6px;
}

/* High-Impact Button */
.btn-enter-game {
    height: 58px;
    font-size: 1.25rem;
    font-weight: 800;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffd35c 0%, #ff9f1c 100%);
    color: #1a1500;
    border: none;
    box-shadow: 0 10px 30px rgba(255, 170, 0, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-enter-game:hover, .btn-enter-game:active {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 14px 35px rgba(255, 170, 0, 0.65);
    filter: brightness(1.08);
    color: #111;
}

/* Question Screen Phone Container */
.player-game-area {
    width: 100%;
    max-width: 620px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: calc(100dvh - 120px);
}

.player-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.25rem 0.75rem;
    width: 100%;
}

.player-q-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 6px 16px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.player-timer-badge {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 3.5px solid var(--accent);
    background: radial-gradient(circle, rgba(255, 211, 92, 0.25) 0%, rgba(9, 5, 20, 0.9) 80%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 211, 92, 0.45);
    transition: all 0.25s ease;
}

.player-timer-badge.urgent {
    border-color: #ff3355 !important;
    background: radial-gradient(circle, rgba(255, 51, 85, 0.4) 0%, rgba(9, 5, 20, 0.9) 80%) !important;
    box-shadow: 0 0 25px rgba(255, 51, 85, 0.8) !important;
    animation: urgentPulse 0.5s infinite alternate;
}

@keyframes urgentPulse {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

/* 2x2 Phone Quadrant Grid */
.player-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    flex-grow: 1;
    width: 100%;
    min-height: calc(100dvh - 180px);
    max-height: 580px;
}

/* 2 options layout (True / False) */
.player-grid-container.options-2 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
}

/* 3 options layout */
.player-grid-container.options-3 .grid-choice-2 {
    grid-column: span 2;
}

/* Quadrant Shape Buttons */
.player-shape-btn {
    width: 100%;
    height: 100%;
    min-height: 125px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    position: relative;
    overflow: hidden;
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), filter 0.15s ease, box-shadow 0.15s ease;
}

.player-shape-btn:active {
    transform: scale(0.95);
    filter: brightness(1.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.player-shape-btn i {
    font-size: 4.2rem;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
    transition: transform 0.15s ease;
}

.player-shape-btn:active i {
    transform: scale(1.1);
}

.player-shape-tag {
    position: absolute;
    top: 12px;
    left: 14px;
    font-size: 0.9rem;
    font-weight: 800;
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.25);
    padding: 3px 10px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

/* Waiting / Locked In Badge */
.waiting-badge-selected {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 1.15rem;
    font-weight: 800;
    margin: 15px auto;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Live Pulse Radar for Lobby */
.pulse-radar-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background-color: #00cc66;
    display: inline-block;
    box-shadow: 0 0 12px #00cc66;
    animation: radarBlink 1.4s infinite;
}

@keyframes radarBlink {
    0% { transform: scale(0.85); opacity: 0.5; }
    50% { transform: scale(1.35); opacity: 1; }
    100% { transform: scale(0.85); opacity: 0.5; }
}

/* Responsive Media Queries (< 576px) */
@media (max-width: 575.98px) {
    header {
        padding: 0.65rem 0.85rem !important;
    }

    .logo {
        font-size: 1.35rem !important;
    }

    .player-chip {
        font-size: 0.82rem;
        padding: 3px 8px 3px 4px;
        max-width: 175px;
    }

    .player-chip-avatar {
        width: 26px;
        height: 26px;
        font-size: 0.95rem;
    }

    .player-chip-name {
        max-width: 65px;
    }

    .mobile-card {
        padding: 1.5rem 1.25rem !important;
        border-radius: 22px !important;
    }

    .player-input {
        height: 52px;
        font-size: 1.2rem;
    }

    .player-input-pin {
        font-size: 1.75rem;
        letter-spacing: 4px;
    }

    .btn-enter-game {
        height: 52px;
        font-size: 1.15rem;
    }

    .player-shape-btn {
        min-height: 105px;
        border-radius: 18px;
    }

    .player-shape-btn i {
        font-size: 3.2rem;
    }

    .player-grid-container {
        gap: 10px;
        min-height: calc(100dvh - 150px);
    }

    .avatar-lg {
        width: 95px;
        height: 95px;
        font-size: 3.5rem;
    }
}

/* ================= QUESTION DRAG & DROP REORDERING ================= */
.question-item {
    transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    user-select: none;
}

.drag-handle {
    cursor: grab;
    user-select: none;
    touch-action: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 48px;
    color: var(--text-muted);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.drag-handle:hover {
    color: var(--accent);
    background: rgba(255, 211, 92, 0.18);
    border-color: rgba(255, 211, 92, 0.4);
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(255, 211, 92, 0.3);
}

.drag-handle:active {
    cursor: grabbing;
    transform: scale(0.95);
}

/* Sortable States (SortableJS + HTML5 Drag) */
.sortable-ghost {
    opacity: 0.3 !important;
    background: rgba(255, 211, 92, 0.08) !important;
    border: 2px dashed var(--accent) !important;
    box-shadow: 0 0 25px rgba(255, 211, 92, 0.35) !important;
}

.sortable-chosen {
    border-color: var(--accent) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6) !important;
}

.sortable-drag {
    opacity: 0.95 !important;
    transform: scale(1.02) !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.85), 0 0 25px rgba(255, 211, 92, 0.4) !important;
    background: rgba(25, 17, 58, 0.95) !important;
    cursor: grabbing !important;
}

