:root {
    --bg-primary: #07111f;
    --bg-secondary: #0b1730;
    --panel: rgba(10, 18, 36, 0.9);
    --panel-soft: rgba(14, 26, 52, 0.82);
    --panel-border: rgba(148, 163, 184, 0.18);
    --text-primary: #edf4ff;
    --text-secondary: #9fb0c9;
    --text-muted: #7f92b0;
    --blue-strong: #3b82f6;
    --blue-soft: #60a5fa;
    --teal-strong: #14b8a6;
    --teal-soft: #5eead4;
    --gold-strong: #f59e0b;
    --gold-soft: #fde68a;
    --danger: #f87171;
    --danger-deep: #ef4444;
    --success: #4ade80;
    --shadow-xl: 0 30px 90px rgba(2, 6, 23, 0.46);
    --shadow-lg: 0 22px 50px rgba(2, 6, 23, 0.34);
    --shadow-md: 0 16px 32px rgba(2, 6, 23, 0.22);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
}

* {
    box-sizing: border-box;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

html {
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.34), transparent 24%),
        radial-gradient(circle at top right, rgba(20, 184, 166, 0.18), transparent 22%),
        radial-gradient(circle at bottom, rgba(245, 158, 11, 0.12), transparent 18%),
        linear-gradient(180deg, #040914 0%, #07111f 34%, #09182e 100%);
    color: var(--text-primary);
    transition: background 0.35s ease, transform 0.2s ease;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, black 45%, transparent 100%);
    opacity: 0.45;
}

.container {
    position: relative;
    max-width: 1140px;
    margin: 28px auto;
    padding: 30px;
    border-radius: 34px;
    background:
        linear-gradient(180deg, rgba(10, 18, 36, 0.92) 0%, rgba(9, 18, 34, 0.86) 100%);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(18px);
}

.container::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 33px;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

h1,
h2,
h3 {
    margin-top: 0;
    line-height: 1.06;
}

h1 {
    font-size: clamp(38px, 5vw, 58px);
    margin-bottom: 12px;
    letter-spacing: -0.05em;
    color: #f8fbff;
}

h2 {
    font-size: clamp(28px, 3vw, 38px);
    letter-spacing: -0.04em;
    color: #f6fbff;
}

h3 {
    color: #f2f7ff;
}

.subtitle {
    color: var(--text-secondary);
    margin: 0;
    max-width: 620px;
    line-height: 1.65;
    font-size: 17px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: start;
    padding: 8px 0 16px;
}

.hero-badge,
.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(251, 191, 36, 0.14) 100%);
    border: 1px solid rgba(245, 158, 11, 0.34);
    color: #ffd782;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: 16px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.hero-badge::before {
    content: "◆";
    color: #ffd782;
    font-size: 10px;
}

.hero-chips,
.rule-pills,
.life-panel,
.feedback-list,
.lobby-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-chips {
    margin-top: 22px;
}

.hero-chip,
.rule-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 999px;
    background: rgba(8, 15, 30, 0.72);
    border: 1px solid rgba(96, 165, 250, 0.16);
    color: #d8e7ff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.hero-chip:nth-child(1)::before,
.rule-pill:nth-child(1)::before {
    content: "⚑";
}

.hero-chip:nth-child(2)::before,
.rule-pill:nth-child(2)::before {
    content: "✦";
}

.hero-chip:nth-child(3)::before {
    content: "🛡";
}

.intro-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 16px 0 26px;
}

.intro-card,
.card,
.setup-box,
.lobby-identity,
.lobby-hero,
.inventory-panel,
.hint,
.summary-item,
.performance-banner,
.reward-box,
.player-panel {
    position: relative;
    overflow: hidden;
}

.intro-card {
    padding: 18px 20px;
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(17, 30, 58, 0.95) 0%, rgba(11, 24, 47, 0.92) 100%);
    border: 1px solid rgba(96, 165, 250, 0.12);
    box-shadow: var(--shadow-md);
}

.intro-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), transparent 45%, rgba(20, 184, 166, 0.08));
    pointer-events: none;
}

