/* ==========================================================
 * 🎨 styles.css - 네온 레트로 보드게임 테마 디자인 시스템
 * 사이버펑크 감성의 딥 다크 배경, 글로우 효과, 글래스모피즘,
 * 모바일 최적화 및 25인 이상 모니터링을 위한 고성능 레이아웃.
 * ========================================================== */

:root {
    --bg-dark: #07070e;
    --bg-panel: rgba(13, 13, 29, 0.7);
    --bg-card: rgba(22, 17, 45, 0.6);
    --border-light: rgba(255, 255, 255, 0.08);
    
    /* Neon Colors */
    --neon-pink: #ff007f;
    --neon-cyan: #00f0ff;
    --neon-purple: #9d4edd;
    --neon-yellow: #ffb703;
    --neon-green: #39ff14;
    --neon-red: #ff3131;
    
    /* Fonts */
    --font-main: 'Outfit', sans-serif;
    --font-orbitron: 'Orbitron', sans-serif;
    --font-retro: 'Press Start 2P', monospace;
}

/* Reset & Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 10% 20%, rgba(157, 78, 221, 0.15) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(0, 240, 255, 0.12) 0px, transparent 50%);
    background-attachment: fixed;
    color: #f1f1f6;
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.5;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(157, 78, 221, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--neon-purple);
}

/* Font Classes */
.font-orbitron { font-family: var(--font-orbitron); }
.font-retro { font-family: var(--font-retro); font-size: 11px; }

/* Color Helper Classes */
.text-pink { color: var(--neon-pink); }
.text-cyan { color: var(--neon-cyan); }
.text-purple { color: var(--neon-purple); }
.text-yellow { color: var(--neon-yellow); }
.text-white { color: #ffffff; }
.text-lime { color: var(--neon-green); }

/* Animations */
@keyframes glow-pink-pulse {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 0, 127, 0.4), inset 0 0 5px rgba(255, 0, 127, 0.2); }
    50% { box-shadow: 0 0 20px rgba(255, 0, 127, 0.8), inset 0 0 10px rgba(255, 0, 127, 0.4); }
}

@keyframes glow-cyan-pulse {
    0%, 100% { box-shadow: 0 0 5px rgba(0, 240, 255, 0.4), inset 0 0 5px rgba(0, 240, 255, 0.2); }
    50% { box-shadow: 0 0 20px rgba(0, 240, 255, 0.8), inset 0 0 10px rgba(0, 240, 255, 0.4); }
}

@keyframes text-glow-pink {
    0%, 100% { text-shadow: 0 0 4px rgba(255, 0, 127, 0.6); }
    50% { text-shadow: 0 0 12px rgba(255, 0, 127, 1), 0 0 20px rgba(255, 0, 127, 0.5); }
}

@keyframes text-glow-cyan {
    0%, 100% { text-shadow: 0 0 4px rgba(0, 240, 255, 0.6); }
    50% { text-shadow: 0 0 12px rgba(0, 240, 255, 1), 0 0 20px rgba(0, 240, 255, 0.5); }
}

@keyframes pulse-animation {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.02); opacity: 1; }
}

.animate-glow {
    animation: text-glow-pink 3s infinite ease-in-out;
}
#screen-role-select .text-cyan.animate-glow {
    animation: text-glow-cyan 3s infinite ease-in-out;
}
#screen-role-select .text-yellow.animate-glow {
    animation: text-glow-yellow 3s infinite ease-in-out;
}
.animate-pulse {
    animation: pulse-animation 2s infinite ease-in-out;
}

