/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0a0a1a;
    --bg-card: #111128;
    --bg-card-hover: #1a1a3a;
    --accent: #00d4ff;
    --accent-glow: rgba(0, 212, 255, 0.3);
    --danger: #ff3366;
    --danger-glow: rgba(255, 51, 102, 0.3);
    --success: #00ff88;
    --success-glow: rgba(0, 255, 136, 0.3);
    --warning: #ffaa00;
    --warning-glow: rgba(255, 170, 0, 0.3);
    --text: #e0e0f0;
    --text-dim: #8888aa;
    --text-bright: #ffffff;
    --border: rgba(255, 255, 255, 0.08);
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

body {
    font-family: var(--font);
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    position: relative;
    min-height: 100vh;
}

#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ========== SCREENS ========== */
.screen {
    display: none;
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* ========== TITLE SCREEN ========== */
#title-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

.title-content {
    max-width: 800px;
}

.glitch-wrapper {
    margin-bottom: 1rem;
}

.glitch {
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 900;
    color: var(--text-bright);
    position: relative;
    text-shadow: 0 0 40px var(--accent-glow);
    letter-spacing: 0.05em;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 2s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
    color: var(--accent);
    opacity: 0.8;
}

.glitch::after {
    animation: glitch-2 3s infinite linear alternate-reverse;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
    color: var(--danger);
    opacity: 0.8;
}

@keyframes glitch-1 {
    0%, 95% { transform: translateX(0); }
    96% { transform: translateX(-4px); }
    97% { transform: translateX(4px); }
    98% { transform: translateX(-2px); }
    99% { transform: translateX(2px); }
    100% { transform: translateX(0); }
}

@keyframes glitch-2 {
    0%, 93% { transform: translateX(0); }
    94% { transform: translateX(3px); }
    95% { transform: translateX(-3px); }
    96% { transform: translateX(5px); }
    97% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

.subtitle {
    font-size: 1.4rem;
    color: var(--accent);
    font-weight: 300;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-dim);
    line-height: 1.8;
    margin-bottom: 2rem;
}

/* Language Toggle */
.lang-toggle {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    color: var(--text);
}

.lang-btn.active {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.role-label {
    font-size: 0.9rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 1.5rem;
}

.role-cards {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.role-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    width: 200px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    color: var(--text);
    font-family: var(--font);
}

.role-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
    transform: translateY(-4px);
}

.role-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
}

.role-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    filter: grayscale(30%);
}

.role-card:hover .role-avatar {
    border-color: var(--accent);
    filter: grayscale(0%);
    box-shadow: 0 0 20px var(--accent-glow);
}

.role-card.selected .role-avatar {
    border-color: var(--accent);
    filter: grayscale(0%);
    box-shadow: 0 0 25px var(--accent-glow);
}

.role-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-bright);
}

.role-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.4;
}

/* Credits */
.credits {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.8rem;
    line-height: 1.8;
    text-align: center;
}

.credits a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.3s;
}

.credits a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.credits strong {
    color: var(--text);
}

/* ========== GAME SCREEN ========== */
#game-screen {
    padding-bottom: 4rem; /* room for fixed news-ticker */
}

/* Top Bar */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem 0.5rem;
}

.timeline-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    position: relative;
    margin-bottom: 0.5rem;
    overflow: visible;
}

.timeline-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--danger));
    border-radius: 3px;
    width: 0%;
    transition: width 0.8s ease;
    box-shadow: 0 0 10px var(--accent-glow);
}

.timeline-markers {
    position: absolute;
    top: -4px;
    left: 0;
    width: 100%;
    height: 14px;
    pointer-events: none;
}

.timeline-marker {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--text-dim);
    transform: translateX(-50%);
    transition: all 0.3s;
}

.timeline-marker.active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.timeline-marker.completed {
    background: var(--success);
    border-color: var(--success);
}

.top-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.role-indicator {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.role-indicator-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.role-indicator-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.05em;
}