.intro-card strong {
    position: relative;
    display: block;
    margin-bottom: 10px;
    color: #f8fbff;
    font-size: 16px;
    letter-spacing: -0.02em;
}

.intro-card span,
.card-text,
.setup-note,
.reward-description,
.performance-description,
.footer-note {
    position: relative;
    color: var(--text-secondary);
    line-height: 1.65;
}

.howto-grid,
.room-grid,
.difficulty-grid,
.lobby-actions,
.summary-grid,
.inventory-grid {
    display: grid;
    gap: 14px;
}

.howto-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.room-grid,
.difficulty-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.lobby-actions {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin-top: 22px;
}

.summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    margin-top: 18px;
}

.inventory-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.card {
    border: 1px solid rgba(96, 165, 250, 0.12);
    border-radius: var(--radius-xl);
    padding: 28px;
    margin-top: 18px;
    background:
        linear-gradient(180deg, rgba(12, 22, 43, 0.96) 0%, rgba(8, 17, 34, 0.92) 100%);
    box-shadow: var(--shadow-lg);
    transition: transform 0.28s ease, box-shadow 0.28s ease, opacity 0.28s ease, border-color 0.28s ease;
    animation: cardFadeIn 0.35s ease;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(96, 165, 250, 0.1), transparent 34%);
    pointer-events: none;
}

.hidden {
    display: none !important;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
    color: #dce8fb;
    letter-spacing: 0.01em;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    padding: 15px 16px;
    border: 1px solid rgba(96, 165, 250, 0.18);
    border-radius: 16px;
    font-size: 16px;
    margin-bottom: 14px;
    background: rgba(6, 12, 24, 0.78);
    color: #f8fbff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

input::placeholder {
    color: #6f86aa;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus {
    outline: none;
    border-color: rgba(94, 234, 212, 0.55);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.16);
    transform: translateY(-1px);
}

button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border: none;
    border-radius: 16px;
    font-size: 15px;
    cursor: pointer;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 52%, #1d4ed8 100%);
    color: white;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 0.01em;
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

button:hover,
.button-link:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 20px 36px rgba(37, 99, 235, 0.32);
}

button:disabled,
.button-link:disabled {
    opacity: 0.56;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-secondary {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 50%, #0f766e 100%);
    box-shadow: 0 16px 28px rgba(20, 184, 166, 0.22);
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.topbar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.topbar .button-link,
.topbar button {
    background: rgba(11, 23, 48, 0.86);
    border: 1px solid rgba(96, 165, 250, 0.16);
    color: #dce8fb;
    box-shadow: none;
}

.topbar .button-link:hover,
.topbar button:hover {
    box-shadow: 0 14px 24px rgba(2, 6, 23, 0.22);
}

.option {
    display: block;
    width: 100%;
    text-align: left;
    margin: 0;
    background:
        linear-gradient(180deg, rgba(13, 25, 49, 0.96) 0%, rgba(9, 18, 36, 0.92) 100%);
    color: #edf4ff;
    border: 1px solid rgba(96, 165, 250, 0.14);
    padding: 18px 18px;
    border-radius: 18px;
}

.option:hover {
    background:
        linear-gradient(180deg, rgba(18, 35, 68, 0.98) 0%, rgba(13, 27, 53, 0.96) 100%);
}

.option.correct-pulse {
    animation: pulseCorrect 0.55s ease;
    border-color: rgba(74, 222, 128, 0.8);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.25) 0%, rgba(10, 18, 36, 0.96) 100%);
}

.option.wrong-shake {
    animation: shakeWrong 0.45s ease;
    border-color: rgba(248, 113, 113, 0.88);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18) 0%, rgba(10, 18, 36, 0.96) 100%);
}

.status {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 800;
    line-height: 1.55;
}

.success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.14) 0%, rgba(11, 24, 28, 0.88) 100%);
    color: #c8ffd9;
    border: 1px solid rgba(74, 222, 128, 0.34);
}