@keyframes text-glow-yellow {
    0%, 100% { text-shadow: 0 0 4px rgba(255, 183, 3, 0.6); }
    50% { text-shadow: 0 0 12px rgba(255, 183, 3, 1), 0 0 20px rgba(255, 183, 3, 0.5); }
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Main Header */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 40px;
    background: rgba(7, 7, 14, 0.8);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    font-family: var(--font-orbitron);
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.btn-sound {
    background: transparent;
    border: 1px solid var(--neon-purple);
    color: var(--neon-purple);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sound:hover, .btn-sound.active {
    background: var(--neon-purple);
    color: #ffffff;
    box-shadow: 0 0 10px var(--neon-purple);
}

/* Containers */
.container {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Screen Handlers */
.screen, .screen-full {
    display: none;
}
.screen.active, .screen-full.active {
    display: block;
}
.screen {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 1. 역할 선택 화면 */
#screen-role-select {
    max-width: 800px;
    margin: 60px auto;
    text-align: center;
}

.logo-area {
    margin-bottom: 50px;
}

.neon-title {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 8px;
    line-height: 1.1;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    letter-spacing: 3px;
    font-weight: 600;
    margin-top: 15px;
}

.role-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.role-select-card {
    background: rgba(13, 13, 29, 0.5);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 40px 30px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}

.role-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.role-select-card h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
    letter-spacing: 1px;
}

.role-select-card p {
    font-size: 0.95rem;
    color: #a0a0c0;
    line-height: 1.6;
}

/* Card Hover Glows */
.role-select-card.card-pink:hover {
    transform: translateY(-8px);
    border-color: var(--neon-pink);
    box-shadow: 0 0 30px rgba(255, 0, 127, 0.4);
    background: rgba(255, 0, 127, 0.05);
}

.role-select-card.card-cyan:hover {
    transform: translateY(-8px);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.4);
    background: rgba(0, 240, 255, 0.05);
}

.main-footer {
    margin-top: 60px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.6;
    text-shadow: 0 0 8px rgba(157, 78, 221, 0.4);
    transition: opacity 0.3s;
}
.main-footer:hover {
    opacity: 1;
}

/* Setup Boxes & Inputs */
.setup-box {
    max-width: 500px;
    margin: 40px auto;
}

.input-group {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.input-group input[type="text"],
.input-group input[type="number"] {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(157, 78, 221, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    color: #ffffff;
    font-family: var(--font-orbitron);
    font-size: 1.1rem;
    transition: all 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

/* Buttons System */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 10px;
    font-family: var(--font-orbitron);
    font-weight: 700;
    font-size: 1rem;
    padding: 14px 28px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    color: #ffffff;
    width: 100%;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 6px;
    width: auto;
}

.btn-pink-glow {
    background: linear-gradient(135deg, var(--neon-pink), #cc0066);
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.3);
}
.btn-pink-glow:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 0 25px rgba(255, 0, 127, 0.6);
}

.btn-cyan-glow {
    background: linear-gradient(135deg, var(--neon-cyan), #00b0c0);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
    color: #07070e;
}
.btn-cyan-glow:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.6);
}

.btn-purple-glow {
    background: linear-gradient(135deg, var(--neon-purple), #7b2cbf);
    box-shadow: 0 0 15px rgba(157, 78, 221, 0.3);
}
.btn-purple-glow:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 0 25px rgba(157, 78, 221, 0.6);
}

.btn-action:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-link {
    background: transparent;
    border: none;
    font-family: var(--font-orbitron);
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    text-decoration: underline;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

/* 2. 교사 대기실 */
.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.room-code {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 5px;
    text-shadow: 0 0 10px rgba(255, 0, 127, 0.5);
}

.lobby-ip-box {
    max-width: 400px;
    text-align: right;
}

.lobby-ip-box p {
    font-size: 0.9rem;
    margin-top: 5px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    font-family: var(--font-orbitron);
}

.badge-purple { background: rgba(157, 78, 221, 0.2); border: 1px solid var(--neon-purple); color: #ffffff; }
.badge-pink { background: rgba(255, 0, 127, 0.2); border: 1px solid var(--neon-pink); color: #ffffff; }
.badge-cyan { background: rgba(0, 240, 255, 0.2); border: 1px solid var(--neon-cyan); color: #07070e; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.lobby-students-section {
    min-height: 350px;
    margin-bottom: 30px;
}

.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.student-lobby-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.student-lobby-card:hover {
    border-color: var(--neon-purple);
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.3);
}

.student-lobby-card .nickname {
    font-family: var(--font-orbitron);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.btn-kick {
    background: transparent;
    border: none;
    color: var(--neon-red);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 4px;
    transition: transform 0.2s;
}

.btn-kick:hover {
    transform: scale(1.2);
}

.placeholder-text {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    font-size: 1.1rem;
}

.action-bar {
    margin-top: 20px;
}

/* 3. 교사 대시보드 (본 게임) */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 24px;
    height: calc(100vh - 120px);
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
}

.market-panel {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 15px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Neon Price Board Cards */
.market-card {
    background: rgba(22, 17, 45, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    position: relative;
    transition: all 0.3s;
}

.market-card.price-up {
    border-color: rgba(57, 255, 20, 0.4);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.15);
}
.market-card.price-down {
    border-color: rgba(255, 49, 49, 0.4);
    box-shadow: 0 0 10px rgba(255, 49, 49, 0.15);
}

.market-card .name {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #a0a0c0;
    letter-spacing: 0.5px;
}

.market-card .price {
    font-size: 1.4rem;
    font-weight: 900;
    font-family: var(--font-orbitron);
    margin-bottom: 6px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.market-card.price-up .price { color: var(--neon-green); text-shadow: 0 0 8px rgba(57, 255, 20, 0.3); }
.market-card.price-down .price { color: var(--neon-red); text-shadow: 0 0 8px rgba(255, 49, 49, 0.3); }

.market-card .trend-indicator {
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.trend-indicator.up { color: var(--neon-green); }
.trend-indicator.down { color: var(--neon-red); }
.trend-indicator.flat { color: var(--neon-purple); }

.market-card .volume {
    font-size: 0.7rem;
    color: #6a6a8c;
    margin-top: 4px;
}

.logs-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.log-console {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px 16px;
    flex: 1;
    overflow-y: auto;
    font-size: 0.8rem;
    color: #a0a0c0;
    line-height: 1.6;
}

.log-entry {
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    padding-bottom: 4px;
    word-break: break-all;
}

.right-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-info {
    display: flex;
    gap: 12px;
}

.info-tag {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
}

.control-box {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
}

.table-wrapper {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.students-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.students-table th, .students-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.students-table th {
    background: rgba(13, 13, 29, 0.8);
    position: sticky;
    top: 0;
    color: #a0a0c0;
    font-weight: 700;
    z-index: 10;
}

.students-table tr.active-turn-row {
    background: rgba(0, 240, 255, 0.05);
}

.students-table tr.finished-row {
    opacity: 0.85;
}

/* Student statuses */
.status-thinking { color: var(--neon-yellow); font-weight: bold; }
.status-locked { color: var(--neon-cyan); font-weight: bold; text-shadow: 0 0 5px rgba(0, 240, 255, 0.3); }
.status-pass { color: var(--neon-purple); }

/* 4. 학생용 화면 */
.lobby-waiting {
    max-width: 500px;
    margin: 60px auto;
}

.neon-spinner-box {
    margin: 30px auto;
    display: flex;
    justify-content: center;
}

.neon-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(157, 78, 221, 0.1);
    border-top: 4px solid var(--neon-cyan);
    border-bottom: 4px solid var(--neon-pink);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

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

.student-nickname {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #ffffff;
}

.tutorial-box {
    max-width: 600px;
    margin: 40px auto;
}

.tutorial-content {
    text-align: left;
    margin: 25px 0;
    font-size: 0.95rem;
    line-height: 1.8;
}

.tutorial-content p {
    margin-bottom: 10px;
}

/* 학생용 인게임 레이아웃 */
.student-play-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: calc(100vh - 120px);
}

.student-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-title {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 0.5px;
}

.group-badge {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid var(--neon-cyan);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
}

.header-assets {
    display: flex;
    gap: 30px;
    font-size: 1.1rem;
    font-weight: 700;
}

.asset-item span {
    font-family: var(--font-orbitron);
}

.header-turn {
    font-size: 1.2rem;
    font-weight: 900;
}

.play-content-area {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    flex: 1;
    overflow: hidden;
}

.hand-section {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cards-hand {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-top: 15px;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 10px;
    align-content: start;
}

/* Neon Game Cards Layout */
.game-card {
    background: linear-gradient(180deg, rgba(22, 17, 45, 0.8), rgba(11, 7, 24, 0.95));
    border: 2px solid var(--border-light);
    border-radius: 16px;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 320px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.game-card:hover {
    transform: translateY(-10px) scale(1.02);
}

/* Keyword Card Styles */
.game-card.card-keyword {
    border-color: rgba(157, 78, 221, 0.4);
    box-shadow: 0 4px 15px rgba(157, 78, 221, 0.15);
}
.game-card.card-keyword:hover {
    border-color: var(--neon-purple);
    box-shadow: 0 10px 25px rgba(157, 78, 221, 0.4);
}

/* Special Card Styles */
.game-card.card-special {
    border-color: rgba(255, 0, 127, 0.4);
    box-shadow: 0 4px 15px rgba(255, 0, 127, 0.15);
}
.game-card.card-special:hover {
    border-color: var(--neon-pink);
    box-shadow: 0 10px 25px rgba(255, 0, 127, 0.4);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-orbitron);
}

.card-badge-keyword { background: rgba(157, 78, 221, 0.2); border: 1px solid var(--neon-purple); color: #ffffff; }
.card-badge-special { background: rgba(255, 0, 127, 0.2); border: 1px solid var(--neon-pink); color: #ffffff; }

.card-icon {
    font-size: 1.5rem;
    color: var(--neon-cyan);
}

.card-middle {
    text-align: center;
    margin: 20px 0;
}

.card-name {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    word-break: keep-all;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
}

.card-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
}

.card-price-label {
    font-size: 0.7rem;
    color: #6a6a8c;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.card-price-val {
    font-size: 1.3rem;
    font-weight: 900;
    font-family: var(--font-orbitron);
    color: #ffffff;
}

.card-desc {
    font-size: 0.75rem;
    color: #a0a0c0;
    line-height: 1.4;
}

.btn-card-use {
    background: transparent;
    border: 1px solid var(--neon-pink);
    color: var(--neon-pink);
    width: 100%;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: bold;
    font-family: var(--font-orbitron);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-card-use:hover {
    background: var(--neon-pink);
    color: #ffffff;
    box-shadow: 0 0 10px var(--neon-pink);
}

.action-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.deck-info {
    padding: 20px;
}

.deck-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.3));
}

.deck-title {
    font-size: 0.8rem;
    color: #a0a0c0;
    font-weight: bold;
    letter-spacing: 1px;
}

.deck-count {
    font-size: 1.4rem;
    font-weight: 900;
    margin-top: 4px;
    text-shadow: 0 0 5px rgba(255, 0, 127, 0.3);
}

.controls-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.turn-status-banner {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-light);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin: 15px 0;
    font-weight: 600;
}

.turn-active-banner {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
    background: rgba(0, 240, 255, 0.02);
}

.student-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 5. Leaderboard / Game Over */
.leaderboard-box {
    max-width: 800px;
    margin: 30px auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.leaderboard-table th, .leaderboard-table td {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.leaderboard-table th {
    color: #a0a0c0;
    font-weight: bold;
}

.leaderboard-table tr:nth-child(1) td { color: var(--neon-yellow); font-size: 1.1rem; font-weight: bold; text-shadow: 0 0 5px rgba(255, 183, 3, 0.3); }
.leaderboard-table tr:nth-child(2) td { color: #d4d4d4; font-weight: bold; }
.leaderboard-table tr:nth-child(3) td { color: #cd7f32; font-weight: bold; }

/* 6. Popups System */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.popup-overlay.active {
    display: flex;
}

.popup-content {
    max-width: 480px;
    width: 90%;
    text-align: center;
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.popup-content.card-cyan { border-color: var(--neon-cyan); box-shadow: 0 0 30px rgba(0, 240, 255, 0.3); }
.popup-content.card-pink { border-color: var(--neon-pink); box-shadow: 0 0 30px rgba(255, 0, 127, 0.3); }

.popup-keyword-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 5px;
}

.btn-popup-keyword {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: #ffffff;
    font-family: var(--font-orbitron);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-popup-keyword:hover {
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.05);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.popup-close {
    margin-top: 10px;
}

.quiz-question-box {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 0, 127, 0.2);
    border-radius: 12px;
    padding: 24px;
    font-size: 1.6rem;
    font-weight: 900;
    margin: 20px 0;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 0, 127, 0.4);
    letter-spacing: 1px;
}

#quiz-answer-input {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 0, 127, 0.4);
    border-radius: 8px;
    padding: 14px;
    color: #ffffff;
    font-family: var(--font-orbitron);
    font-size: 1.4rem;
    text-align: center;
    width: 100%;
}

#quiz-answer-input:focus {
    outline: none;
    border-color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.3);
}

#btn-submit-quiz {
    margin-top: 10px;
    margin-bottom: 10px;
}

/* ==========================================================
 * 📱 Mobile Responsive Styles (Student View optimized)
 * ========================================================== */
@media (max-width: 900px) {
    .container {
        padding: 0 10px;
        margin: 20px auto;
    }
    
    .role-cards-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .top-nav {
        padding: 12px 20px;
    }
    
    .lobby-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .lobby-ip-box {
        text-align: left;
        max-width: 100%;
    }

    /* Student In-game Dashboard Mobile */
    .student-play-grid {
        height: auto;
        overflow: visible;
    }
    
    .student-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px;
    }
    
    .header-assets {
        gap: 15px;
        font-size: 0.95rem;
        width: 100%;
        justify-content: space-between;
    }
    
    .header-turn {
        font-size: 1rem;
    }

    .play-content-area {
        grid-template-columns: 1fr;
        overflow: visible;
    }
    
    .cards-hand {
        grid-template-columns: repeat(2, 1fr);
        height: auto;
        overflow-y: visible;
    }
    
    /* Scroll horizontally on small screens instead of 2-grid column for hand cards?
     * Actually, let's keep them as a 2x2+1 grid which is easier to click on mobile */
    .game-card {
        height: 250px;
        padding: 12px 10px;
    }
    
    .card-name {
        font-size: 0.95rem;
    }
    .card-desc {
        font-size: 0.7rem;
    }
    .card-price-val {
        font-size: 1.1rem;
    }
    
    .action-section {
        flex-direction: column-reverse;
    }
}