.date-display {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 1rem;
    padding: 0.8rem 2rem;
    background: rgba(10, 10, 26, 0.8);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    flex-wrap: wrap;
    justify-content: center;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 160px;
}

.stat-icon {
    font-size: 1.2rem;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 65px;
}

.stat-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    min-width: 60px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.6s ease;
}

.stat-fill.security { background: var(--success); }
.stat-fill.approval { background: var(--warning); }
.stat-fill.lead { background: #8866ff; }
.stat-fill.risk { background: var(--danger); }

/* ========== MAIN CONTENT ========== */
.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

/* Narrative Panel */
.narrative-panel {
    animation: fadeSlideUp 0.6s ease;
}

.phase-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), #0088cc);
    color: var(--bg-dark);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

#phase-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.narrative-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text);
}

.narrative-text p {
    margin-bottom: 1rem;
}

.narrative-text .highlight {
    color: var(--accent);
    font-weight: 600;
}

.narrative-text .danger {
    color: var(--danger);
    font-weight: 600;
}

.narrative-text .stat-change {
    display: inline-block;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.btn-next-narrative {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, var(--accent), #0088cc);
    color: var(--bg-dark);
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font);
}

.btn-next-narrative:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

/* Decision Panel */
.decision-panel {
    animation: fadeSlideUp 0.5s ease;
}

.decision-panel h3 {
    font-size: 1.3rem;
    color: var(--text-bright);
    margin-bottom: 1.5rem;
    text-align: center;
    line-height: 1.4;
}

.decision-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.decision-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
    position: relative;
    overflow: hidden;
}

.decision-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.3s;
}

.decision-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateX(4px);
}

.decision-btn:hover::before {
    opacity: 1;
}

.decision-btn .option-label {
    font-weight: 700;
    color: var(--accent);
    display: block;
    margin-bottom: 0.3rem;
}

.decision-btn .option-desc {
    font-size: 0.9rem;
    color: var(--text-dim);
}

.decision-btn .option-effects {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-dim);
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.effect-positive { color: var(--success); }
.effect-negative { color: var(--danger); }

/* Consequence Panel */
.consequence-panel {
    animation: fadeSlideUp 0.5s ease;
    text-align: center;
}

.consequence-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.consequence-content h3 {
    color: var(--text-bright);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.consequence-content p {
    line-height: 1.7;
    margin-bottom: 0.8rem;
}

.stat-changes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.stat-change-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
}

.stat-up { color: var(--success); }
.stat-down { color: var(--danger); }

.btn-continue {
    padding: 0.8rem 2.5rem;
    background: linear-gradient(135deg, var(--accent), #0088cc);
    color: var(--bg-dark);
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font);
}

.btn-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

/* Knowledge Panel */
.knowledge-panel {
    animation: fadeSlideUp 0.5s ease;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(0, 136, 204, 0.05));
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 16px;
    padding: 2rem;
    text-align: left;
}

