:root {
    --ember: #f3a63b;
    --ember-hot: #ff6b2c;
    --gold: #f6d589;
    --bone: #e9ddc8;
    --ink: #fbf2e4;
    --muted: #b9a993;
    --night: #080402;
    --panel: #120a06;
    --line: rgba(246, 190, 100, .2);
    --danger: #f34e38;
    --safe: #8fc8a5;
}

.ember-game,
.ember-game * {
    box-sizing: border-box;
}

.ember-game button,
.ember-game a {
    font: inherit;
}

.ember-game button {
    -webkit-tap-highlight-color: transparent;
}

.ember-game [hidden] {
    display: none !important;
}

.ember-game {
    position: relative;
    min-height: calc(100svh - 82px);
    overflow: hidden;
    isolation: isolate;
    color: var(--ink);
    background:
        radial-gradient(circle at 72% -10%, rgba(182, 68, 22, .27), transparent 35%),
        radial-gradient(circle at 12% 28%, rgba(118, 45, 16, .16), transparent 28%),
        linear-gradient(145deg, #160b06, #060302 65%);
}

.ember-game::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    opacity: .11;
    background-image:
        linear-gradient(rgba(255, 193, 107, .14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 193, 107, .14) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(circle at 50% 20%, #000, transparent 78%);
}

.ember-game::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255, 98, 25, .03), transparent 20% 80%, rgba(255, 98, 25, .03));
}

.ember-sky {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.ember-sky i {
    position: absolute;
    bottom: -20px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #ffb449;
    box-shadow: 0 0 8px 2px rgba(255, 107, 44, .7);
    animation: emberRise 8s linear infinite;
}

.ember-sky i:nth-child(1) { left: 6%; animation-delay: -2s; }
.ember-sky i:nth-child(2) { left: 17%; animation-delay: -7s; animation-duration: 11s; }
.ember-sky i:nth-child(3) { left: 28%; animation-delay: -4s; }
.ember-sky i:nth-child(4) { left: 39%; animation-delay: -9s; animation-duration: 13s; }
.ember-sky i:nth-child(5) { left: 49%; animation-delay: -1s; }
.ember-sky i:nth-child(6) { left: 60%; animation-delay: -6s; animation-duration: 10s; }
.ember-sky i:nth-child(7) { left: 69%; animation-delay: -3s; }
.ember-sky i:nth-child(8) { left: 78%; animation-delay: -8s; animation-duration: 12s; }
.ember-sky i:nth-child(9) { left: 88%; animation-delay: -5s; }
.ember-sky i:nth-child(10) { left: 96%; animation-delay: -10s; animation-duration: 14s; }

.ember-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1536px;
    margin: 0 auto;
    padding: 27px 20px 52px;
}

.heist-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 19px;
}

.heist-kicker,
.modal-kicker {
    margin: 0 0 8px;
    color: var(--ember);
    font: 900 9px/1.2 Arial, sans-serif;
    letter-spacing: .22em;
    text-transform: uppercase;
}

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

.heist-kicker::before {
    content: "";
    width: 22px;
    height: 1px;
    background: currentColor;
    box-shadow: 0 0 12px currentColor;
}

.heist-kicker span {
    color: #f7d49b;
}

.heist-header h1 {
    margin: 0;
    color: #f9f1e5;
    font: 400 clamp(38px, 5vw, 72px)/.88 Georgia, serif;
    letter-spacing: -.06em;
    text-shadow: 0 7px 35px #000;
}

.heist-header h1 em {
    color: var(--gold);
    font-weight: 400;
}

.heist-subtitle {
    margin: 10px 0 0 31px;
    color: #a99680;
    font: 14px/1.45 Georgia, serif;
}

.header-actions {
    display: flex;
    flex: none;
    gap: 8px;
}

.round-action {
    display: grid;
    width: 46px;
    height: 46px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: #dfc9a9;
    background: rgba(19, 10, 5, .86);
    cursor: pointer;
    transition: .2s ease;
}

