:root { color-scheme: dark; font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif; color: #e5f0ec; background: #030d12; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: radial-gradient(ellipse at 50% 30%, #15363d, #030d12 70%); }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible { outline: 2px solid #f5d187; outline-offset: 3px; }
[hidden] { display: none !important; }
.game { --gold: #f5d393; --muted: #93b4b4; position: relative; isolation: isolate; display: flex; flex-direction: column; width: min(100%, 520px); height: min(100dvh, 980px); min-height: 540px; margin: auto; overflow: hidden; border-inline: 1px solid #53727830; background: #092028; box-shadow: 0 12px 90px #0009; }
.game-ui { display: flex; flex: 1; flex-direction: column; min-height: 0; width: 100%; }
.topbar { position: relative; z-index: 10; display: flex; align-items: center; gap: 10px; min-height: calc(54px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; background: #071b23; border-bottom: 1px solid #9fc6c922; }
.back { display: flex; align-items: center; gap: 5px; color: #e8efed; font-size: 27px; text-decoration: none; }
.back img { border-radius: 8px; }
.preview-tag { color: #a6c2c0; font-size: 11px; letter-spacing: .08em; }
.wallet { display: flex; align-items: center; gap: 7px; margin-left: auto; white-space: nowrap; }
.wallet > span { color: #88a5a8; font-size: 10px; }
.wallet strong { color: var(--gold); font-size: 16px; font-variant-numeric: tabular-nums; }
.playfield { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 18px 12px 8px; overflow: hidden; }
.scene { position: absolute; z-index: -2; inset: 0; background: linear-gradient(#061c27bf, #071e2440 48%, #071e2499 76%, #0a252ae6), var(--scene-art, url('./assets/themes/yacht-storage.webp')) center 56% / cover no-repeat; }
.scene::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 70px #010d16c9; background: radial-gradient(ellipse at 50% 0, #89dfe51a, transparent 70%); }
.heading { align-self: stretch; margin-bottom: auto; padding: 8px 14px 0; text-align: center; }
.heading > span { color: #8bbdc1; font-size: 8px; letter-spacing: .32em; }
.heading h1, .heading .game-title { margin: 6px 0 8px; color: #ece3c9; font-size: clamp(23px, 6vw, 30px); font-weight: 650; letter-spacing: .18em; }
.heading p { margin: 0; color: #bdd0ce; font-size: 11px; letter-spacing: .06em; }
.pot { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 20px; margin-bottom: auto; padding: 16px 25px; min-width: 200px; border-block: 1px solid #a0c7c022; background: radial-gradient(ellipse, #081f2bba, #081f2b00 72%); text-align: center; }
.pot > span { color: #c1d6d1; font-size: 12px; letter-spacing: .12em; }
.pot strong { display: flex; align-items: center; gap: 9px; color: var(--gold); font-size: clamp(45px, 13vw, 65px); font-weight: 720; line-height: 1.08; font-variant-numeric: tabular-nums; }
.coin-mark { width: 21px; height: 21px; overflow: hidden; border: 2px solid #ffe4a8; border-radius: 50%; color: #e4b75d; background: #e4b75d; font-size: 0; box-shadow: inset 0 0 0 3px #997032; }
.pot small { min-height: 15px; color: #91b7b2; font-size: 10px; }
.pot.is-gaining strong { animation: gain .35s ease-out; }
.choice-caption { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 16px; text-align: center; }
#cue { min-height: 21px; color: #e6eddc; font-size: 14px; letter-spacing: .04em; }
.risk { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid #c8ac8245; border-radius: 20px; color: #e6bb93; background: #08212bcc; line-height: 26px; }
.risk img { flex: 0 0 auto; object-fit: contain; }
.risk b { color: #efd2b1; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.chests { position: relative; flex: 0 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; width: 100%; height: clamp(110px, 28vw, 150px); min-height: 110px; margin-top: 6px; gap: 0; }
.chest { position: relative; display: flex; align-items: center; flex-direction: column; width: 100%; height: 100%; padding: 0 0 9px; border: 0; background: transparent; color: #8fa6a5; transition: opacity .18s, filter .18s; }
.chest canvas { position: absolute; z-index: 2; bottom: 15px; display: block; width: 115%; max-width: none; aspect-ratio: 1; height: auto; pointer-events: none; filter: drop-shadow(0 8px 5px #0008); }
.chest > small { position: absolute; z-index: 2; bottom: 3px; color: #99b4ad; font: 9px ui-monospace, monospace; letter-spacing: .22em; }
.game[data-theme="guest"] .chests, .game[data-theme="suite"] .chests { height: calc(clamp(110px, 28vw, 150px) + 28px); }
.game[data-theme="guest"] .chest canvas, .game[data-theme="suite"] .chest canvas { width: 110%; }
.floor-shadow { position: absolute; z-index: 0; left: 7%; right: 7%; bottom: 25px; height: 18px; border-radius: 50%; background: #00101888; filter: blur(5px); }
.chest:not(:disabled):hover canvas { filter: drop-shadow(0 0 8px #ebbc6766) drop-shadow(0 8px 5px #0008); }
.chest.is-muted { opacity: .3; filter: saturate(.4); }
.chest.is-picked::before { content: ''; position: absolute; z-index: 1; width: 110%; height: 70%; top: 10%; border-radius: 50%; background: radial-gradient(ellipse, #f7d38133, transparent 65%); }
.reward { position: absolute; z-index: 4; top: 8%; left: -10%; right: -10%; color: #ffe3a4; font-size: clamp(20px, 6vw, 28px); font-weight: 750; opacity: 0; pointer-events: none; text-align: center; text-shadow: 0 2px 9px #000; }
.chest.is-rewarding .reward { animation: reward-rise .7s both; }
.chests.is-refreshing { animation: refresh .28s ease-out both; }
.run-progress { display: flex; gap: 5px; justify-content: center; min-height: 18px; margin-top: 8px; }
.run-progress span { width: 4px; height: 4px; border-radius: 50%; background: #81a5a845; }
.run-progress span.is-open { background: #e7c987; box-shadow: 0 0 5px #e7c98755; }
.controls { position: relative; z-index: 5; flex: 0 0 auto; padding: 15px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #a7cbcc25; background: linear-gradient(#102b30, #071c24); }
.stake-heading { display: flex; justify-content: space-between; gap: 8px; padding: 0 2px 9px; color: #a9c0bb; font-size: 11px; }
#round-note { color: #789a9b; font-size: 10px; }
.stakes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.stakes button { min-height: 40px; padding: 6px 0; border: 1px solid #77938a50; border-radius: 6px; color: #cad7cb; background: #0d2027; font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stakes button[aria-pressed="true"] { border-color: #dfbd7c; color: #f4dcac; background: #66502c66; box-shadow: inset 0 0 0 1px #dfbd7c30; }
.stakes button:disabled { opacity: .55; }
.collect, .again { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 52px; margin-top: 12px; padding: 10px; border: 1px solid #ffe0a2; border-radius: 7px; color: #30240f; background: linear-gradient(115deg, #f0d59c, #c99d5f); font-size: 15px; font-weight: 750; box-shadow: inset 0 1px #fff2ca80, 0 3px 10px #0003; }
.collect strong { font-size: 21px; font-variant-numeric: tabular-nums; }
.collect:disabled { color: #73918f; border-color: #6c8b8340; background: #173339; box-shadow: none; }
.preview-footer { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 12px; color: #5e8587; font-size: 9px; }
.preview-footer a, .preview-footer button { padding: 4px 0; border: 0; color: #7fa4a2; background: transparent; font-size: 9px; text-decoration: none; }
.preview-footer button:disabled { opacity: .35; }
.blast { position: absolute; z-index: 9; top: 20%; left: -10%; width: 120%; height: auto; aspect-ratio: 1; opacity: 0; pointer-events: none; }
.impact, .crack { position: fixed; z-index: 25; inset: 0; opacity: 0; pointer-events: none; }
.impact { background: radial-gradient(ellipse at 50% 54%, #fff6df 0 8%, #ffc37c 30%, #ff672baa 60%, transparent); }
.crack { background: url('./assets/themes/shipwreck-screen-crack.webp') center / 100% 100% no-repeat; }
body.is-impact .game { animation: shake .52s both; }
.impact.is-active { animation: flash .6s ease-out both; }
.crack.is-active { animation: crack .6s ease-out both; }
.game[data-phase="lost"] .pot strong { color: #e9a38a; }
@keyframes gain { 35% { transform: scale(1.08); } }
@keyframes reward-rise { 0% { opacity: 0; transform: translateY(8px); } 20%, 65% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px); } }
@keyframes refresh { from { opacity: .25; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 15% { transform: translate(-10px, 6px); } 32% { transform: translate(9px, -7px); } 52% { transform: translate(-6px, -4px); } 74% { transform: translate(4px, 3px); } }
@keyframes flash { 0%, 10% { opacity: 1; } 100% { opacity: 0; } }
@keyframes crack { from { opacity: 0; clip-path: circle(0 at 50% 54%); } to { opacity: .65; clip-path: circle(140% at 50% 54%); } }
@media (max-height: 740px) { .playfield { padding-top: 8px; } .heading { padding-top: 0; } .heading h1, .heading .game-title { margin: 3px 0 4px; font-size: 23px; } .heading > span { font-size: 7px; } .pot { min-width: 170px; gap: 3px; padding: 8px 20px; margin-top: 10px; } .pot strong { font-size: 44px; } .choice-caption { gap: 4px; margin-top: 8px; } .chests { min-height: 110px; margin-top: 0; } .run-progress { margin-top: 2px; min-height: 10px; } .controls { padding-top: 11px; padding-bottom: calc(7px + env(safe-area-inset-bottom)); } .collect, .again { min-height: 46px; margin-top: 9px; } .preview-footer { margin-top: 6px; } }
@media (max-width: 350px) { .topbar { gap: 6px; padding-inline: 10px; } .wallet { gap: 5px; } .wallet > span { display: none; } .controls { padding-inline: 15px; } .preview-footer { font-size: 8px; } }
@media (max-height: 640px) { .heading > span, .heading p:not(.game-title) { display: none; } .heading h1, .heading .game-title { margin: 0; line-height: 1.2; } }
@media (max-height: 640px) { .game[data-theme="guest"] .chests, .game[data-theme="suite"] .chests { height: 110px; } .game[data-theme="guest"] .chest canvas, .game[data-theme="suite"] .chest canvas { width: 90%; } }
@media (min-width: 700px) { body { display: grid; place-items: center; } .game { border: 1px solid #57787a55; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } .crack.is-active { opacity: .55; } }

.game .zf-game-control { position: static; flex: 0 0 auto; gap: 5px; }
.game .zf-game-control > a, .game .zf-game-control > button { width: 34px; height: 34px; border-color: #77938a50; background: #102b34; color: #e5f0ec; box-shadow: none; border-radius: 7px; }
.game .zf-game-control > a { width: 43px; }
.game .zf-game-control > button img { width: 20px; height: 20px; filter: brightness(0) invert(.9); }

.game[data-locale="vi"] .heading .game-title { font-size: clamp(22px, 6vw, 28px); line-height: 1.2; letter-spacing: .04em; font-weight: 650; }