.knowledge-badge {
    display: inline-block;
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.knowledge-panel h3 {
    color: var(--text-bright);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.knowledge-panel p, .knowledge-panel li {
    line-height: 1.7;
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

.knowledge-panel ul {
    padding-left: 1.2rem;
    margin-bottom: 1rem;
}

.knowledge-panel .btn-continue {
    margin-top: 1rem;
}

/* Quiz Panel */
.quiz-panel {
    animation: fadeSlideUp 0.5s ease;
    background: linear-gradient(135deg, rgba(136, 102, 255, 0.05), rgba(102, 68, 204, 0.05));
    border: 1px solid rgba(136, 102, 255, 0.15);
    border-radius: 16px;
    padding: 2rem;
}

.quiz-badge {
    display: inline-block;
    background: rgba(136, 102, 255, 0.15);
    color: #aa88ff;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.quiz-panel h3 {
    color: var(--text-bright);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.4;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.quiz-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
}

.quiz-btn:hover:not(.disabled) {
    background: var(--bg-card-hover);
    border-color: #aa88ff;
}

.quiz-btn.correct {
    background: rgba(0, 255, 136, 0.1);
    border-color: var(--success);
    cursor: default;
}

.quiz-btn.wrong {
    background: rgba(255, 51, 102, 0.1);
    border-color: var(--danger);
    cursor: default;
    opacity: 0.6;
}

.quiz-btn.disabled {
    cursor: default;
    opacity: 0.5;
}

.quiz-feedback {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.quiz-feedback.correct {
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid rgba(0, 255, 136, 0.2);
    color: var(--success);
}

.quiz-feedback.wrong {
    background: rgba(255, 51, 102, 0.08);
    border: 1px solid rgba(255, 51, 102, 0.2);
    color: var(--danger);
}

/* News Ticker */
.news-ticker {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 26, 0.95);
    border-top: 1px solid var(--border);
    padding: 0.5rem 0;
    overflow: hidden;
    z-index: 100;
    height: 2.2rem;
}

.ticker-content {
    display: flex;
    gap: 4rem;
    animation: ticker 30s linear infinite;
    white-space: nowrap;
    font-size: 0.8rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ticker-item .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

@keyframes ticker {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(-200%); }
}

/* ========== CTA BOX ========== */
.cta-box {
    margin: 2.5rem 0 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(136, 102, 255, 0.08));
    border: 1px solid rgba(0, 212, 255, 0.25);
    border-radius: 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: ctaSweep 3s ease-in-out infinite;
}

@keyframes ctaSweep {
    0% { transform: translateX(-30%); }
    100% { transform: translateX(30%); }
}

.cta-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), #8866ff);
    color: var(--bg-dark);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.cta-box h3 {
    font-size: 1.2rem;
    color: var(--text-bright);
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.cta-box p {
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.cta-primary {
    background: linear-gradient(135deg, var(--accent), #0088cc);
    color: var(--bg-dark);
    border: none;
}

.cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.cta-secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.cta-secondary:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

/* ========== ENDING SCREEN ========== */
#ending-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

.ending-content {
    max-width: 700px;
    margin: 0 auto;
}

.ending-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-bright);
}

.ending-content .ending-subtitle {
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 2rem;
}

.ending-content .ending-narrative {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    text-align: left;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.ending-content .ending-narrative p {
    margin-bottom: 1rem;
}

.ending-image-wrap {
    margin-bottom: 1.5rem;
}

.ending-image {
    width: 100%;
    max-width: 600px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    image-rendering: pixelated;
}

.score-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.score-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem;
}

.score-item .score-icon {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.score-item .score-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-bright);
    font-family: var(--font-mono);
}

.score-item .score-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.learnings-list {
    text-align: left;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}

.learnings-list h3 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.learnings-list ul {
    list-style: none;
    padding: 0;
}

.learnings-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.learnings-list li:last-child {
    border-bottom: none;
}

.learnings-list li::before {
    content: '✦';
    color: var(--accent);
    flex-shrink: 0;
}

.btn-restart {
    padding: 1rem 3rem;
    background: linear-gradient(135deg, var(--accent), #0088cc);
    color: var(--bg-dark);
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font);
}

.btn-restart:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 30px var(--accent-glow);
}

/* ========== AUDIO CONTROLS ========== */
.audio-controls {
    position: fixed;
    bottom: 2rem;
    right: 1rem;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
    background: rgba(17, 17, 40, 0.85);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 4px 6px 4px 4px;
    transition: all 0.3s;
}

.audio-controls:hover {
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.08);
}

.mute-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mute-btn:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: scale(1.1);
}

.mute-btn.muted {
    opacity: 0.4;
}

/* Music slider */
.music-slider-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding-right: 6px;
}

.slider-icon {
    font-size: 0.8rem;
    opacity: 0.7;
    user-select: none;
}

.music-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--val, 25%), rgba(255,255,255,0.12) var(--val, 25%));
    outline: none;
    cursor: pointer;
    transition: opacity 0.3s;
}

/* Thumb */
.music-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg);
    cursor: pointer;
    box-shadow: 0 0 6px var(--accent-glow);
    transition: transform 0.2s;
}