.round-action svg {
    width: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.round-action:hover,
.round-action:focus-visible {
    border-color: var(--ember);
    color: var(--gold);
    outline: 3px solid rgba(243, 166, 59, .2);
    outline-offset: 2px;
    transform: translateY(-2px);
}

.sound-action[aria-pressed="false"] {
    color: #7f7164;
}

.vault-shell {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(244, 171, 65, .32);
    border-radius: 22px;
    background: #0b0603;
    box-shadow: 0 38px 110px rgba(0, 0, 0, .78), 0 0 70px rgba(171, 66, 18, .08);
}

.vault-rail {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 170px 130px 160px;
    min-height: 72px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(90deg, #170d07, #0b0603 72%);
}

.wake-panel {
    min-width: 0;
    padding: 13px 20px 10px;
}

.rail-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
}

.rail-label span,
.rail-stat small {
    color: #8f7e6b;
    font: 900 8px Arial, sans-serif;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.rail-label strong {
    color: var(--gold);
    font: 800 11px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.wake-track {
    position: relative;
    height: 7px;
    overflow: hidden;
    border-radius: 20px;
    background: #2a1810;
    box-shadow: inset 0 1px 3px #000;
}

.wake-track > i {
    display: block;
    width: 8%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #d4a64d, #f27a2b 58%, #f04433);
    box-shadow: 0 0 12px rgba(255, 106, 37, .55);
    transition: width .5s cubic-bezier(.2, .8, .2, 1);
}

.wake-track .threshold {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 244, 220, .48);
}

.threshold-one { left: 50%; }
.threshold-two { left: 75%; }

.wake-panel > small {
    display: block;
    margin-top: 5px;
    color: #8b7866;
    font: italic 10px/1.2 Georgia, serif;
}

.rail-stat {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: 12px 17px;
    border-left: 1px solid var(--line);
}

.rail-stat strong {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: 4px;
    color: #f4ddad;
    font: 800 20px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.rail-stat strong em {
    color: #8b7965;
    font: 700 8px Arial, sans-serif;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.pulse-stat strong {
    color: var(--ember);
}

.pulse-stat.warning strong {
    color: #ff6743;
    text-shadow: 0 0 12px rgba(255, 83, 45, .55);
    animation: numberPulse .75s ease-in-out infinite;
}

.vault-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
}

.vault-stage {
    position: relative;
    min-width: 0;
    min-height: clamp(630px, 69svh, 760px);
    overflow: hidden;
    isolation: isolate;
    border-right: 1px solid var(--line);
    background-color: #100704;
    background-image: url('/images/games/ember-vault.webp');
    background-position: center;
    background-size: cover;
}

.stage-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(4, 2, 1, .25), rgba(4, 2, 1, .12) 55%, rgba(4, 2, 1, .26)),
        linear-gradient(0deg, rgba(3, 1, 0, .88), transparent 35%, rgba(3, 1, 0, .36));
    box-shadow: inset 0 0 95px 14px rgba(0, 0, 0, .7);
}

.dragon-breath {
    position: absolute;
    top: 22%;
    right: 3%;
    z-index: 2;
    width: 54%;
    height: 49%;
    border-radius: 50%;
    pointer-events: none;
    opacity: .16;
    background: radial-gradient(ellipse, rgba(255, 99, 28, .68), transparent 67%);
    filter: blur(15px);
    animation: dragonBreath 4.8s ease-in-out infinite;
    transition: opacity .6s;
}

.dragon-eye {
    position: absolute;
    top: 43.5%;
    left: 54.5%;
    z-index: 3;
    width: 17px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    background: #ffd05b;
    box-shadow: 0 0 7px 2px #ff7a22, 0 0 23px 8px rgba(255, 54, 18, .7);
    transform: rotate(-18deg) scaleY(.25);
    transition: opacity .5s, transform .7s;
}

.vault-stage[data-dragon-state="restless"] .dragon-breath { opacity: .3; animation-duration: 3.6s; }
.vault-stage[data-dragon-state="stirring"] .dragon-breath { opacity: .46; animation-duration: 2.4s; }
.vault-stage[data-dragon-state="stirring"] .dragon-eye { opacity: .9; transform: rotate(-18deg) scaleY(1); }
.vault-stage[data-dragon-state="awake"] .dragon-breath { opacity: .85; }
.vault-stage[data-dragon-state="awake"] .dragon-eye { opacity: 1; transform: rotate(-18deg) scale(1.5, 1.3); }

.listen-wave {
    position: absolute;
    top: 43%;
    left: 57%;
    z-index: 20;
    width: 80px;
    height: 80px;
    border: 2px solid rgba(255, 166, 61, .8);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(.2);
}

.vault-stage.listening .listen-wave {
    animation: listenPulse 1s ease-out;
}

.vault-stage.listening {
    animation: listenJolt .55s ease;
}

.fire-wash {
    position: absolute;
    inset: 0;
    z-index: 55;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(circle at 66% 46%, #fff5ae, #ff7426 22%, rgba(192, 27, 5, .88) 52%, #130000 86%);
    mix-blend-mode: screen;
}

.vault-stage.fire .fire-wash {
    animation: fireBurst 1.3s ease forwards;
}

.stage-topline {
    position: absolute;
    top: 14px;
    right: 15px;
    left: 15px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    pointer-events: none;
}

.location-chip,
.stance-chip {
    min-height: 33px;
    padding: 8px 11px;
    border: 1px solid rgba(247, 211, 148, .23);
    border-radius: 30px;
    color: #e5d9c7;
    background: rgba(10, 5, 2, .7);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .24);
    backdrop-filter: blur(8px);
    font: 900 8px/1.2 Arial, sans-serif;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.location-chip i {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--ember);
    box-shadow: 0 0 10px var(--ember);
}

.stance-chip {
    color: #bcd5c4;
}

.stance-chip.armed {
    border-color: rgba(159, 218, 180, .55);
    color: #d8f0df;
    background: rgba(23, 60, 38, .72);
    box-shadow: 0 0 24px rgba(77, 178, 112, .18);
}

.vault-map-zone {
    position: absolute;
    right: 20px;
    bottom: 103px;
    left: 20px;
    z-index: 15;
    width: min(600px, calc(100% - 40px));
}

.map-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 0 2px 8px;
    color: #f2d7a6;
    font: 900 8px Arial, sans-serif;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.map-heading small {
    color: #a89178;
    font-size: 7px;
    letter-spacing: .09em;
}

.vault-board {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 5px;
    padding: 8px;
    border: 1px solid rgba(246, 196, 111, .34);
    border-radius: 13px;
    background: rgba(7, 3, 1, .61);
    box-shadow: 0 22px 50px rgba(0, 0, 0, .58), inset 0 0 45px rgba(119, 45, 12, .12);
    backdrop-filter: blur(3px);
}

.vault-board:focus-visible {
    outline: 3px solid rgba(244, 172, 68, .56);
    outline-offset: 4px;
}

.vault-tile {
    position: relative;
    display: grid;
    min-width: 0;
    aspect-ratio: 1;
    padding: 0;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(246, 211, 157, .12);
    border-radius: 8px;
    color: #ad987e;
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 210, 118, .09), transparent 33%),
        rgba(31, 17, 9, .71);
    box-shadow: inset 0 -9px 14px rgba(0, 0, 0, .22);
    cursor: default;
    transition: border-color .18s, background .18s, transform .18s, opacity .3s;
}

