:root {
    --bg: #05070d;
    --bg-soft: #0a0e18;
    --panel: rgba(16, 21, 34, 0.76);
    --panel-strong: rgba(13, 17, 28, 0.94);
    --panel-border: rgba(255, 255, 255, 0.09);
    --text: #f5f7fb;
    --muted: #9ea7bb;
    --muted-2: #6f788d;
    --gold: #f6c85f;
    --gold-bright: #ffe39a;
    --gold-deep: #9d6a12;
    --cyan: #6ee7f2;
    --cyan-deep: #168f9d;
    --violet: #bd8cff;
    --violet-deep: #6e3bc2;
    --success: #62e6a5;
    --danger: #ff6e7a;
    --warning: #ffb85c;
    --shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
    --radius-sm: 12px;
    --radius: 20px;
    --radius-lg: 30px;
    --safe-bottom: max(18px, env(safe-area-inset-bottom));
    --font-display: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
    --font-ui: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--bg);
    color-scheme: dark;
    -webkit-text-size-adjust: 100%;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 50% -20%, rgba(72, 94, 162, 0.28), transparent 46%),
        linear-gradient(180deg, #080b14 0%, #04060b 100%);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

button,
input[type="range"] {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(110, 231, 242, 0.8);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.app {
    position: relative;
    min-height: 100vh;
    isolation: isolate;
}

.ambient {
    position: fixed;
    inset: 0;
    z-index: -3;
    overflow: hidden;
    pointer-events: none;
}

.ambient__orb {
    position: absolute;
    width: 54vw;
    height: 54vw;
    min-width: 520px;
    min-height: 520px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.12;
    animation: ambient-drift 16s ease-in-out infinite alternate;
}

.ambient__orb--one {
    top: -25vw;
    left: -12vw;
    background: var(--cyan);
}

.ambient__orb--two {
    right: -20vw;
    bottom: -27vw;
    background: var(--violet);
    animation-delay: -7s;
}

.ambient__grid {
    position: absolute;
    inset: 0;
    opacity: 0.12;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, black 0%, transparent 82%);
}

.ambient__noise {
    position: absolute;
    inset: 0;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}

.glass-panel {
    border: 1px solid var(--panel-border);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012)),
        var(--panel);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.055);
    backdrop-filter: blur(18px) saturate(125%);
    -webkit-backdrop-filter: blur(18px) saturate(125%);
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand__mark {
    position: relative;
    display: grid;
    width: 82px;
    height: 82px;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(246, 200, 95, 0.5);
    border-radius: 25px;
    background:
        linear-gradient(145deg, rgba(255, 227, 154, 0.2), rgba(157, 106, 18, 0.05)),
        rgba(8, 10, 17, 0.8);
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.35),
        inset 0 0 22px rgba(246, 200, 95, 0.08),
        0 0 38px rgba(246, 200, 95, 0.12);
    transform: rotate(45deg);
}

.brand__mark::before,
.brand__mark::after {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(246, 200, 95, 0.18);
    border-radius: 18px;
}

.brand__mark::after {
    inset: 15px;
    border-radius: 13px;
}

.brand__mark span {
    position: absolute;
    width: 45%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(246, 200, 95, 0.75), transparent);
}

.brand__mark span:nth-child(1) {
    transform: translateY(-19px);
}

.brand__mark span:nth-child(3) {
    transform: translateY(19px);
}

.brand__mark strong {
    position: relative;
    z-index: 1;
    color: var(--gold-bright);
    font-family: Georgia, serif;
    font-size: 32px;
    line-height: 1;
    text-shadow: 0 0 18px rgba(246, 200, 95, 0.55);
    transform: rotate(-45deg);
}

.brand__mark--small {
    width: 48px;
    height: 48px;
    border-radius: 15px;
}

.brand__mark--small::before {
    inset: 5px;
    border-radius: 11px;
}

.brand__mark--small::after,
.brand__mark--small span {
    display: none;
}

.brand__mark--small strong {
    font-size: 20px;
}

.brand__eyebrow,
.section-kicker {
    margin: 0 0 4px;
    color: var(--gold);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    line-height: 1.2;
    text-transform: uppercase;
}

.brand__title {
    margin: 0;
    color: #fff;
    font-family: var(--font-display);
    font-size: clamp(2.35rem, 7vw, 4.9rem);
    font-stretch: condensed;
    font-weight: 900;
    letter-spacing: 0.025em;
    line-height: 0.88;
    text-shadow: 0 8px 36px rgba(0, 0, 0, 0.5);
}

.brand--compact .brand__eyebrow {
    font-size: 0.58rem;
}

.brand--compact .brand__title {
    font-size: 1.25rem;
    line-height: 1;
}

.login-screen {
    display: grid;
    min-height: 100vh;
    padding: 32px 20px;
    place-items: center;
}

.login-card {
    position: relative;
    width: min(780px, 100%);
    padding: clamp(28px, 6vw, 58px);
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.8;
}

.login-card::after {
    content: "";
    position: absolute;
    top: -180px;
    right: -160px;
    width: 420px;
    height: 420px;
    border: 1px solid rgba(246, 200, 95, 0.08);
    border-radius: 50%;
    box-shadow:
        0 0 0 48px rgba(246, 200, 95, 0.025),
        0 0 0 96px rgba(246, 200, 95, 0.018);
    pointer-events: none;
}

.login-card__lead {
    max-width: 610px;
    margin: 30px 0 26px;
    color: #c8ceda;
    font-size: clamp(1rem, 2vw, 1.12rem);
}

.room-code {
    position: relative;
    z-index: 1;
    max-width: 420px;
    margin-bottom: 26px;
}

.room-code label {
    display: block;
    margin-bottom: 8px;
    color: #c9cfda;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.room-code__field {
    position: relative;
    display: flex;
    align-items: center;
}

.room-code__field > svg {
    position: absolute;
    left: 16px;
    z-index: 1;
    width: 21px;
    fill: none;
    stroke: var(--gold);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
    pointer-events: none;
}