.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.14) 0%, rgba(28, 12, 18, 0.9) 100%);
    color: #ffd4d4;
    border: 1px solid rgba(248, 113, 113, 0.34);
}

.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.14) 0%, rgba(10, 18, 36, 0.9) 100%);
    color: #d9e8ff;
    border: 1px solid rgba(96, 165, 250, 0.28);
}

.progress {
    margin-top: 10px;
    font-size: 13px;
    color: #8ea5c9;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.progress-shell {
    margin-bottom: 18px;
}

.progress-track {
    width: 100%;
    height: 16px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(12, 22, 43, 0.92);
    border: 1px solid rgba(96, 165, 250, 0.14);
    box-shadow: inset 0 1px 2px rgba(2, 6, 23, 0.28);
}

.progress-bar {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb 0%, #38bdf8 35%, #14b8a6 100%);
    transition: width 0.4s ease;
    position: relative;
}

.progress-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: translateX(-100%);
    animation: progressGlow 2.2s linear infinite;
}

.hint {
    margin-top: 16px;
    padding: 24px 22px;
    border: 1px solid rgba(96, 165, 250, 0.26);
    border-left: 8px solid #3b82f6;
    background:
        linear-gradient(135deg, rgba(10, 18, 36, 0.96) 0%, rgba(12, 29, 58, 0.92) 100%);
    border-radius: 22px;
    line-height: 1.65;
    box-shadow: 0 18px 30px rgba(37, 99, 235, 0.12);
    font-size: 19px;
    color: #dce8fb;
}

.hint::before {
    content: "Charada Recebida";
    display: block;
    font-size: 12px;
    letter-spacing: 0.14em;
    font-weight: 800;
    text-transform: uppercase;
    color: #7dd3fc;
    margin-bottom: 12px;
}

.player-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px 22px;
    border: 1px solid rgba(96, 165, 250, 0.18);
    background:
        linear-gradient(135deg, rgba(13, 25, 49, 0.98) 0%, rgba(9, 18, 36, 0.94) 100%);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
}

.player-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 10px;
}

.player-meta span {
    display: inline-flex;
    align-items: center;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(7, 16, 31, 0.86);
    border: 1px solid rgba(96, 165, 250, 0.16);
    color: #dbe8ff;
    font-size: 13px;
    font-weight: 700;
}

.player-name {
    font-size: 24px;
    font-weight: 900;
    color: #f8fbff;
    margin-bottom: 4px;
    letter-spacing: -0.04em;
}

.account-email {
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.setup-box {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid rgba(96, 165, 250, 0.14);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(11, 21, 41, 0.9) 0%, rgba(8, 17, 34, 0.82) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.setup-box h3 {
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.room-card,
.difficulty-card {
    border: 1px solid rgba(96, 165, 250, 0.16);
    border-radius: 22px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(13, 25, 49, 0.96) 0%, rgba(9, 18, 36, 0.92) 100%);
    cursor: pointer;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
    text-align: left;
    color: inherit;
}

.room-card:hover,
.difficulty-card:hover {
    transform: translateY(-3px);
    border-color: rgba(94, 234, 212, 0.36);
    box-shadow: 0 18px 34px rgba(2, 6, 23, 0.26);
}

.room-card.selected,
.difficulty-card.selected {
    border-color: rgba(125, 211, 252, 0.62);
    background:
        linear-gradient(135deg, rgba(29, 78, 216, 0.24) 0%, rgba(15, 118, 110, 0.16) 100%);
    box-shadow: 0 20px 36px rgba(37, 99, 235, 0.2);
}

.room-card strong,
.difficulty-card strong {
    display: block;
    font-size: 20px;
    color: #f8fbff;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
}

.room-card span,
.difficulty-card span {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.life-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(80, 18, 22, 0.92);
    color: #ffd5d5;
    border: 1px solid rgba(248, 113, 113, 0.26);
    font-weight: 800;
}

.life-chip.safe {
    background: rgba(11, 52, 39, 0.92);
    color: #d0ffe2;
    border-color: rgba(74, 222, 128, 0.26);
}

#checkCodeButton,
#savePlayerNameButton,
#loginButton,
#registerButton,
#restartButton,
#startMatchButton {
    width: 100%;
    justify-content: center;
    text-align: center;
}

#startMatchButton {
    font-size: 16px;
    padding: 18px 22px;
    border-radius: 18px;
    background: linear-gradient(135deg, #2563eb 0%, #38bdf8 40%, #14b8a6 100%);
    box-shadow: 0 24px 42px rgba(37, 99, 235, 0.34);
}

#startMatchButton::before {
    content: "▶";
    font-size: 13px;
}