.vault-tile::after {
    content: "";
    position: absolute;
    right: 15%;
    bottom: 8%;
    left: 15%;
    height: 12%;
    border-radius: 50%;
    opacity: .28;
    background: #000;
    filter: blur(4px);
}

.vault-tile.unrevealed {
    border-color: rgba(255, 255, 255, .035);
    color: transparent;
    background: rgba(4, 2, 1, .82);
}

.vault-tile.visited {
    border-color: rgba(244, 188, 91, .24);
    background: rgba(48, 27, 13, .68);
}

.vault-tile.reachable {
    border-color: rgba(244, 181, 80, .48);
    cursor: pointer;
    box-shadow: inset 0 0 18px rgba(229, 137, 42, .1), 0 0 0 1px rgba(0, 0, 0, .35);
}

.vault-tile.reachable:hover,
.vault-tile.reachable:focus-visible {
    z-index: 4;
    border-color: #ffd07a;
    outline: 3px solid rgba(255, 170, 53, .26);
    outline-offset: 1px;
    background: rgba(90, 48, 19, .85);
    transform: translateY(-3px) scale(1.025);
}

.vault-tile.player {
    z-index: 3;
    border-color: #f9d995;
    background: radial-gradient(circle, rgba(247, 192, 89, .34), rgba(50, 24, 9, .78));
    box-shadow: inset 0 0 24px rgba(246, 159, 49, .24), 0 0 15px rgba(246, 145, 40, .35);
}

.vault-tile.shadow {
    background: radial-gradient(circle at 50% 20%, rgba(101, 101, 91, .08), rgba(3, 5, 6, .88));
}