.music-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.music-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg);
    cursor: pointer;
    box-shadow: 0 0 6px var(--accent-glow);
}

/* Track fill for Firefox */
.music-slider::-moz-range-track {
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.12);
}

.music-slider::-moz-range-progress {
    height: 4px;
    border-radius: 2px;
    background: var(--accent);
}

/* ========== GAME LAYOUT ========== */
.game-layout {
    max-width: 800px;
    margin: 0 auto;
}

/* ========== VISUAL CONTAINER ========== */
.visual-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    display: none;
}

.visual-container.active {
    display: block;
    animation: fadeSlideUp 0.8s ease;
}

.visual-container canvas {
    width: 100%;
    height: 280px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(10, 10, 26, 0.6);
}

/* ========== DESKTOP SIDE-BY-SIDE LAYOUT ========== */
@media (min-width: 1024px) {
    .game-layout {
        display: flex;
        flex-direction: row-reverse;
        gap: 2rem;
        max-width: 1400px;
        padding: 0 2rem;
        align-items: flex-start;
    }

    .visual-container {
        position: sticky;
        top: 140px;
        flex: 0 0 420px;
        max-width: 420px;
        padding: 0;
        margin: 0;
    }

    .visual-container canvas {
        height: 350px;
    }

    .main-content {
        flex: 1;
        max-width: none;
        margin: 0;
        padding: 2rem 0;
    }
}

/* ========== ROLE INTRO STYLING ========== */
.role-intro {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.06), rgba(136, 102, 255, 0.06));
    border-left: 3px solid var(--accent);
    padding: 0.8rem 1.2rem;
    border-radius: 0 10px 10px 0;
    margin-bottom: 1.2rem;
    font-style: italic;
    color: var(--text);
    line-height: 1.7;
}

.role-tag {
    display: inline-block;
    font-style: normal;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-right: 0.5rem;
    padding: 0.15rem 0.5rem;
    background: rgba(0, 212, 255, 0.12);
    border-radius: 4px;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .visual-container {
        padding: 0 1rem;
    }
    .visual-container canvas {
        height: 200px;
    }
    .audio-controls {
        bottom: 3.5rem;
        right: 0.5rem;
        padding: 3px 5px 3px 3px;
    }
    .mute-btn {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    .music-slider {
        width: 60px;
    }
    .slider-icon {
        font-size: 0.7rem;
    }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    #title-screen {
        justify-content: flex-start;
        padding: 1.5rem 1rem 5rem;
    }

    .subtitle {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .tagline {
        font-size: 0.9rem;
        margin-bottom: 1rem;
        line-height: 1.6;
    }

    .lang-toggle {
        margin-bottom: 1rem;
    }

    .role-label {
        margin-bottom: 0.8rem;
    }

    .credits {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }

    .role-cards {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }

    .role-card {
        width: 100%;
        max-width: 300px;
        flex-direction: row;
        padding: 0.8rem 1rem;
        text-align: left;
        gap: 0.8rem;
    }

    .role-card .role-avatar {
        width: 50px;
        height: 50px;
        flex-shrink: 0;
    }

    .role-name {
        font-size: 0.9rem;
    }

    .role-desc {
        font-size: 0.75rem;
    }

    .role-indicator-avatar {
        width: 36px;
        height: 36px;
    }

    .stats-bar {
        padding: 0.6rem 1rem;
        gap: 0.5rem;
    }

    .stat {
        min-width: 130px;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

    #game-screen {
        padding-bottom: 5rem; /* extra room for fixed ticker + audio controls */
    }

    .glitch {
        font-size: 3rem;
    }
}

/* ========== TYPEWRITER ========== */
.typewriter {
    overflow: hidden;
}

/* ========== NOTIFICATION POPUP ========== */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    z-index: 1000;
    animation: slideInRight 0.4s ease, fadeOut 0.4s ease 2.6s;
    max-width: 300px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.notification.danger {
    border-color: var(--danger);
}

.notification.warning {
    border-color: var(--warning);
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