.inventory-panel {
    margin: 16px 0 20px;
    padding: 16px 18px;
    border: 1px solid rgba(96, 165, 250, 0.14);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(12, 22, 43, 0.94) 0%, rgba(8, 17, 34, 0.9) 100%);
    box-shadow: var(--shadow-md);
}

.inventory-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #7dd3fc;
    margin-bottom: 12px;
}

.item-card {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(96, 165, 250, 0.12);
    background: rgba(7, 16, 31, 0.88);
}

.item-card strong {
    display: block;
    color: #f4f8ff;
    margin-bottom: 6px;
}

.item-card span {
    display: block;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.item-card button {
    width: 100%;
}

.item-card button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.danger-mark {
    background: rgba(80, 18, 22, 0.92) !important;
    border-color: rgba(239, 68, 68, 0.9) !important;
    color: #ffd8d8 !important;
    opacity: 0.92;
}

.life-button {
    background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
}

.summary-item {
    padding: 16px;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(13, 25, 49, 0.98) 0%, rgba(9, 18, 36, 0.94) 100%);
    border: 1px solid rgba(96, 165, 250, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.summary-label {
    display: block;
    font-size: 11px;
    color: #89a2c8;
    margin-bottom: 8px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 800;
}

.summary-value {
    font-size: 24px;
    font-weight: 900;
    color: #f8fbff;
    letter-spacing: -0.04em;
}

#finalScore {
    font-size: clamp(40px, 6vw, 62px);
    color: #ffd782;
    text-shadow: 0 0 28px rgba(245, 158, 11, 0.28);
}

.lobby-identity {
    padding: 24px 24px 22px;
    border-radius: 26px;
    border: 1px solid rgba(96, 165, 250, 0.18);
    background:
        linear-gradient(135deg, rgba(15, 24, 47, 0.98) 0%, rgba(12, 29, 58, 0.94) 45%, rgba(8, 17, 34, 0.94) 100%);
    box-shadow: var(--shadow-lg);
}

.lobby-player-name {
    font-size: clamp(34px, 5vw, 56px);
    font-weight: 900;
    color: #f8fbff;
    letter-spacing: -0.06em;
}

.lobby-player-meta {
    margin-top: 10px;
    color: var(--text-secondary);
    line-height: 1.75;
    font-size: 15px;
}

.lobby-room-rank {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(7, 16, 31, 0.86);
    border: 1px solid rgba(20, 184, 166, 0.24);
    color: #8bf3e8;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.lobby-status-strip {
    margin-top: 18px;
    align-items: stretch;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.14);
    background: rgba(7, 16, 31, 0.82);
    color: #dce8fb;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
    min-height: 48px;
}

.title-chip {
    flex-basis: 100%;
    justify-content: flex-start;
    width: 100%;
    padding: 18px 20px;
    border-radius: 20px;
    font-size: 19px;
    font-weight: 900;
}

.title-chip-contested {
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.28) 0%, rgba(17, 30, 58, 0.96) 56%, rgba(10, 18, 36, 0.98) 100%);
    border-color: rgba(251, 191, 36, 0.4);
    color: #ffe4a3;
    box-shadow: 0 18px 30px rgba(245, 158, 11, 0.16);
}

.title-chip-muted {
    background:
        linear-gradient(135deg, rgba(128, 92, 24, 0.22) 0%, rgba(17, 30, 58, 0.94) 58%, rgba(10, 18, 36, 0.98) 100%);
    border-color: rgba(146, 112, 39, 0.26);
    color: #bca36a;
    box-shadow: 0 14px 24px rgba(79, 58, 15, 0.14);
}