.vault-tile.shadow::before {
    content: "";
    position: absolute;
    top: 15%;
    bottom: 12%;
    left: 50%;
    width: 34%;
    border-radius: 4px 4px 15px 15px;
    opacity: .55;
    background: linear-gradient(90deg, #16181a, #38332d, #101214);
    box-shadow: 0 8px 15px #000;
    transform: translateX(-50%);
}

.vault-tile.bones .terrain-symbol {
    color: var(--bone);
    text-shadow: 0 2px 5px #000;
}

.vault-tile.embers {
    background: radial-gradient(circle at 50% 65%, rgba(233, 76, 18, .28), rgba(39, 13, 6, .78));
}

.vault-tile.embers .terrain-symbol {
    color: #ff7432;
    text-shadow: 0 0 10px rgba(255, 75, 20, .8);
    animation: emberFlicker 1.4s ease-in-out infinite;
}

.vault-tile.blocked {
    border-color: rgba(26, 19, 14, .7);
    background: rgba(4, 3, 3, .83);
}

.vault-tile.blocked .terrain-symbol {
    color: #54463c;
    font-size: clamp(18px, 3vw, 30px);
}

.vault-tile.nest {
    border-color: rgba(219, 71, 30, .16);
    background: repeating-linear-gradient(135deg, rgba(70, 19, 7, .75) 0 6px, rgba(22, 8, 3, .8) 7px 13px);
}

.vault-tile.nest .terrain-symbol {
    color: #c94f2a;
    text-shadow: 0 0 12px rgba(255, 57, 24, .5);
}

.vault-tile.exit {
    border-color: rgba(142, 183, 158, .38);
}

.vault-tile.exit.ready {
    border-color: #93d6ad;
    box-shadow: inset 0 0 22px rgba(74, 173, 111, .22), 0 0 16px rgba(74, 173, 111, .25);
}

.terrain-symbol {
    position: relative;
    z-index: 1;
    grid-area: 1 / 1;
    font: 500 clamp(13px, 2vw, 21px)/1 Georgia, serif;
}

.exit-token {
    position: relative;
    z-index: 2;
    grid-area: 1 / 1;
    width: 45%;
    height: 58%;
    border: 3px solid #8ea792;
    border-bottom: 0;
    border-radius: 22px 22px 3px 3px;
    background: linear-gradient(#101718, #030504);
    box-shadow: inset 0 0 9px #000, 0 0 9px rgba(110, 189, 143, .23);
}

.exit-token::after {
    content: "";
    position: absolute;
    right: -35%;
    bottom: -3px;
    left: -35%;
    height: 3px;
    background: #8ea792;
}

.treasure-token {
    position: relative;
    z-index: 3;
    grid-area: 1 / 1;
    display: grid;
    width: 58%;
    height: 58%;
    place-items: center;
    border: 1px solid rgba(255, 215, 123, .7);
    border-radius: 50% 50% 8px 8px;
    color: #fff0aa;
    background: radial-gradient(circle, #a54d18, #361207 72%);
    box-shadow: 0 0 13px rgba(255, 161, 45, .7), inset 0 0 10px rgba(255, 219, 128, .27);
    font: 700 clamp(15px, 2.2vw, 26px)/1 Georgia, serif;
    animation: treasureGlow 2.2s ease-in-out infinite;
}

.treasure-token::after {
    content: "";
    position: absolute;
    right: -20%;
    bottom: -16%;
    left: -20%;
    height: 18%;
    border-radius: 3px;
    background: linear-gradient(#b47a32, #3f210d);
    box-shadow: 0 4px 6px #000;
}

.thief-token {
    position: relative;
    z-index: 5;
    grid-area: 1 / 1;
    width: 44%;
    height: 61%;
    border: 2px solid #f1d193;
    border-radius: 46% 46% 18% 18%;
    background: linear-gradient(150deg, #362e2c, #090b0d 68%);
    box-shadow: 0 5px 9px #000, 0 0 11px rgba(251, 209, 133, .3);
    clip-path: polygon(24% 0, 76% 0, 88% 29%, 76% 42%, 100% 100%, 0 100%, 24% 42%, 12% 29%);
    animation: thiefBreathe 1.8s ease-in-out infinite;
}

.thief-token::before {
    content: "";
    position: absolute;
    top: 17%;
    left: 50%;
    width: 33%;
    height: 18%;
    border-radius: 50%;
    background: #f0be74;
    box-shadow: -8px 3px 0 -4px #f4d392, 8px 3px 0 -4px #f4d392;
    transform: translateX(-50%);
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 13px;
    margin-top: 8px;
    color: #a59179;
    font: 800 7px Arial, sans-serif;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.map-legend i {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: #534535;
}

.map-legend .legend-shadow { background: #152326; }
.map-legend .legend-bones { background: #d9cbb4; }
.map-legend .legend-embers { background: #d8521e; box-shadow: 0 0 6px #e75b21; }
.map-legend .legend-nest { background: #661f0f; }

.story-beat {
    position: absolute;
    right: 184px;
    bottom: 17px;
    left: 17px;
    z-index: 35;
    display: grid;
    grid-template-columns: 30px 1fr;
    align-items: center;
    gap: 10px;
    min-height: 66px;
    padding: 11px 13px;
    border: 1px solid rgba(244, 205, 139, .25);
    border-radius: 10px;
    color: #e8ded0;
    background: rgba(9, 5, 3, .84);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .38);
    backdrop-filter: blur(9px);
}

.story-beat.flash {
    animation: storyIn .35s ease;
}

.story-mark {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid #a56b2d;
    border-radius: 50%;
    color: #f1c878;
    font: italic 600 13px Georgia, serif;
}

.story-beat p {
    margin: 0;
    font: 13px/1.45 Georgia, serif;
}

.dpad {
    position: absolute;
    right: 17px;
    bottom: 15px;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(3, 45px);
    grid-template-rows: repeat(3, 45px);
    gap: 4px;
}

.dpad button {
    display: grid;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(245, 211, 153, .28);
    border-radius: 6px;
    color: #e7d5bb;
    background: rgba(14, 8, 4, .86);
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .35);
    cursor: pointer;
    transition: .16s;
}

.dpad button:hover,
.dpad button:focus-visible {
    border-color: var(--ember);
    color: #fff1ce;
    outline: 3px solid rgba(242, 159, 51, .23);
    outline-offset: 1px;
    background: #42200e;
}

.dpad button:disabled {
    opacity: .3;
    cursor: not-allowed;
}

.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-center { grid-column: 2; grid-row: 2; }
.dpad-right { grid-column: 3; grid-row: 2; }
.dpad-down { grid-column: 2; grid-row: 3; }
.dpad .dpad-center {
    display: flex;
    flex-direction: column;
    line-height: .75;
}
.dpad-center small { font: 700 5px Arial, sans-serif; letter-spacing: .08em; }

.toast {
    position: absolute;
    top: 57px;
    left: 50%;
    z-index: 70;
    max-width: min(430px, 84%);
    padding: 9px 13px;
    border: 1px solid rgba(247, 187, 91, .62);
    border-radius: 30px;
    color: #ffedcb;
    background: rgba(11, 5, 2, .94);
    box-shadow: 0 10px 30px #000;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -10px);
    transition: .25s;
    font: 900 8px/1.35 Arial, sans-serif;
    letter-spacing: .09em;
    text-align: center;
    text-transform: uppercase;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.heist-book {
    display: flex;
    min-width: 0;
    flex-direction: column;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px),
        linear-gradient(180deg, #160d08, #0c0704);
    background-size: 18px 100%, auto;
}

.book-section {
    padding: 17px;
    border-bottom: 1px solid var(--line);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.section-heading h2 {
    margin: 0;
    color: var(--gold);
    font: 900 8px Arial, sans-serif;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.section-heading > span {
    color: #776756;
    font: 800 7px Arial, sans-serif;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.objective-list {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.objective {
    display: grid;
    grid-template-columns: 25px 1fr;
    align-items: center;
    gap: 9px;
    color: #b8a68e;
}

.objective > i {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border: 1px solid #4a3526;
    border-radius: 50%;
    color: #8a735b;
    background: #0b0603;
    font: 800 8px Arial, sans-serif;
    font-style: normal;
}

.objective strong,
.objective small {
    display: block;
}

.objective strong {
    color: #e0d3bf;
    font: 700 10px/1.25 Arial, sans-serif;
}

.objective small {
    margin-top: 2px;
    color: #796b5d;
    font: 8px/1.3 Arial, sans-serif;
}

.objective.done > i {
    border-color: #8bc49d;
    color: #07150d;
    background: #8bc49d;
}

.objective.done > i::before { content: "✓"; }
.objective.done > i { font-size: 0; }
.objective.done strong { color: #9ecbad; }

.relic-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
}

.relic-slot {
    display: grid;
    min-width: 0;
    min-height: 55px;
    padding: 7px 4px;
    place-items: center;
    border: 1px dashed #493529;
    border-radius: 7px;
    color: #5d4c3d;
    background: rgba(7, 4, 2, .48);
}

.relic-slot b {
    font: 500 18px Georgia, serif;
}

.relic-slot span {
    font: 900 6px Arial, sans-serif;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.relic-slot.filled {
    border-style: solid;
    border-color: #ba7834;
    color: #f4cf84;
    background: radial-gradient(circle, rgba(179, 90, 25, .24), rgba(20, 10, 5, .6));
    box-shadow: inset 0 0 17px rgba(255, 151, 40, .1);
    animation: relicIn .45s ease;
}

.field-section {
    flex: 1;
    min-height: 140px;
}

.whisper-log {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.whisper-log li {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(244, 191, 102, .09);
    color: #aa9a87;
    font: 11px/1.4 Georgia, serif;
    animation: logIn .3s ease;
}

.whisper-log li:first-child {
    padding-top: 0;
    border-top: 0;
    color: #e2d4c1;
}

.whisper-log time {
    color: #a6753f;
    font: 800 7px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.action-deck {
    display: grid;
    gap: 7px;
    margin-top: auto;
    padding: 14px;
    border-top: 1px solid var(--line);
    background: rgba(5, 3, 2, .4);
}

.heist-action {
    display: grid;
    grid-template-columns: 33px 1fr 23px;
    align-items: center;
    gap: 9px;
    min-height: 52px;
    padding: 8px 9px;
    border: 1px solid rgba(243, 195, 113, .22);
    border-radius: 8px;
    color: #d7c7b2;
    background: #160d08;
    cursor: pointer;
    text-align: left;
    transition: .18s;
}

.heist-action:hover,
.heist-action:focus-visible {
    border-color: var(--ember);
    color: #f5e3c4;
    outline: 3px solid rgba(242, 158, 48, .18);
    outline-offset: 1px;
    background: #251309;
    transform: translateY(-1px);
}

.heist-action:disabled {
    opacity: .38;
    cursor: not-allowed;
    transform: none;
}

.action-icon {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid #614327;
    border-radius: 50%;
    color: #e3b76e;
    background: #0b0603;
}

.heist-action strong,
.heist-action small {
    display: block;
}

.heist-action strong {
    font: 800 9px/1.2 Arial, sans-serif;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.heist-action small {
    margin-top: 3px;
    color: #786a5b;
    font: 8px/1.25 Arial, sans-serif;
}

.heist-action > b {
    display: grid;
    width: 21px;
    height: 21px;
    place-items: center;
    border-radius: 50%;
    color: #221107;
    background: var(--ember);
    font: 900 8px Arial, sans-serif;
}

.subtle-action {
    grid-template-columns: 33px 1fr;
    min-height: 44px;
    opacity: .72;
}

.subtle-action .action-icon {
    width: 29px;
    height: 29px;
}

.modal-layer {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    overflow-y: auto;
    padding: 24px;
    place-items: center;
    background: rgba(5, 2, 1, .86);
    backdrop-filter: blur(12px);
    animation: modalFade .25s ease;
}

.modal-layer::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: .28;
    background: url('/images/games/ember-vault.webp') center/cover;
}

.briefing-card,
.modal-card {
    position: relative;
    width: min(740px, 100%);
    overflow: hidden;
    border: 1px solid rgba(247, 184, 76, .48);
    border-radius: 18px;
    background:
        radial-gradient(circle at 85% 0, rgba(167, 61, 17, .24), transparent 35%),
        linear-gradient(145deg, rgba(34, 17, 8, .98), rgba(9, 5, 3, .99) 70%);
    box-shadow: 0 35px 100px #000;
}

.briefing-card {
    padding: 30px;
}

.briefing-card::after,
.modal-card::after {
    content: "";
    position: absolute;
    inset: 8px;
    z-index: -1;
    border: 1px solid rgba(245, 195, 112, .08);
    border-radius: 13px;
    pointer-events: none;
}

.briefing-title-row {
    display: grid;
    grid-template-columns: 75px 1fr;
    align-items: center;
    gap: 18px;
}

.vault-seal {
    display: grid;
    width: 72px;
    height: 72px;
    place-items: center;
    border: 1px solid #a56628;
    border-radius: 50%;
    color: #f4c876;
    background: radial-gradient(circle, #5c260d, #150905 70%);
    box-shadow: 0 0 0 6px rgba(191, 113, 38, .08), inset 0 0 20px #000;
    font: italic 500 31px Georgia, serif;
}

.vault-seal span {
    transform: rotate(-9deg);
}

.briefing-card h2,
.modal-card h2 {
    margin: 0;
    color: #fbf0df;
    font: 400 clamp(36px, 6vw, 58px)/.95 Georgia, serif;
    letter-spacing: -.05em;
}

.briefing-title-row p,
.ending-copy {
    margin: 8px 0 0;
    color: #af9c84;
    font: 14px/1.5 Georgia, serif;
}

.briefing-rules {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin: 25px 0 14px;
}

.briefing-rules > div {
    min-height: 118px;
    padding: 13px;
    border: 1px solid rgba(244, 190, 100, .18);
    border-radius: 9px;
    background: rgba(8, 4, 2, .55);
}

.briefing-rules i {
    display: block;
    margin-bottom: 14px;
    color: var(--ember);
    font: 900 8px Arial, sans-serif;
    letter-spacing: .12em;
    font-style: normal;
}

.briefing-rules strong,
.briefing-rules span {
    display: block;
}

.briefing-rules strong {
    color: #ebdfcc;
    font: 800 10px/1.25 Arial, sans-serif;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.briefing-rules span {
    margin-top: 6px;
    color: #8d7b68;
    font: 10px/1.4 Arial, sans-serif;
}

.briefing-warning {
    display: grid;
    grid-template-columns: 27px 1fr;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 11px 13px;
    border-left: 2px solid var(--ember-hot);
    color: #a8947d;
    background: rgba(93, 29, 8, .22);
}

.briefing-warning > span {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border: 1px solid #9e4820;
    border-radius: 50%;
    color: #ff9a48;
    font: 900 9px Arial, sans-serif;
}

.briefing-warning p {
    margin: 0;
    font: 10px/1.45 Arial, sans-serif;
}

.briefing-warning strong { color: #e7caa2; }

.ember-button {
    display: inline-flex;
    min-height: 49px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 17px;
    border: 1px solid rgba(239, 185, 93, .37);
    border-radius: 7px;
    color: #ebdcc5;
    background: #1d1008;
    cursor: pointer;
    font: 900 9px Arial, sans-serif;
    letter-spacing: .12em;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    transition: .2s;
}

.ember-button:hover,
.ember-button:focus-visible {
    border-color: var(--gold);
    color: #fff4de;
    outline: 3px solid rgba(244, 172, 66, .2);
    outline-offset: 2px;
    transform: translateY(-2px);
}

.ember-button.primary {
    border-color: #e8a646;
    color: #1b0b03;
    background: linear-gradient(135deg, #f7d889, #dd8c2f 68%, #b9581e);
    box-shadow: 0 10px 28px rgba(204, 94, 24, .2), inset 0 1px rgba(255, 255, 255, .5);
}

.briefing-card > .ember-button {
    width: 100%;
}

.modal-card {
    width: min(650px, 100%);
    padding: 29px;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    display: grid;
    width: 36px;
    height: 36px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: #b8a791;
    background: #120a06;
    cursor: pointer;
}

.modal-close:hover,
.modal-close:focus-visible {
    border-color: var(--ember);
    color: var(--gold);
    outline: 3px solid rgba(243, 166, 59, .2);
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
    margin: 23px 0 16px;
    text-align: left;
}

.rules-grid > div {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(244, 190, 100, .16);
    border-radius: 8px;
    background: rgba(7, 4, 2, .56);
}

.rules-grid > div > b {
    display: grid;
    width: 35px;
    height: 35px;
    place-items: center;
    border: 1px solid #694524;
    border-radius: 50%;
    color: #efb65c;
    font: 700 12px Georgia, serif;
}

.rules-grid p { margin: 0; }
.rules-grid strong,
.rules-grid span { display: block; }
.rules-grid strong { color: #e6d6bf; font: 800 9px/1.3 Arial, sans-serif; text-transform: uppercase; }
.rules-grid span { margin-top: 4px; color: #8d7c68; font: 9px/1.4 Arial, sans-serif; }
.rules-card > .ember-button { width: 100%; }

.ending-sigil {
    display: grid;
    width: 67px;
    height: 67px;
    margin: 0 auto 13px;
    place-items: center;
    border: 1px solid #d08a37;
    border-radius: 50%;
    color: var(--gold);
    background: radial-gradient(circle, #733214, #170a05 74%);
    box-shadow: 0 0 30px rgba(228, 114, 32, .21);
    font-size: 25px;
}

.ending-card.failed .ending-sigil {
    border-color: #d94b35;
    color: #ff8870;
    background: radial-gradient(circle, #71180e, #180302 74%);
}

.ending-copy {
    max-width: 510px;
    margin: 10px auto 20px;
}

.grade-row {
    display: grid;
    grid-template-columns: 132px 1fr;
    gap: 12px;
    margin: 18px 0;
}

.grade-medallion,
.ending-stats {
    border: 1px solid rgba(244, 191, 102, .18);
    border-radius: 10px;
    background: rgba(7, 4, 2, .55);
}

.grade-medallion {
    display: grid;
    min-height: 118px;
    align-content: center;
    place-items: center;
}

.grade-medallion small {
    color: #8d7964;
    font: 900 7px Arial, sans-serif;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.grade-medallion strong {
    margin-top: 2px;
    color: var(--gold);
    font: italic 500 58px/.9 Georgia, serif;
    text-shadow: 0 0 22px rgba(246, 183, 80, .28);
}

.ending-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0;
    padding: 0;
}

.ending-stats > div {
    display: grid;
    align-content: center;
    padding: 12px;
    border-left: 1px solid rgba(244, 191, 102, .12);
}

.ending-stats > div:first-child { border-left: 0; }
.ending-stats dt { color: #7f6d5b; font: 900 7px/1.35 Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.ending-stats dd { margin: 7px 0 0; color: #ead5b5; font: 800 17px ui-monospace, SFMono-Regular, Menlo, monospace; }

.ending-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

@keyframes emberRise {
    0% { opacity: 0; transform: translate(0, 0) scale(.5); }
    15% { opacity: .85; }
    75% { opacity: .3; }
    100% { opacity: 0; transform: translate(45px, -95vh) scale(1.4); }
}
@keyframes dragonBreath { 50% { opacity: .35; transform: scale(1.08); } }
@keyframes listenPulse { 0% { opacity: .9; transform: translate(-50%, -50%) scale(.2); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(12); } }
@keyframes listenJolt { 35% { filter: brightness(1.16) saturate(1.2); } }
@keyframes fireBurst { 0% { opacity: 0; } 28% { opacity: 1; } 100% { opacity: .44; } }
@keyframes numberPulse { 50% { opacity: .45; } }
@keyframes emberFlicker { 50% { opacity: .55; transform: scale(.9); } }
@keyframes treasureGlow { 50% { transform: translateY(-2px); box-shadow: 0 0 21px rgba(255, 157, 37, .9), inset 0 0 10px rgba(255, 219, 128, .27); } }
@keyframes thiefBreathe { 50% { transform: translateY(-3px); } }
@keyframes storyIn { from { opacity: .35; transform: translateY(5px); } }
@keyframes relicIn { from { opacity: 0; transform: scale(.7) rotate(-7deg); } }
@keyframes logIn { from { opacity: 0; transform: translateY(-4px); } }
@keyframes modalFade { from { opacity: 0; } }

@media (min-width: 1200px) {
    .ember-wrap { padding-right: 30px; padding-left: 30px; }
}

@media (max-width: 1060px) {
    .vault-layout { grid-template-columns: minmax(0, 1fr) 300px; }
    .vault-rail { grid-template-columns: minmax(245px, 1fr) 145px 110px 138px; }
    .rail-stat { padding-right: 12px; padding-left: 12px; }
    .vault-map-zone { width: calc(100% - 40px); }
}

@media (max-width: 880px) {
    .ember-wrap { padding: 22px 14px 42px; }
    .heist-header h1 { font-size: clamp(38px, 8vw, 60px); }
    .vault-rail { grid-template-columns: 1fr repeat(3, minmax(86px, 115px)); }
    .vault-layout { grid-template-columns: 1fr; }
    .vault-stage { min-height: 650px; border-right: 0; border-bottom: 1px solid var(--line); }
    .heist-book { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .book-section { min-width: 0; }
    .field-section { min-height: 190px; }
    .action-deck { margin: 0; }
}

@media (max-width: 640px) {
    .ember-game { min-height: 100svh; }
    .ember-wrap { padding: 18px 10px 34px; }
    .heist-header { align-items: center; gap: 12px; }
    .heist-header h1 { font-size: clamp(34px, 10.2vw, 48px); }
    .heist-subtitle { display: none; }
    .heist-kicker { font-size: 7px; }
    .heist-kicker::before { width: 12px; }
    .round-action { width: 42px; height: 42px; }
    .vault-shell { border-radius: 14px; }
    .vault-rail { grid-template-columns: repeat(3, 1fr); min-height: auto; }
    .wake-panel { grid-column: 1 / -1; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
    .rail-stat { min-height: 58px; border-left: 1px solid var(--line); }
    .rail-stat:nth-child(2) { border-left: 0; }
    .rail-stat strong { font-size: 17px; }
    .vault-stage { min-height: 610px; background-position: 61% center; }
    .stage-scrim { background: linear-gradient(0deg, rgba(3, 1, 0, .93), transparent 47%, rgba(3, 1, 0, .46)); }
    .stage-topline { top: 10px; right: 10px; left: 10px; }
    .location-chip, .stance-chip { padding: 7px 9px; font-size: 6px; }
    .vault-map-zone { right: 9px; bottom: 222px; left: 9px; width: calc(100% - 18px); }
    .map-heading { margin-bottom: 6px; }
    .map-heading small { display: none; }
    .vault-board { gap: 3px; padding: 5px; border-radius: 9px; }
    .vault-tile { border-radius: 5px; }
    .map-legend { gap: 6px 9px; font-size: 5.5px; }
    .story-beat { right: 10px; bottom: 150px; left: 10px; min-height: 61px; }
    .story-beat p { font-size: 11px; }
    .dpad { right: 50%; bottom: 8px; grid-template-columns: repeat(3, 45px); transform: translateX(50%); }
    .heist-book { display: block; }
    .field-section { min-height: 0; }
    .briefing-card, .modal-card { padding: 22px 17px; }
    .briefing-title-row { grid-template-columns: 55px 1fr; gap: 12px; }
    .vault-seal { width: 54px; height: 54px; font-size: 24px; }
    .briefing-card h2, .modal-card h2 { font-size: clamp(33px, 10vw, 44px); }
    .briefing-title-row p { font-size: 12px; }
    .briefing-rules { grid-template-columns: 1fr; margin-top: 18px; }
    .briefing-rules > div { min-height: 0; }
    .briefing-rules i { float: left; margin: 2px 10px 15px 0; }
    .rules-grid { grid-template-columns: 1fr; }
    .grade-row { grid-template-columns: 95px 1fr; }
    .ending-stats { grid-template-columns: 1fr; }
    .ending-stats > div { padding: 7px 10px; border-top: 1px solid rgba(244, 191, 102, .12); border-left: 0; }
    .ending-stats > div:first-child { border-top: 0; }
    .ending-stats dd { margin-top: 2px; }
    .ending-actions { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
    .header-actions { gap: 5px; }
    .round-action { width: 39px; height: 39px; }
    .heist-header h1 { font-size: 33px; }
    .rail-stat { padding: 10px 8px; }
    .rail-stat small { font-size: 6px; }
    .vault-stage { min-height: 585px; }
    .vault-map-zone { bottom: 216px; }
    .map-legend span { gap: 3px; }
    .modal-layer { padding: 12px; }
}

@media (max-height: 720px) and (min-width: 881px) {
    .ember-wrap { padding-top: 18px; }
    .heist-header { margin-bottom: 13px; }
    .heist-header h1 { font-size: 48px; }
    .vault-stage { min-height: 585px; }
    .vault-map-zone { bottom: 96px; width: min(540px, calc(100% - 40px)); }
}

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