.room-code input {
    width: 100%;
    height: 56px;
    padding: 0 54px 0 48px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 16px;
    outline: 0;
    background: rgba(0, 0, 0, 0.28);
    color: white;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.room-code input:focus {
    border-color: rgba(246, 200, 95, 0.65);
    background: rgba(0, 0, 0, 0.42);
    box-shadow: 0 0 0 4px rgba(246, 200, 95, 0.08);
}

.room-code p {
    margin: 7px 0 0;
    color: var(--muted-2);
    font-size: 0.73rem;
}

.icon-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.045);
    color: #dce1eb;
    cursor: pointer;
    transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.icon-button:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.085);
    color: white;
    transform: translateY(-1px);
}

.icon-button:active {
    transform: translateY(1px) scale(0.97);
}

.icon-button svg {
    width: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.icon-button--inside {
    position: absolute;
    right: 7px;
    border: 0;
    background: transparent;
}

.sound-off {
    display: none;
}

.is-muted .sound-on {
    display: none;
}

.is-muted .sound-off {
    display: block;
}

.profile-picker {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.profile-card {
    --profile: var(--cyan);
    --profile-rgb: 110, 231, 242;
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    min-height: 112px;
    padding: 18px;
    overflow: hidden;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(var(--profile-rgb), 0.26);
    border-radius: 21px;
    background:
        linear-gradient(135deg, rgba(var(--profile-rgb), 0.12), rgba(var(--profile-rgb), 0.025) 55%),
        rgba(5, 8, 14, 0.5);
    text-align: left;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.profile-card--yasmina {
    --profile: var(--violet);
    --profile-rgb: 189, 140, 255;
}

.profile-card:hover {
    border-color: rgba(var(--profile-rgb), 0.62);
    background:
        linear-gradient(135deg, rgba(var(--profile-rgb), 0.18), rgba(var(--profile-rgb), 0.035) 58%),
        rgba(5, 8, 14, 0.62);
    box-shadow: 0 15px 42px rgba(var(--profile-rgb), 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
}

.profile-card:active {
    transform: translateY(0) scale(0.985);
}

.profile-card:disabled {
    cursor: progress;
    opacity: 0.58;
    transform: none;
}

.profile-card__halo {
    position: absolute;
    top: -80px;
    right: -70px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: var(--profile);
    filter: blur(70px);
    opacity: 0.09;
}

.profile-card__avatar {
    position: relative;
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border: 1px solid rgba(var(--profile-rgb), 0.45);
    border-radius: 18px;
    background: rgba(var(--profile-rgb), 0.11);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 900;
    box-shadow: inset 0 0 20px rgba(var(--profile-rgb), 0.07);
}

.profile-card__copy {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.profile-card__copy strong {
    overflow: hidden;
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-card__label {
    margin-bottom: 3px;
    color: var(--profile);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.profile-card__arrow {
    position: relative;
    color: var(--profile);
    font-size: 1.45rem;
    transition: transform 180ms ease;
}

.profile-card:hover .profile-card__arrow {
    transform: translateX(4px);
}

.format-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin-top: 22px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.07);
}

.format-strip span {
    padding: 13px 8px;
    background: rgba(8, 11, 18, 0.8);
    color: var(--muted);
    font-size: 0.69rem;
    text-align: center;
    white-space: nowrap;
}

.format-strip strong {
    display: block;
    color: #fff;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.login-card__status {
    min-height: 24px;
    margin-top: 16px;
    color: var(--danger);
    font-size: 0.84rem;
    font-weight: 650;
    text-align: center;
}

.fan-note {
    margin: 5px 0 0;
    color: rgba(158, 167, 187, 0.58);
    font-size: 0.68rem;
    text-align: center;
}

.game-screen {
    min-height: 100vh;
    padding-bottom: 114px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    min-height: 74px;
    padding: 12px clamp(16px, 3vw, 42px);
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
    background: rgba(5, 7, 13, 0.79);
    backdrop-filter: blur(20px) saturate(135%);
    -webkit-backdrop-filter: blur(20px) saturate(135%);
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-pill {
    display: flex;
    height: 34px;
    padding: 0 12px;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(98, 230, 165, 0.18);
    border-radius: 999px;
    background: rgba(98, 230, 165, 0.055);
    color: #aab3c3;
    font-size: 0.69rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sync-pill__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 12px rgba(98, 230, 165, 0.75);
}

.sync-pill.is-syncing .sync-pill__dot {
    background: var(--warning);
    animation: pulse-dot 1s ease-in-out infinite;
}

.sync-pill.is-offline {
    border-color: rgba(255, 110, 122, 0.22);
    background: rgba(255, 110, 122, 0.06);
}

.sync-pill.is-offline .sync-pill__dot {
    background: var(--danger);
    box-shadow: 0 0 12px rgba(255, 110, 122, 0.65);
}

.scoreboard {
    display: grid;
    max-width: 1280px;
    margin: 24px auto 0;
    padding: 0 clamp(14px, 3vw, 34px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.score-card {
    --profile: var(--cyan);
    --profile-rgb: 110, 231, 242;
    position: relative;
    display: grid;
    min-height: 106px;
    padding: 17px 18px;
    overflow: hidden;
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    border: 1px solid rgba(var(--profile-rgb), 0.14);
    border-radius: 20px;
    background:
        linear-gradient(115deg, rgba(var(--profile-rgb), 0.11), transparent 48%),
        rgba(12, 16, 26, 0.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 45px rgba(0, 0, 0, 0.18);
}

.score-card--yasmina {
    --profile: var(--violet);
    --profile-rgb: 189, 140, 255;
}

.score-card.is-viewer {
    border-color: rgba(var(--profile-rgb), 0.46);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 18px 45px rgba(0, 0, 0, 0.2),
        0 0 35px rgba(var(--profile-rgb), 0.07);
}

.score-card.is-leading::after {
    content: "LÍDER";
    position: absolute;
    top: 0;
    right: 0;
    padding: 5px 10px 5px 12px;
    border-radius: 0 19px 0 12px;
    background: rgba(246, 200, 95, 0.12);
    color: var(--gold-bright);
    font-size: 0.55rem;
    font-weight: 900;
    letter-spacing: 0.13em;
}

.score-card__avatar {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid rgba(var(--profile-rgb), 0.36);
    border-radius: 15px;
    background: rgba(var(--profile-rgb), 0.1);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 900;
}

.score-card__identity {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.score-card__identity span {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 750;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted-2);
}

.online-dot.is-online {
    background: var(--success);
    box-shadow: 0 0 10px rgba(98, 230, 165, 0.55);
}

.score-card__identity strong {
    overflow: hidden;
    margin-top: 2px;
    font-family: var(--font-display);
    font-size: clamp(1.42rem, 3vw, 1.95rem);
    font-weight: 900;
    letter-spacing: 0.01em;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.score-card__money {
    min-width: 0;
    text-align: right;
}

.score-card__money strong {
    display: block;
    color: #fff;
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 3.3vw, 2.05rem);
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1;
}

.score-card__money span {
    display: inline-flex;
    margin-top: 7px;
    padding: 4px 8px;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 700;
}

.score-card__money span.is-locked {
    background: rgba(98, 230, 165, 0.09);
    color: var(--success);
}

.game-main {
    display: grid;
    width: min(1280px, 100%);
    margin: 14px auto 0;
    padding: 0 clamp(14px, 3vw, 34px) 30px;
    gap: 16px;
}

.round-panel {
    display: grid;
    padding: clamp(18px, 3vw, 26px);
    border-radius: 22px;
    gap: 17px;
}

.round-panel__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.round-panel h1,
.stage-heading h2,
.duel-history h2,
.modal h2 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 900;
    letter-spacing: 0.01em;
}

.round-panel h1 {
    font-size: clamp(2rem, 5vw, 3.3rem);
    line-height: 0.95;
}

.round-panel h1 small {
    color: var(--muted-2);
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.timer {
    position: relative;
    width: 98px;
    height: 98px;
    flex: 0 0 auto;
}

.timer__ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer__track,
.timer__progress {
    fill: none;
    stroke-width: 7;
}

.timer__track {
    stroke: rgba(255, 255, 255, 0.07);
}

.timer__progress {
    stroke: var(--gold);
    stroke-linecap: round;
    stroke-dasharray: 314.159;
    stroke-dashoffset: 0;
    filter: drop-shadow(0 0 5px rgba(246, 200, 95, 0.55));
    transition: stroke-dashoffset 300ms linear, stroke 200ms ease;
}

.timer.is-urgent .timer__progress {
    stroke: var(--danger);
    filter: drop-shadow(0 0 6px rgba(255, 110, 122, 0.7));
}

.timer.is-urgent {
    animation: timer-breathe 700ms ease-in-out infinite alternate;
}

.timer__value {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
}

.timer__value strong {
    font-family: var(--font-display);
    font-size: 2.08rem;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    line-height: 0.9;
}

.timer__value span {
    margin-top: 5px;
    color: var(--muted-2);
    font-size: 0.52rem;
    font-weight: 850;
    letter-spacing: 0.18em;
}

.round-progress {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 7px;
}

.round-step {
    position: relative;
    min-width: 0;
}

.round-step::before {
    content: "";
    position: absolute;
    top: 14px;
    left: calc(50% + 14px);
    width: calc(100% - 21px);
    height: 2px;
    background: rgba(255, 255, 255, 0.07);
}

.round-step:last-child::before {
    display: none;
}

.round-step__dot {
    position: relative;
    z-index: 1;
    display: grid;
    width: 29px;
    height: 29px;
    margin: 0 auto;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    background: #101522;
    color: var(--muted-2);
    font-size: 0.67rem;
    font-weight: 850;
    transition: all 200ms ease;
}

.round-step__label {
    display: block;
    margin-top: 7px;
    overflow: hidden;
    color: var(--muted-2);
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-align: center;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.round-step.is-complete .round-step__dot {
    border-color: rgba(98, 230, 165, 0.32);
    background: rgba(98, 230, 165, 0.11);
    color: var(--success);
}

.round-step.is-complete::before {
    background: rgba(98, 230, 165, 0.22);
}

.round-step.is-current .round-step__dot {
    border-color: rgba(246, 200, 95, 0.65);
    background: rgba(246, 200, 95, 0.14);
    color: var(--gold-bright);
    box-shadow: 0 0 0 5px rgba(246, 200, 95, 0.06), 0 0 22px rgba(246, 200, 95, 0.15);
    transform: scale(1.08);
}

.round-step.is-current .round-step__label {
    color: var(--gold);
}

.timer-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.mini-button,
.text-button {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.mini-button {
    display: inline-flex;
    min-height: 38px;
    padding: 0 13px;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(246, 200, 95, 0.2);
    border-radius: 11px;
    background: rgba(246, 200, 95, 0.07);
    color: var(--gold-bright);
    font-size: 0.73rem;
    font-weight: 750;
    transition: background 150ms ease, transform 150ms ease, opacity 150ms ease;
}

.mini-button:hover:not(:disabled) {
    background: rgba(246, 200, 95, 0.12);
    transform: translateY(-1px);
}

.mini-button--ghost {
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted);
}

.mini-button:disabled {
    cursor: not-allowed;
    opacity: 0.38;
}

.mini-button svg {
    width: 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.stage-panel {
    position: relative;
    padding: clamp(19px, 3.5vw, 34px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 24px;
    background:
        radial-gradient(circle at 50% 20%, rgba(246, 200, 95, 0.055), transparent 38%),
        linear-gradient(180deg, rgba(18, 23, 37, 0.92), rgba(8, 11, 19, 0.96));
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.stage-panel::after {
    content: "";
    position: absolute;
    left: 3%;
    right: 3%;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(246, 200, 95, 0.4), transparent);
}

.stage-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.stage-heading h2,
.duel-history h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.35rem);
    line-height: 1;
}

.allocation-total {
    min-width: 190px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.21);
    text-align: right;
}

.allocation-total > span {
    display: block;
    color: var(--muted-2);
    font-size: 0.54rem;
    font-weight: 850;
    letter-spacing: 0.14em;
}

.allocation-total strong {
    display: block;
    margin: 1px 0;
    color: var(--gold-bright);
    font-family: var(--font-display);
    font-size: 1.36rem;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    line-height: 1.05;
}

.allocation-total small {
    color: var(--muted-2);
    font-size: 0.65rem;
}

.rule-banner {
    display: flex;
    min-height: 39px;
    margin-top: 17px;
    padding: 8px 12px;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(246, 200, 95, 0.12);
    border-radius: 11px;
    background: rgba(246, 200, 95, 0.045);
    color: #c9c1a9;
    font-size: 0.72rem;
}

.rule-banner.is-valid {
    border-color: rgba(98, 230, 165, 0.12);
    background: rgba(98, 230, 165, 0.045);
    color: #a7cbb9;
}

.rule-banner svg {
    width: 17px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.trap-grid {
    --columns: 4;
    display: grid;
    margin-top: 22px;
    grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
    gap: clamp(10px, 1.7vw, 18px);
}

.trap {
    --trap-accent: var(--cyan);
    --trap-rgb: 110, 231, 242;
    position: relative;
    min-width: 0;
    transition: opacity 200ms ease, transform 200ms ease;
}

.trap:nth-child(2) {
    --trap-accent: var(--violet);
    --trap-rgb: 189, 140, 255;
}

.trap:nth-child(3) {
    --trap-accent: var(--gold);
    --trap-rgb: 246, 200, 95;
}

.trap:nth-child(4) {
    --trap-accent: #ff8db6;
    --trap-rgb: 255, 141, 182;
}

.trap__viewport {
    position: relative;
    height: clamp(172px, 20vw, 238px);
    perspective: 900px;
}

.trap__shaft {
    position: absolute;
    inset: 12px 7px 3px;
    overflow: hidden;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.9)),
        repeating-linear-gradient(90deg, #05070b 0 7px, #090d14 7px 14px);
    box-shadow: inset 0 15px 35px rgba(0, 0, 0, 0.9);
}

.trap__shaft::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 15%, rgba(var(--trap-rgb), 0.1), transparent 55%);
}

.trap__door {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    padding: 15px;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    border: 1px solid rgba(var(--trap-rgb), 0.26);
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(var(--trap-rgb), 0.16), rgba(var(--trap-rgb), 0.025) 48%),
        linear-gradient(180deg, #161c2a, #0c111b);
    box-shadow:
        0 15px 38px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.075),
        inset 0 -20px 40px rgba(0, 0, 0, 0.19);
    transform-origin: bottom center;
    transform-style: preserve-3d;
    transition: transform 850ms cubic-bezier(0.52, 0.03, 0.2, 1), filter 300ms ease, opacity 300ms ease;
}

.trap__door::before {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 12px;
    pointer-events: none;
}

.trap__door::after {
    content: "";
    position: absolute;
    top: 0;
    left: -70%;
    width: 45%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transform: skewX(-18deg);
    transition: left 650ms ease;
    pointer-events: none;
}

.trap:hover .trap__door::after {
    left: 135%;
}

.trap__label-row {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.trap__letter {
    display: grid;
    width: 39px;
    height: 39px;
    place-items: center;
    border: 1px solid rgba(var(--trap-rgb), 0.42);
    border-radius: 12px;
    background: rgba(var(--trap-rgb), 0.1);
    color: var(--trap-accent);
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 900;
    box-shadow: inset 0 0 14px rgba(var(--trap-rgb), 0.06);
}

.trap__position {
    color: var(--muted-2);
    font-size: 0.56rem;
    font-weight: 850;
    letter-spacing: 0.12em;
}

.trap__money {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 76px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.money-stack {
    position: relative;
    width: 82px;
    height: 42px;
    margin-bottom: 8px;
    transition: transform 180ms ease, opacity 180ms ease;
}

.money-stack__bundle {
    position: absolute;
    left: 50%;
    width: 68px;
    height: 20px;
    border: 1px solid rgba(24, 83, 52, 0.72);
    border-radius: 3px;
    background:
        linear-gradient(90deg, transparent 23%, rgba(255, 255, 255, 0.32) 24% 28%, transparent 29% 71%, rgba(255, 255, 255, 0.32) 72% 76%, transparent 77%),
        linear-gradient(180deg, #9ae3a9, #4d9e64);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.26);
    transform: translateX(-50%);
}

.money-stack__bundle::after {
    content: "€";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(22, 86, 48, 0.85);
    font-family: Georgia, serif;
    font-size: 10px;
    font-weight: 700;
}

.money-stack__bundle:nth-child(1) { bottom: 0; transform: translateX(-50%) rotate(-1.5deg); }
.money-stack__bundle:nth-child(2) { bottom: 7px; transform: translateX(-50%) rotate(1.2deg); }
.money-stack__bundle:nth-child(3) { bottom: 14px; transform: translateX(-50%) rotate(-0.7deg); }
.money-stack__bundle:nth-child(4) { bottom: 21px; transform: translateX(-50%) rotate(0.7deg); }

.trap.is-empty .money-stack {
    opacity: 0.16;
    transform: scale(0.78);
}

.trap__amount {
    color: white;
    font-family: var(--font-display);
    font-size: clamp(1.18rem, 2.1vw, 1.62rem);
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1;
    text-align: center;
}

.trap__bundles {
    margin-top: 5px;
    color: var(--muted-2);
    font-size: 0.59rem;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-align: center;
    text-transform: uppercase;
}

.trap__controls {
    position: relative;
    z-index: 3;
    margin-top: 11px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.22);
}

.trap__range-row {
    display: grid;
    grid-template-columns: 31px minmax(0, 1fr) 31px;
    align-items: center;
    gap: 8px;
}

.range-stepper {
    display: grid;
    width: 31px;
    height: 31px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(var(--trap-rgb), 0.18);
    border-radius: 9px;
    background: rgba(var(--trap-rgb), 0.06);
    color: var(--trap-accent);
    font-size: 1rem;
    font-weight: 850;
    cursor: pointer;
    transition: background 150ms ease, transform 150ms ease, opacity 150ms ease;
}

.range-stepper:hover:not(:disabled) {
    background: rgba(var(--trap-rgb), 0.12);
    transform: translateY(-1px);
}

.range-stepper:disabled {
    cursor: not-allowed;
    opacity: 0.28;
}

.trap__slider {
    --fill: 0%;
    width: 100%;
    height: 24px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
}

.trap__slider:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.trap__slider::-webkit-slider-runnable-track {
    height: 7px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--trap-accent) 0 var(--fill), rgba(255, 255, 255, 0.085) var(--fill) 100%);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55), 0 0 10px rgba(var(--trap-rgb), 0.08);
}

.trap__slider::-moz-range-track {
    height: 7px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--trap-accent) 0 var(--fill), rgba(255, 255, 255, 0.085) var(--fill) 100%);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55);
}

.trap__slider::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
    margin-top: -7.5px;
    appearance: none;
    -webkit-appearance: none;
    border: 4px solid #0c111a;
    border-radius: 50%;
    background: var(--trap-accent);
    box-shadow: 0 0 0 1px rgba(var(--trap-rgb), 0.65), 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 13px rgba(var(--trap-rgb), 0.25);
}

.trap__slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border: 4px solid #0c111a;
    border-radius: 50%;
    background: var(--trap-accent);
    box-shadow: 0 0 0 1px rgba(var(--trap-rgb), 0.65), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.trap__quick-row {
    display: flex;
    margin-top: 9px;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
}

.trap__quick-row span {
    color: var(--muted-2);
    font-size: 0.57rem;
    font-weight: 750;
}

.all-in-button {
    padding: 5px 8px;
    border: 0;
    border-radius: 8px;
    background: rgba(var(--trap-rgb), 0.08);
    color: var(--trap-accent);
    font-size: 0.58rem;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
}

.all-in-button:hover:not(:disabled) {
    background: rgba(var(--trap-rgb), 0.15);
}

.all-in-button:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

.trap.is-locked .trap__door,
.trap-grid.is-locked .trap__door {
    filter: saturate(0.8);
}

.trap.is-correct .trap__door {
    border-color: rgba(98, 230, 165, 0.75);
    background:
        linear-gradient(145deg, rgba(98, 230, 165, 0.22), rgba(98, 230, 165, 0.035) 48%),
        linear-gradient(180deg, #152921, #0b1713);
    box-shadow:
        0 0 0 2px rgba(98, 230, 165, 0.12),
        0 16px 42px rgba(0, 0, 0, 0.38),
        0 0 38px rgba(98, 230, 165, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.09);
    animation: correct-glow 1.5s ease-in-out infinite alternate;
}

.trap.is-wrong .trap__door {
    transform: rotateX(-87deg) translateY(3px);
    filter: brightness(0.55) saturate(0.5);
    opacity: 0.78;
}

.trap.is-wrong .money-stack {
    animation: money-drop 850ms 120ms cubic-bezier(0.65, 0, 1, 0.4) both;
}

.trap.is-wrong .trap__controls {
    opacity: 0.35;
}

.trap.is-wrong::after {
    content: "CAE";
    position: absolute;
    top: 38%;
    left: 50%;
    z-index: 4;
    color: var(--danger);
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    opacity: 0;
    transform: translate(-50%, -50%);
    animation: drop-label 650ms 220ms ease forwards;
}

.trap.is-correct::after {
    content: "A SALVO";
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 5;
    padding: 4px 7px;
    border-radius: 8px;
    background: rgba(98, 230, 165, 0.14);
    color: var(--success);
    font-size: 0.52rem;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.waiting-panel {
    display: flex;
    min-height: 72px;
    margin-top: 18px;
    padding: 14px 16px;
    align-items: center;
    gap: 14px;
    border: 1px solid rgba(110, 231, 242, 0.12);
    border-radius: 15px;
    background: rgba(110, 231, 242, 0.045);
}

.waiting-panel__pulse {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    border: 2px solid rgba(110, 231, 242, 0.35);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(110, 231, 242, 0.28);
    animation: waiting-pulse 1.55s ease-out infinite;
}

.waiting-panel div:last-child {
    display: flex;
    flex-direction: column;
}

.waiting-panel strong {
    font-size: 0.88rem;
}

.waiting-panel span {
    color: var(--muted);
    font-size: 0.72rem;
}

.duel-history {
    padding: clamp(18px, 3vw, 26px);
    border-radius: 22px;
}

.duel-history__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.text-button {
    padding: 7px 0;
    color: var(--muted);
    font-size: 0.71rem;
    font-weight: 750;
}

.text-button:hover {
    color: #fff;
}

.duel-history__body {
    margin-top: 19px;
}

.history-empty {
    display: grid;
    min-height: 90px;
    padding: 18px;
    place-items: center;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: var(--muted-2);
    font-size: 0.78rem;
    text-align: center;
}

.history-chart {
    display: grid;
    gap: 13px;
}

.history-row {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) 100px;
    align-items: center;
    gap: 12px;
}

.history-row__name {
    color: #dce1ea;
    font-size: 0.72rem;
    font-weight: 750;
}

.history-row__track {
    position: relative;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.055);
}

.history-row__fill {
    --profile: var(--cyan);
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, color-mix(in srgb, var(--profile) 62%, #1a2030), var(--profile));
    box-shadow: 0 0 15px color-mix(in srgb, var(--profile) 25%, transparent);
    transition: width 650ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.history-row__fill--yasmina {
    --profile: var(--violet);
}

.history-row__value {
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    text-align: right;
}

.history-rounds {
    display: grid;
    margin-top: 18px;
    overflow: hidden;
    grid-template-columns: repeat(8, minmax(52px, 1fr));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 13px;
}

.history-round {
    min-width: 0;
    padding: 9px 6px;
    border-right: 1px solid rgba(255, 255, 255, 0.055);
    background: rgba(0, 0, 0, 0.16);
    text-align: center;
}

.history-round:last-child {
    border-right: 0;
}

.history-round span {
    display: block;
    color: var(--muted-2);
    font-size: 0.49rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.history-round strong {
    display: block;
    margin-top: 3px;
    color: #d9dee8;
    font-family: var(--font-display);
    font-size: 0.83rem;
    font-weight: 900;
}

.history-round.is-pending strong {
    color: rgba(158, 167, 187, 0.35);
}

.action-dock {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: flex;
    min-height: 92px;
    padding: 14px max(18px, calc((100vw - 1212px) / 2)) var(--safe-bottom);
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(6, 8, 14, 0.89);
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(22px) saturate(135%);
    -webkit-backdrop-filter: blur(22px) saturate(135%);
}

.action-dock__status {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.action-dock__eyebrow {
    color: var(--muted-2);
    font-size: 0.57rem;
    font-weight: 850;
    letter-spacing: 0.16em;
}

.action-dock__status strong {
    overflow: hidden;
    margin-top: 2px;
    font-family: var(--font-display);
    font-size: clamp(1rem, 2vw, 1.28rem);
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.primary-button,
.secondary-button,
.danger-button {
    position: relative;
    display: inline-flex;
    min-height: 52px;
    padding: 0 22px;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 850;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

.primary-button {
    min-width: min(310px, 48vw);
    border: 1px solid rgba(255, 227, 154, 0.5);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 38%),
        linear-gradient(135deg, #d99d29, #f7cd68 55%, #b97711);
    box-shadow: 0 10px 28px rgba(175, 111, 15, 0.27), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    color: #241501;
    text-shadow: 0 1px rgba(255, 255, 255, 0.25);
}

.primary-button__shine {
    position: absolute;
    top: 0;
    left: -70%;
    width: 44%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
    transform: skewX(-20deg);
    animation: button-shine 4.5s ease-in-out infinite;
}

.primary-button:hover:not(:disabled) {
    filter: brightness(1.07);
    box-shadow: 0 13px 34px rgba(175, 111, 15, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.primary-button:active:not(:disabled),
.secondary-button:active:not(:disabled),
.danger-button:active:not(:disabled) {
    transform: translateY(1px) scale(0.985);
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
    cursor: not-allowed;
    filter: grayscale(0.5);
    opacity: 0.42;
}

.primary-button svg {
    position: relative;
    z-index: 1;
    width: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.primary-button span:last-child {
    position: relative;
    z-index: 1;
}

.primary-button--wide {
    width: 100%;
    min-width: 0;
    margin-top: 22px;
}

.secondary-button {
    border: 1px solid rgba(255, 255, 255, 0.11);
    background: rgba(255, 255, 255, 0.055);
    color: #dce1ea;
}

.secondary-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.095);
    transform: translateY(-1px);
}

.danger-button {
    border: 1px solid rgba(255, 110, 122, 0.35);
    background: rgba(255, 110, 122, 0.12);
    color: #ffabb2;
}

.danger-button:hover:not(:disabled) {
    background: rgba(255, 110, 122, 0.19);
    transform: translateY(-1px);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fade-in 180ms ease both;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 90;
    width: min(610px, calc(100vw - 28px));
    max-height: min(86vh, 760px);
    padding: clamp(24px, 4vw, 36px);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    background:
        radial-gradient(circle at 50% 0%, rgba(246, 200, 95, 0.07), transparent 38%),
        rgba(12, 16, 26, 0.98);
    box-shadow: 0 35px 110px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transform: translate(-50%, -50%);
    animation: modal-in 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    width: 36px;
    height: 36px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted);
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

.modal__close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.modal__icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin-bottom: 17px;
    place-items: center;
    border-radius: 17px;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 900;
}

.modal__icon--gold {
    border: 1px solid rgba(246, 200, 95, 0.35);
    background: rgba(246, 200, 95, 0.1);
    color: var(--gold-bright);
}

.modal__icon--pulse {
    border: 1px solid rgba(110, 231, 242, 0.35);
    background: rgba(110, 231, 242, 0.1);
    color: var(--cyan);
    animation: tv-pulse 1.4s ease-in-out infinite alternate;
}

.modal__icon--warning {
    border: 1px solid rgba(255, 184, 92, 0.35);
    background: rgba(255, 184, 92, 0.1);
    color: var(--warning);
}

.modal h2 {
    font-size: clamp(1.8rem, 5vw, 2.7rem);
    line-height: 1.03;
}

.modal__lead {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 0.89rem;
}

.modal__fineprint {
    margin: 16px 0 0;
    color: var(--muted-2);
    font-size: 0.68rem;
    text-align: center;
}

.rules-list {
    display: grid;
    margin: 24px 0 0;
    padding: 0;
    gap: 12px;
    list-style: none;
}

.rules-list li {
    display: grid;
    padding: 13px;
    align-items: start;
    grid-template-columns: 40px 1fr;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
}

.rules-list li > span {
    color: var(--gold);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 900;
}

.rules-list strong {
    display: block;
    font-size: 0.86rem;
}

.rules-list p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.74rem;
}

.answer-picker {
    display: grid;
    margin-top: 23px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.answer-choice {
    --choice: var(--cyan);
    --choice-rgb: 110, 231, 242;
    min-height: 104px;
    padding: 10px;
    border: 1px solid rgba(var(--choice-rgb), 0.25);
    border-radius: 17px;
    background:
        linear-gradient(145deg, rgba(var(--choice-rgb), 0.12), rgba(var(--choice-rgb), 0.025)),
        rgba(0, 0, 0, 0.18);
    color: var(--choice);
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.answer-choice:nth-child(2) {
    --choice: var(--violet);
    --choice-rgb: 189, 140, 255;
}

.answer-choice:nth-child(3) {
    --choice: var(--gold);
    --choice-rgb: 246, 200, 95;
}

.answer-choice:nth-child(4) {
    --choice: #ff8db6;
    --choice-rgb: 255, 141, 182;
}

.answer-choice:hover {
    border-color: rgba(var(--choice-rgb), 0.62);
    background:
        linear-gradient(145deg, rgba(var(--choice-rgb), 0.19), rgba(var(--choice-rgb), 0.035)),
        rgba(0, 0, 0, 0.25);
    box-shadow: 0 14px 35px rgba(var(--choice-rgb), 0.1);
    transform: translateY(-3px);
}

.answer-choice small {
    display: block;
    margin-top: 4px;
    color: var(--muted-2);
    font-family: var(--font-ui);
    font-size: 0.55rem;
    font-weight: 750;
    letter-spacing: 0.08em;
}

.modal--result {
    width: min(720px, calc(100vw - 28px));
}

.result-hero {
    text-align: center;
}

.result-hero__correct {
    display: grid;
    width: 72px;
    height: 72px;
    margin: 0 auto 15px;
    place-items: center;
    border: 1px solid rgba(98, 230, 165, 0.55);
    border-radius: 22px;
    background: rgba(98, 230, 165, 0.12);
    color: var(--success);
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    box-shadow: 0 0 35px rgba(98, 230, 165, 0.12);
}

.result-hero p:last-child {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 0.83rem;
}

.result-grid {
    display: grid;
    margin-top: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.result-card {
    --profile: var(--cyan);
    --profile-rgb: 110, 231, 242;
    padding: 17px;
    border: 1px solid rgba(var(--profile-rgb), 0.18);
    border-radius: 17px;
    background: rgba(var(--profile-rgb), 0.045);
}

.result-card--yasmina {
    --profile: var(--violet);
    --profile-rgb: 189, 140, 255;
}

.result-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.result-card__head strong {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 900;
}

.result-card__head span {
    color: var(--profile);
    font-size: 0.6rem;
    font-weight: 850;
    letter-spacing: 0.08em;
}

.result-card__saved {
    margin-top: 13px;
}

.result-card__saved span,
.result-card__lost span {
    display: block;
    color: var(--muted-2);
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.11em;
}

.result-card__saved strong {
    display: block;
    margin-top: 1px;
    color: var(--success);
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    line-height: 1;
}

.result-card__lost {
    margin-top: 11px;
    padding-top: 11px;
    border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.result-card__lost strong {
    color: #ff9ba4;
    font-size: 0.79rem;
    font-variant-numeric: tabular-nums;
}

.modal__actions {
    display: grid;
    margin-top: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.modal__actions .primary-button {
    min-width: 0;
}

.menu-profile {
    display: flex;
    min-height: 72px;
    margin-top: 20px;
    padding: 13px;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.025);
}

.menu-profile__avatar {
    display: grid;
    width: 45px;
    height: 45px;
    place-items: center;
    border-radius: 13px;
    background: rgba(110, 231, 242, 0.1);
    color: var(--cyan);
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 900;
}

.menu-profile__copy {
    display: flex;
    flex-direction: column;
}

.menu-profile__copy strong {
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-weight: 900;
}

.menu-profile__copy span {
    color: var(--muted);
    font-size: 0.68rem;
}

.menu-list {
    display: grid;
    margin-top: 15px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 15px;
}

.menu-list button {
    display: grid;
    min-height: 70px;
    padding: 11px 14px;
    align-items: center;
    grid-template-columns: 39px 1fr auto;
    gap: 11px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    background: rgba(255, 255, 255, 0.022);
    color: #dfe4ec;
    text-align: left;
    cursor: pointer;
}

.menu-list button:last-child {
    border-bottom: 0;
}

.menu-list button:hover {
    background: rgba(255, 255, 255, 0.055);
}

.menu-list__icon {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--gold);
    font-size: 1.05rem;
}

.menu-list button > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.menu-list strong {
    font-size: 0.8rem;
}

.menu-list small {
    margin-top: 2px;
    overflow: hidden;
    color: var(--muted-2);
    font-size: 0.64rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-list__danger strong,
.menu-list__danger > span:last-child {
    color: #ff9ca5;
}

.toast-region {
    position: fixed;
    right: 18px;
    bottom: calc(110px + env(safe-area-inset-bottom));
    z-index: 120;
    display: grid;
    width: min(360px, calc(100vw - 36px));
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: grid;
    min-height: 54px;
    padding: 11px 13px;
    align-items: center;
    grid-template-columns: auto 1fr;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 13px;
    background: rgba(14, 18, 29, 0.96);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    color: #dfe4ec;
    font-size: 0.72rem;
    font-weight: 650;
    animation: toast-in 220ms ease both;
    pointer-events: auto;
}

.toast::before {
    content: "✓";
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 9px;
    background: rgba(98, 230, 165, 0.1);
    color: var(--success);
    font-weight: 900;
}

.toast.is-error::before {
    content: "!";
    background: rgba(255, 110, 122, 0.1);
    color: var(--danger);
}

.toast.is-warning::before {
    content: "i";
    background: rgba(255, 184, 92, 0.1);
    color: var(--warning);
}

.toast.is-leaving {
    animation: toast-out 180ms ease both;
}

.confetti-layer {
    position: fixed;
    inset: 0;
    z-index: 115;
    overflow: hidden;
    pointer-events: none;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    width: 8px;
    height: 14px;
    border-radius: 2px;
    background: var(--gold);
    animation: confetti-fall var(--duration, 2.8s) cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.is-busy {
    cursor: progress !important;
}

@keyframes ambient-drift {
    to { transform: translate3d(5vw, 4vw, 0) scale(1.08); }
}

@keyframes pulse-dot {
    50% { opacity: 0.35; transform: scale(0.8); }
}

@keyframes timer-breathe {
    to { transform: scale(1.035); }
}

@keyframes correct-glow {
    to { box-shadow: 0 0 0 2px rgba(98, 230, 165, 0.14), 0 16px 42px rgba(0, 0, 0, 0.38), 0 0 52px rgba(98, 230, 165, 0.27), inset 0 1px 0 rgba(255, 255, 255, 0.09); }
}

@keyframes money-drop {
    0% { opacity: 1; transform: translateY(0) rotate(0); }
    100% { opacity: 0; transform: translateY(155px) rotate(11deg) scale(0.72); }
}

@keyframes drop-label {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
    40% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, 70px) scale(1.05); }
}

@keyframes waiting-pulse {
    0% { box-shadow: 0 0 0 0 rgba(110, 231, 242, 0.28); }
    100% { box-shadow: 0 0 0 13px rgba(110, 231, 242, 0); }
}

@keyframes button-shine {
    0%, 65% { left: -70%; }
    85%, 100% { left: 135%; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-in {
    from { opacity: 0; transform: translate(-50%, calc(-50% + 16px)) scale(0.98); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes tv-pulse {
    to { box-shadow: 0 0 28px rgba(110, 231, 242, 0.15); transform: scale(1.025); }
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateX(10px) scale(0.98); }
}

@keyframes confetti-fall {
    0% { opacity: 1; transform: translate3d(0, -20px, 0) rotate(0deg); }
    100% { opacity: 0; transform: translate3d(var(--drift, 30px), 105vh, 0) rotate(var(--spin, 720deg)); }
}

@media (max-width: 920px) {
    .trap-grid {
        --columns: 2 !important;
    }

    .trap__viewport {
        height: 218px;
    }

    .history-rounds {
        overflow-x: auto;
        grid-template-columns: repeat(8, 72px);
    }
}

@media (max-width: 680px) {
    .login-screen {
        padding: 14px;
    }

    .login-card {
        padding: 24px 17px 20px;
        border-radius: 23px;
    }

    .brand--hero {
        gap: 13px;
    }

    .brand__mark {
        width: 64px;
        height: 64px;
        border-radius: 20px;
    }

    .brand__mark strong {
        font-size: 27px;
    }

    .profile-picker {
        grid-template-columns: 1fr;
    }

    .profile-card {
        min-height: 92px;
        padding: 14px;
    }

    .profile-card__avatar {
        width: 50px;
        height: 50px;
    }

    .format-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topbar {
        min-height: 64px;
        padding: 9px 12px;
    }

    .brand--compact .brand__mark {
        width: 41px;
        height: 41px;
    }

    .brand--compact .brand__title {
        font-size: 1.05rem;
    }

    .brand--compact .brand__eyebrow {
        display: none;
    }

    .sync-pill {
        width: 34px;
        padding: 0;
        justify-content: center;
    }

    .sync-pill span:last-child {
        display: none;
    }

    .topbar .icon-button {
        width: 38px;
        height: 38px;
    }

    .scoreboard {
        margin-top: 14px;
        padding: 0 10px;
        gap: 8px;
    }

    .score-card {
        min-height: 118px;
        padding: 12px;
        grid-template-columns: auto 1fr;
        gap: 9px;
    }

    .score-card__avatar {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .score-card__identity strong {
        font-size: 1.2rem;
    }

    .score-card__money {
        grid-column: 1 / -1;
        text-align: left;
    }

    .score-card__money strong {
        font-size: 1.34rem;
    }

    .score-card__money span {
        margin-top: 5px;
    }

    .game-main {
        margin-top: 9px;
        padding: 0 10px 22px;
        gap: 10px;
    }

    .round-panel,
    .stage-panel,
    .duel-history {
        border-radius: 18px;
    }

    .round-panel__top {
        align-items: flex-start;
    }

    .timer {
        width: 79px;
        height: 79px;
    }

    .timer__value strong {
        font-size: 1.65rem;
    }

    .round-progress {
        gap: 3px;
    }

    .round-step__dot {
        width: 25px;
        height: 25px;
        font-size: 0.59rem;
    }

    .round-step::before {
        top: 12px;
        left: calc(50% + 12px);
        width: calc(100% - 16px);
    }

    .round-step__label {
        display: none;
    }

    .timer-controls {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mini-button {
        min-width: 0;
        padding: 0 8px;
        justify-content: center;
        font-size: 0.64rem;
    }

    .stage-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .allocation-total {
        width: 100%;
        min-width: 0;
        text-align: left;
    }

    .allocation-total strong,
    .allocation-total small {
        display: inline;
    }

    .allocation-total small {
        margin-left: 5px;
    }

    .trap-grid {
        margin-top: 14px;
        gap: 9px;
    }

    .trap__viewport {
        height: 190px;
    }

    .trap__door {
        padding: 11px;
        border-radius: 15px;
    }

    .trap__letter {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        font-size: 1rem;
    }

    .money-stack {
        width: 67px;
        transform: scale(0.88);
    }

    .trap__amount {
        font-size: 1.16rem;
    }

    .trap__controls {
        margin-top: 7px;
        padding: 9px 7px;
    }

    .trap__range-row {
        grid-template-columns: 27px minmax(0, 1fr) 27px;
        gap: 5px;
    }

    .range-stepper {
        width: 27px;
        height: 27px;
        border-radius: 8px;
    }

    .trap__quick-row {
        align-items: flex-end;
        flex-direction: column-reverse;
    }

    .trap__quick-row span {
        width: 100%;
        text-align: center;
    }

    .all-in-button {
        width: 100%;
        min-height: 27px;
    }

    .history-row {
        grid-template-columns: 62px minmax(0, 1fr) 82px;
        gap: 8px;
    }

    .action-dock {
        min-height: 104px;
        padding: 11px 12px var(--safe-bottom);
        gap: 10px;
    }

    .action-dock__status {
        max-width: 42%;
    }

    .action-dock__status strong {
        white-space: normal;
        line-height: 1.05;
    }

    .primary-button {
        min-width: 0;
        padding: 0 16px;
        flex: 1;
    }

    .modal {
        width: calc(100vw - 20px);
        padding: 25px 18px 20px;
        border-radius: 21px;
    }

    .answer-picker {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .answer-choice {
        min-height: 84px;
    }

    .result-grid,
    .modal__actions {
        grid-template-columns: 1fr;
    }

    .result-card {
        padding: 14px;
    }

    .toast-region {
        right: 10px;
        bottom: calc(118px + env(safe-area-inset-bottom));
        width: calc(100vw - 20px);
    }
}

@media (max-width: 390px) {
    .topbar__actions {
        gap: 5px;
    }

    .topbar .icon-button {
        width: 35px;
        height: 35px;
        border-radius: 11px;
    }

    .brand--compact {
        gap: 8px;
    }

    .brand--compact .brand__mark {
        width: 37px;
        height: 37px;
    }

    .brand--compact .brand__title {
        font-size: 0.92rem;
    }

    .trap__viewport {
        height: 178px;
    }

    .trap__position {
        display: none;
    }

    .money-stack {
        margin-bottom: 2px;
    }

    .trap__bundles {
        font-size: 0.53rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Evita que el contenido intrínseco ensanche el tablero en móviles estrechos. */
.game-main {
    grid-template-columns: minmax(0, 1fr);
}

.game-main > *,
.round-panel,
.stage-panel,
.duel-history,
.trap-grid,
.round-panel__top,
.timer-controls,
.duel-history__body {
    min-width: 0;
    max-width: 100%;
}