.title-chip-training {
    background:
        linear-gradient(135deg, rgba(82, 68, 35, 0.14) 0%, rgba(15, 24, 43, 0.94) 60%, rgba(10, 18, 36, 0.98) 100%);
    border-color: rgba(103, 86, 49, 0.16);
    color: #8e7b54;
    box-shadow: none;
}

.medal-chip {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18) 0%, rgba(7, 16, 31, 0.9) 100%);
    color: #dcecff;
    padding: 12px 18px;
    font-size: 15px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.room-chip {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.18) 0%, rgba(7, 16, 31, 0.9) 100%);
    color: #d8fffa;
    padding: 12px 18px;
}

.neutral-chip {
    background: rgba(7, 16, 31, 0.74);
    color: #a8b8d0;
    font-size: 13px;
    font-weight: 700;
}

.status-chip.gold {
    border-color: rgba(245, 158, 11, 0.46);
    box-shadow: 0 12px 24px rgba(245, 158, 11, 0.1);
}

.status-chip.silver {
    border-color: rgba(148, 163, 184, 0.4);
}

.status-chip.bronze {
    border-color: rgba(234, 88, 12, 0.38);
}

.lobby-hero {
    margin-top: 22px;
    padding: 30px 24px;
    border-radius: 28px;
    text-align: center;
    background:
        linear-gradient(135deg, rgba(13, 25, 49, 0.98) 0%, rgba(12, 29, 58, 0.94) 40%, rgba(11, 39, 53, 0.92) 100%);
    border: 1px solid rgba(96, 165, 250, 0.18);
    box-shadow: 0 24px 40px rgba(2, 6, 23, 0.26);
}

.lobby-hero h2 {
    margin-bottom: 12px;
}

.lobby-hero .card-text {
    max-width: 480px;
    margin: 0 auto 20px;
}

.lobby-primary {
    width: min(100%, 360px);
    margin: 0 auto;
}

.lobby-actions .button-link,
.lobby-actions button {
    width: 100%;
    text-align: center;
    background: rgba(8, 15, 30, 0.84);
    border: 1px solid rgba(96, 165, 250, 0.16);
    color: #e3eeff;
    box-shadow: none;
}

.lobby-actions .button-secondary {
    background: rgba(10, 21, 41, 0.88);
}

.lobby-small {
    font-size: 16px;
    line-height: 1.45;
    word-break: break-word;
}

.reward-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(2, 6, 23, 0.82);
    z-index: 20;
}

.reward-box {
    width: min(100%, 500px);
    padding: 28px;
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(13, 25, 49, 0.98) 42%, rgba(8, 17, 34, 0.96) 100%);
    box-shadow: 0 34px 70px rgba(2, 6, 23, 0.48);
    text-align: center;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.title-unlock-box {
    background:
        linear-gradient(135deg, rgba(250, 204, 21, 0.12) 0%, rgba(13, 25, 49, 0.98) 42%, rgba(8, 17, 34, 0.96) 100%);
    border-color: rgba(250, 204, 21, 0.34);
}

.title-unlock-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 22px 0 24px;
}

.title-unlock-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.22) 0%, rgba(17, 30, 58, 0.96) 100%);
    border: 1px solid rgba(250, 204, 21, 0.28);
    color: #fff0a6;
    font-weight: 900;
    letter-spacing: 0.01em;
    box-shadow: 0 14px 24px rgba(250, 204, 21, 0.12);
}

.reward-badge {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(245, 158, 11, 0.26);
    color: #ffd782;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.reward-wheel {
    margin: 22px 0;
    padding: 20px;
    min-height: 100px;
    border-radius: 22px;
    border: 2px dashed rgba(245, 158, 11, 0.5);
    background: linear-gradient(135deg, rgba(13, 25, 49, 0.96) 0%, rgba(10, 18, 36, 0.94) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.reward-item-name {
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 900;
    color: #ffe4a3;
    letter-spacing: -0.04em;
    animation: popIn 0.25s ease;
}

.checkpoint-card {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.16) 0%, rgba(12, 29, 58, 0.94) 64%, rgba(8, 17, 34, 0.92) 100%);
    border: 1px solid rgba(74, 222, 128, 0.28);
    box-shadow: 0 18px 35px rgba(34, 197, 94, 0.16);
}

.checkpoint-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.16);
    color: #bbffd3;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.checkpoint-subtitle {
    font-size: 28px;
    margin: 14px 0 10px;
    color: #f2fff6;
}

.performance-banner {
    margin-top: 20px;
    padding: 20px;
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(13, 25, 49, 0.96) 58%, rgba(8, 17, 34, 0.94) 100%);
    border: 1px solid rgba(251, 191, 36, 0.28);
    box-shadow: 0 18px 32px rgba(245, 158, 11, 0.12);
}

.performance-title {
    display: block;
    font-size: 12px;
    color: #ffd782;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 800;
    margin-bottom: 8px;
}

.performance-rank {
    display: block;
    font-size: clamp(30px, 5vw, 44px);
    color: #fff1ca;
    font-weight: 900;
    margin-bottom: 8px;
    letter-spacing: -0.04em;
}

.feedback-list {
    margin-top: 18px;
}

.feedback-pill {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(11, 52, 39, 0.92);
    border: 1px solid rgba(74, 222, 128, 0.22);
    color: #d6ffe4;
    font-weight: 800;
    line-height: 1.45;
}

#optionsContainer {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

#questionScreen {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#questionText {
    font-size: 19px;
    line-height: 1.7;
    color: #dce8fb;
}

.screen-highlight {
    animation: screenPulse 0.55s ease;
}

.status-pop {
    animation: popIn 0.4s ease;
}

.body-success-flash {
    background:
        radial-gradient(circle at top, rgba(34, 197, 94, 0.16), transparent 30%),
        linear-gradient(180deg, #06110d 0%, #081b18 28%, #09182e 100%);
}

.body-error-flash {
    background:
        radial-gradient(circle at top, rgba(239, 68, 68, 0.16), transparent 30%),
        linear-gradient(180deg, #17090d 0%, #1c0c12 28%, #09182e 100%);
}

code {
    background: rgba(37, 99, 235, 0.16);
    border: 1px solid rgba(96, 165, 250, 0.16);
    color: #dce8fb;
    padding: 2px 6px;
    border-radius: 8px;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shakeWrong {
    0%, 100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-6px);
    }

    80% {
        transform: translateX(6px);
    }
}

@keyframes pulseCorrect {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes progressGlow {
    to {
        transform: translateX(100%);
    }
}

@keyframes screenPulse {
    0% {
        transform: scale(0.986);
        box-shadow: 0 0 0 rgba(37, 99, 235, 0);
    }

    55% {
        transform: scale(1.01);
        box-shadow: 0 20px 42px rgba(37, 99, 235, 0.14);
    }

    100% {
        transform: scale(1);
        box-shadow: none;
    }
}

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

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 900px) {
    .container {
        margin: 18px;
        padding: 22px;
    }

    .hero {
        grid-template-columns: 1fr;
    }

    .topbar {
        justify-content: flex-start;
    }

    .intro-strip {
        grid-template-columns: 1fr;
    }

    .player-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .container {
        margin: 12px;
        padding: 18px;
        border-radius: 24px;
    }

    .card,
    .lobby-identity,
    .lobby-hero,
    .player-panel,
    .setup-box,
    .performance-banner,
    .reward-box {
        border-radius: 22px;
        padding: 20px;
    }

    .button-group {
        width: 100%;
    }

    .button-group > * {
        flex: 1 1 100%;
    }

    .room-grid,
    .difficulty-grid,
    .howto-grid,
    .lobby-actions,
    .inventory-grid,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .player-meta {
        gap: 10px;
    }

    .player-meta span,
    .status-chip,
    .hero-chip,
    .rule-pill {
        width: 100%;
        justify-content: center;
    }

    .title-chip {
        font-size: 17px;
    }
}
