:root {
  --paper: #fff6e6; --paper2: #fdeac8; --ink: #3a2417; --soft: #7a5c46;
  --brick: #a8462a; --gold: #e9a93a; --leaf: #2f7d52; --warn: #b4560f;
  --shadow: 0 14px 40px rgba(50, 24, 6, .3);
  --fs: 18px;
}
body.big { --fs: 21px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font: 500 var(--fs)/1.45 'Baloo 2', system-ui, sans-serif; color: var(--ink); background: #ffd9a8; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #1f6fd1; outline-offset: 2px; }
.hidden { display: none !important; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; transition: filter .8s; }
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 40%, transparent 60%, rgba(60, 25, 10, .32)); }
#loading { position: fixed; inset: 0; display: grid; place-items: center; font-size: 1.4rem; text-align: center; padding: 20px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35em; min-height: 48px; padding: .35em 1.1em; border: 2px solid #d7b98c; border-radius: 999px; background: var(--paper); font-weight: 700; text-decoration: none; color: var(--ink); box-shadow: 0 3px 0 #c9a672; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #c9a672; }
.btn.primary { background: var(--brick); border-color: var(--brick); color: #fff; box-shadow: 0 3px 0 #6f2a17; }
.btn.small { min-height: 44px; padding: .15em .8em; font-size: .88em; }
.btn.round { width: 44px; padding: 0; }
.btn.big { min-height: 58px; font-size: 1.15em; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; text-decoration: underline; }
.btn:disabled { opacity: .45; }

#hud { position: fixed; z-index: 5; top: calc(8px + env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; pointer-events: none; }
#hud .plate { pointer-events: auto; background: rgba(255, 246, 230, .94); border-radius: 18px; padding: 4px 14px 6px; box-shadow: var(--shadow); min-width: 0; }
#bag { display: flex; gap: 5px; }
#bag span { width: 30px; height: 30px; border-radius: 50%; border: 2px dashed #cbab7d; }
#bag span.got { border: 0; }
.tools { display: flex; gap: 8px; pointer-events: auto; }
#btn-settings2 { position: fixed; z-index: 4; top: calc(8px + env(safe-area-inset-top)); right: 10px; }
#hud:not(.hidden) ~ #btn-settings2 { display: none; }

/* Bảng nội dung */
.sheet { background: var(--paper); border: 3px solid #e4c28e; border-radius: 26px; box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; max-height: 100%; min-height: 0; width: 100%; }
.sheet h2 { margin: 0; font-size: 1.4em; line-height: 1.2; color: var(--brick); }
.sheet .body { overflow: auto; min-height: 0; overscroll-behavior: contain; padding: 2px; }
.sheet .body > p { margin: .4em 0; }
.sheet .foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; flex: none; }
.sheet .foot:empty { display: none; }
.badge { align-self: flex-start; font-size: .8em; font-weight: 700; color: var(--soft); background: var(--paper2); border-radius: 999px; padding: 1px 12px; }

#panel { position: fixed; z-index: 6; display: flex; pointer-events: none; }
#panel .sheet { pointer-events: auto; animation: rise .35s ease-out; }
@keyframes rise { from { transform: translateY(18px); } } /* không ẩn chữ nếu trình duyệt hoãn hoạt ảnh */
#panel.task { top: calc(64px + env(safe-area-inset-top)); bottom: 12px; right: 12px; width: min(540px, calc(100% - 24px)); align-items: center; }
#panel.center { inset: 64px 12px 12px; justify-content: center; align-items: center; }
#panel.center .sheet { width: min(520px, 100%); text-align: center; }
#panel.center .body canvas { display: block; margin: 6px auto; }
#panel.wide { inset: 10px; justify-content: center; align-items: center; }
#panel.wide .sheet { width: min(820px, 100%); }
#panel.title { inset: 0; padding: 16px; align-items: center; justify-content: flex-start; }
#panel.title .sheet { width: min(420px, 100%); margin-left: 3vw; text-align: center; background: rgba(255, 246, 230, .95); }
.logo small { color: var(--soft); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .72em; }
.logo h1 { margin: -4px 0; font-size: 3.4em; line-height: 1.15; font-weight: 800; color: var(--brick); text-shadow: 0 3px 0 #f4d49a; }
.logo p { margin: 0 0 6px; color: var(--soft); }
.titlecard .foot { flex-direction: column; }
.brand { margin: 4px 0 0; font-size: .85em; color: var(--soft); }
.brand a { display: inline-block; padding: 6px 2px; color: var(--brick); font-weight: 700; }
.small { font-size: .85em; color: var(--soft); }
.note { background: var(--paper2); border-radius: 14px; padding: 8px 12px; font-size: .9em; }

.taskbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hearts { font-size: 1.6em; color: #d8453c; line-height: 1; letter-spacing: 3px; }
.hearts .lost { color: #d9c6ad; }
.hearts small { font-size: .5em; color: var(--soft); letter-spacing: 0; }
.question { font-weight: 700; font-size: 1.08em; }
.hint { border-radius: 14px; padding: 8px 12px; margin: 6px 0; }
.hint.warn { background: #ffe6c4; border-left: 6px solid var(--gold); }
.hint.good { background: #dcf1dd; border-left: 6px solid var(--leaf); }
.keylines { margin-top: 4px; }
.keylines em { background: #fff3a8; border-radius: 4px; padding: 0 4px; }

.chips.built { min-height: 54px; border-bottom: 3px dashed #ddc196; padding-bottom: 6px; }
.options { display: flex; flex-direction: column; gap: 9px; margin-top: 8px; }
.option, .chip, .target, button.line, .word { border: 2px solid #ddc196; background: #fffdf8; border-radius: 16px; }
.option { min-height: 50px; padding: 7px 14px; text-align: left; flex: none; }
.option.picked { background: #ffe9b8; border-color: var(--gold); }
.right, button.right:disabled { background: #d7f0d6 !important; border-color: var(--leaf) !important; opacity: 1; }
.option.right::after { content: ' ✔'; color: var(--leaf); font-weight: 800; }
.wrong { background: #ffe3d2 !important; border-color: var(--warn) !important; }
.option.wrong::after { content: ' ✖'; color: var(--warn); }
.option.gone { opacity: .35; text-decoration: line-through; }
.glow { animation: glow 1s ease-in-out infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 0 5px #ffd54a; } }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

.ordered { padding-left: 1.4em; margin: 6px 0; }
.ordered li { background: #d7f0d6; border-radius: 12px; padding: 4px 10px; margin: 4px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; min-height: 20px; }
.chip { min-height: 46px; padding: 4px 14px; font-weight: 700; touch-action: none; user-select: none; }
.chip i { font-style: normal; }
.chip.picked { background: #ffe9b8; border-color: var(--gold); box-shadow: 0 0 0 3px #ffd54a; }
.chip.ghost { position: fixed; z-index: 99; transform: translate(-50%, -50%) rotate(-3deg); pointer-events: none; box-shadow: var(--shadow); }
.targets { display: grid; gap: 8px; }
.targets.three { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.target { min-height: 64px; padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; border-style: dashed; }
.target > span { font-weight: 700; color: var(--soft); width: 100%; }
.target .chip { pointer-events: none; }
.target.basket { align-content: flex-start; min-height: 130px; padding: 6px; font-size: .88em; }
.target.basket .chip { width: 100%; padding: 2px 4px; min-height: 36px; }
.target.ready { border-color: var(--brick); }

.stanza { margin: 6px 0 12px; display: flex; flex-direction: column; gap: 3px; }
.stanza .line { margin: 0; padding: 1px 10px; text-align: left; }
button.line { min-height: 44px; }
.line.key { background: #fff3a8 !important; box-shadow: inset 4px 0 0 var(--gold); }
.stanza.words .line { display: flex; flex-wrap: wrap; gap: 4px; }
.word { min-height: 40px; min-width: 40px; padding: 0 9px; border-radius: 10px; }
.gustmeter { position: relative; height: 30px; border-radius: 99px; background: #e8d9bd; overflow: hidden; }
.gustmeter b { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #7fd8c0, #ffb3c8); transition: width .3s; }
.gustmeter span { position: relative; display: block; text-align: center; font-weight: 700; }
.emap .stop { display: grid; grid-template-columns: 1fr; gap: 2px; border: 2px solid #ddc196; border-radius: 16px; padding: 6px 10px; margin: 7px 0; }
.stop span { font-weight: 700; }
.stop small { display: block; font-weight: 500; color: var(--soft); font-style: italic; }
select, textarea { width: 100%; border: 2px solid #ddc196; border-radius: 14px; background: #fff; padding: 8px 10px; min-height: 46px; }
textarea { resize: vertical; }
.bank { display: flex; flex-wrap: wrap; gap: 6px; }
.count { color: var(--soft); }
.check { display: flex; gap: 10px; align-items: center; min-height: 40px; }
.check input { width: 22px; height: 22px; flex: none; accent-color: var(--brick); }
.slider { display: grid; grid-template-columns: 7.5em 1fr; align-items: center; min-height: 44px; }
.slider input { accent-color: var(--brick); width: 100%; }

#dialog { position: fixed; z-index: 7; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(720px, calc(100% - 20px)); background: var(--paper); border: 3px solid #e4c28e; border-radius: 24px; box-shadow: var(--shadow); padding: 12px 20px 8px; cursor: pointer; }
#dlg-name { display: inline-block; background: var(--brick); color: #fff; border-radius: 99px; padding: 0 14px; }
#dlg-name.mom { background: #3f7d8c; }
#dlg-text { margin: 8px 0 2px; font-size: 1.12em; min-height: 3em; }
#dlg-next { display: block; margin-left: auto; border: 0; background: none; color: var(--soft); min-height: 40px; font-weight: 700; }

#modal { position: fixed; inset: 0; z-index: 20; background: rgba(45, 22, 8, .55); display: flex; align-items: center; justify-content: center; padding: 12px; }
#modal .sheet { width: min(480px, 100%); }
.paper { background: linear-gradient(90deg, #f6e4bd 0, var(--paper) 7%); }
.poem-title { text-align: center; font-size: 1.5em; font-weight: 800; color: var(--brick); }
.poem-title small { display: block; font-size: .55em; font-weight: 500; color: var(--soft); }
.paper .stanza { align-items: flex-start; width: fit-content; margin-inline: auto; font-size: 1.1em; }

#banner { position: fixed; z-index: 8; top: 30%; left: 0; right: 0; text-align: center; color: #fff; text-shadow: 0 3px 12px rgba(40, 15, 0, .85); pointer-events: none; opacity: 0; }
#banner b { display: block; font-size: 2.4em; }
#banner.show { animation: banner 2.4s ease both; }
@keyframes banner { 0% { opacity: 0; transform: translateY(14px); } 15%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }
#toast { position: fixed; z-index: 30; left: 50%; bottom: calc(104px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: 92%; text-align: center; background: var(--ink); color: #fff; border-radius: 18px; padding: 7px 18px; opacity: 0; pointer-events: none; transition: opacity .25s; }
#toast.show { opacity: .95; }

.decor { position: relative; width: 100%; max-width: calc(58vh * 4 / 3); margin: 0 auto; border-radius: 18px; overflow: hidden; touch-action: none; }
.decor > img { display: block; width: 100%; pointer-events: none; }
.keep { position: absolute; transform: translate(-50%, -50%); background: none; border: 0; padding: 0; border-radius: 50%; touch-action: none; line-height: 0; }
.keep canvas { width: clamp(46px, 9vw, 80px) !important; height: clamp(46px, 9vw, 80px) !important; }
.keep.picked { box-shadow: 0 0 0 4px #ffd54a; }
img.card { display: block; max-width: 100%; max-height: 52vh; margin: 10px auto; border-radius: 14px; box-shadow: var(--shadow); }
.lo h3 { margin: 10px 0 2px; font-size: 1.02em; color: var(--brick); }
.lo ul { margin: 2px 0; padding-left: 1.1em; }
.lo li.ok, .lo li.again { list-style: none; margin-left: -1em; }
.lo li.again { color: var(--warn); }
.lo small { color: var(--soft); }
.keeps { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.keeps figure { margin: 0; width: 105px; font-size: .85em; line-height: 1.25; }
.keeps small { display: block; color: var(--soft); }

/* Điện thoại dọc: bảng nhiệm vụ nằm phía dưới */
@media (max-width: 760px) and (orientation: portrait) {
  :root { --fs: 17px; }
  body.big { --fs: 20px; }
  #panel.task { left: 8px; right: 8px; width: auto; top: 24%; bottom: 8px; align-items: flex-end; }
  #panel.title { align-items: flex-end; justify-content: center; }
  #panel.title .sheet { margin: 0; }
  .logo h1 { font-size: 2.7em; }
  .sheet { padding: 12px 13px; border-radius: 22px; }
  #hud .plate b { display: block; max-width: 42vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .92em; }
}
/* Điện thoại ngang */
@media (max-height: 520px) {
  :root { --fs: 15px; }
  body.big { --fs: 17px; }
  #panel.task { top: 8px; bottom: 8px; right: 8px; width: min(500px, 62%); z-index: 9; }
  #panel.title .sheet { width: min(380px, 60%); }
  .logo h1 { font-size: 2.2em; }
  .titlecard .small, .logo p { display: none; }
  .titlecard .foot { gap: 6px; }
  .btn.big { min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  *, .glow { animation: none !important; }
  .glow { box-shadow: 0 0 0 5px #ffd54a; }
  #banner.show { opacity: 1; animation: banner 2.4s steps(1) both !important; }
}

/* ───── Thế giới mở ───── */
#goal { position: fixed; z-index: 4; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: max-content; max-width: min(460px, 46vw); text-align: center; background: rgba(255, 246, 230, .95); border: 3px solid var(--gold); border-radius: 20px; padding: 3px 18px; box-shadow: var(--shadow); font-weight: 700; line-height: 1.3; pointer-events: none; }
#goal .clue b { color: var(--brick); font-size: 1.15em; }
#goal-pips { display: flex; gap: 6px; justify-content: center; }
#goal-pips i { width: 13px; height: 13px; margin-bottom: 3px; border-radius: 50%; border: 2px solid var(--gold); }
#goal-pips i.on { background: var(--gold); }
#arrow { position: fixed; z-index: 3; top: 21%; left: 50%; transform: translateX(-50%); text-align: center; color: #fff; font-weight: 800; text-shadow: 0 2px 6px rgba(40, 20, 0, .9); pointer-events: none; }
#arrow i { display: block; font-style: normal; font-size: 2em; color: #ffd23f; line-height: 1.1; }
#minimap { position: fixed; z-index: 4; right: 12px; bottom: 12px; width: 130px; height: 130px; border-radius: 50%; border: 3px solid #e4c28e; box-shadow: var(--shadow); pointer-events: none; }

#board, #chat { position: fixed; z-index: 4; background: rgba(255, 246, 230, .9); border: 2px solid #e4c28e; border-radius: 16px; box-shadow: var(--shadow); font-size: .78em; overflow: hidden; width: 230px; }
#board .head, #chat .head { width: 100%; border: 0; background: var(--paper2); min-height: 36px; font-weight: 800; text-align: left; padding: 0 12px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
#board { right: 10px; top: calc(66px + env(safe-area-inset-top)); }
#board ol { list-style: none; margin: 0; padding: 4px 10px; }
#board li { display: grid; grid-template-columns: 1.6em 1fr 2.8em; gap: 4px; align-items: center; }
#board li b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#board li i { font-style: normal; text-align: right; font-weight: 800; }
#board li.me { background: #ffe6a8; border-radius: 8px; }
#board .foot { margin: 0; padding: 0 10px 5px; font-size: .85em; color: var(--soft); }
#chat { left: 10px; bottom: 12px; width: 280px; }
#chat-feed { height: 108px; overflow: auto; padding: 4px 10px; }
#chat-feed p { margin: 0 0 2px; line-height: 1.3; }
#chat-feed p.sys { color: var(--soft); font-style: italic; }
#chat-feed p.me b { color: var(--brick); }
#chat-quick { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 8px 8px; }
#chat-quick button { border: 1px solid #d7b98c; background: #fffdf8; border-radius: 99px; padding: 2px 10px; min-height: 32px; }
#board.closed ol, #board.closed .foot, #chat.closed #chat-feed, #chat.closed #chat-quick { display: none; }
#board.closed, #chat.closed { width: auto; }

#prompt { position: fixed; z-index: 5; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--brick); color: #fff; border: 3px solid #fff; border-radius: 99px; min-height: 52px; padding: 4px 22px; font-weight: 700; box-shadow: var(--shadow); white-space: nowrap; }
kbd { font: inherit; font-size: .85em; background: rgba(255, 255, 255, .9); color: var(--ink); border-radius: 6px; padding: 0 7px; }
#helpbar { position: fixed; z-index: 3; left: 50%; bottom: 4px; transform: translateX(-50%); color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .9); font-size: .72em; white-space: nowrap; pointer-events: none; }
#joy { position: fixed; z-index: 5; left: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 124px; height: 124px; border-radius: 50%; background: rgba(255, 246, 230, .45); border: 3px solid #fff; touch-action: none; display: none; }
#joy-knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px; border-radius: 50%; background: var(--brick); border: 3px solid #fff; }
#actions { position: fixed; z-index: 5; right: 14px; bottom: calc(18px + env(safe-area-inset-bottom)); display: none; gap: 10px; align-items: flex-end; }
#actions button { width: 68px; height: 68px; border-radius: 50%; border: 3px solid #fff; background: rgba(168, 70, 42, .82); color: #fff; font-weight: 800; font-size: 1.2em; line-height: 1; touch-action: none; user-select: none; }
#actions small { display: block; font-size: .55em; }
#actions button.ready { background: #e9a93a; animation: glow 1s ease-in-out infinite alternate; }
#dlg-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
#dlg-choices .btn { border-radius: 16px; text-align: left; }
#dlg-choices .asked { opacity: .65; }
.quote { font-size: 1.2em; font-style: italic; color: var(--brick); font-weight: 700; }
.skins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0; }
.skins button { border: 3px solid #ddc196; border-radius: 16px; background: #fffdf8; padding: 6px; font-weight: 700; min-height: 68px; font-size: .88em; }
.skins.two { grid-template-columns: 1fr 1fr; }
.skins.two button { min-height: 52px; }
.skins button i { display: block; height: 24px; border-radius: 10px; margin-bottom: 4px; }
.skins button[aria-pressed="true"] { border-color: var(--brick); box-shadow: 0 0 0 3px #ffd54a; }
input[type="text"] { width: 100%; border: 2px solid #ddc196; border-radius: 14px; background: #fff; padding: 8px 14px; min-height: 48px; }
input.bad { border-color: var(--warn); }
@media (pointer: coarse), (max-width: 760px) {
  #joy { display: block; }
  #actions { display: flex; }
  #helpbar { display: none; }
  #minimap { right: 10px; bottom: auto; top: calc(66px + env(safe-area-inset-top)); width: 92px; height: 92px; }
  #board { right: auto; left: 10px; top: calc(84px + env(safe-area-inset-top)); }
  #chat { left: 10px; bottom: auto; top: calc(128px + env(safe-area-inset-top)); width: min(270px, 70vw); }
  #prompt { bottom: calc(160px + env(safe-area-inset-bottom)); }
  #goal { top: auto; bottom: calc(222px + env(safe-area-inset-bottom)); max-width: 92vw; }
  #arrow { top: 30%; }
}
@media (max-height: 520px) {
  #goal { top: 8px; bottom: auto; max-width: 40vw; font-size: .95em; }
  #prompt { bottom: 14px; }
  #minimap { top: 62px; }
}
#c.dream { filter: blur(2px) hue-rotate(35deg) saturate(1.5) brightness(1.12); animation: dream 3s ease-in-out infinite alternate; }
@keyframes dream { to { filter: blur(5px) hue-rotate(-30deg) saturate(1.8) brightness(1.22); } }

@media (pointer: coarse), (max-width: 760px) { #prompt kbd { display: none; } }

/* Tranh minh hoạ đoạn mở đầu */
#story { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
#story > div { position: absolute; inset: 0; animation: st-in .9s ease both; transition: opacity .9s; }
#story > div.out { opacity: 0; }
#story svg { width: 100%; height: 100%; animation: st-zoom 14s ease-out both; }
#story .st-float { animation: st-float 3.2s ease-in-out infinite alternate; }
#story .st-twinkle { animation: st-twinkle 1.8s ease-in-out infinite alternate; }
#story .st-wind { stroke-dasharray: 520 150; animation: st-wind 2.6s linear infinite; }
#story .st-spin { animation: st-spin 24s linear infinite; }
#story .st-sway { transform-box: fill-box; transform-origin: top center; animation: st-sway 3s ease-in-out infinite alternate; }
@keyframes st-in { from { opacity: 0; } }
@keyframes st-zoom { from { transform: scale(1); } to { transform: scale(1.07); } }
@keyframes st-float { from { transform: translateY(14px); } to { transform: translateY(-20px) rotate(7deg); } }
@keyframes st-twinkle { from { opacity: .15; } to { opacity: 1; } }
@keyframes st-wind { to { stroke-dashoffset: -670; } }
@keyframes st-spin { to { transform: rotate(360deg); } }
@keyframes st-sway { to { transform: skewX(3deg); } }
@media (prefers-reduced-motion: reduce) { #story * { animation: none !important; } }

/* ───── Đua với hoàng hôn ───── */
#race { position: fixed; z-index: 4; top: calc(86px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(360px, 62vw); pointer-events: none; text-align: center; }
#race .sun { position: relative; height: 40px; width: 130px; margin: 0 auto; }
#race .sun i { position: absolute; left: 0; top: 14px; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(#fff3a8, #ffb02e 65%, #ff7a2a); box-shadow: 0 0 12px 4px rgba(255, 170, 50, .75); }
#race .sun b { position: absolute; left: 100%; top: 10px; margin-left: 8px; white-space: nowrap; color: #fff; text-shadow: 0 2px 6px rgba(40, 20, 0, .95); font-size: 1.1em; }
#race .lane { position: relative; height: 34px; margin: 2px 22px 0; border-top: 4px solid rgba(255, 246, 230, .85); border-radius: 4px; }
#race .lane::after { content: '🏁'; position: absolute; right: -22px; top: -16px; }
#race .lane span { position: absolute; top: -15px; transform: translateX(-50%); font-size: 18px; line-height: 1; transition: left .3s linear; }
#race .lane span small { display: block; font-size: 9px; color: #fff; text-shadow: 0 1px 3px #000; white-space: nowrap; margin-top: 1px; }
#race .lane span.me { z-index: 1; font-size: 24px; top: -20px; filter: drop-shadow(0 0 5px #ffd23f); }
#race .lane span.me small { color: #ffe27a; font-weight: 800; font-size: 11px; }
body.rush #vignette { background: radial-gradient(110% 80% at 50% 45%, transparent 45%, rgba(200, 40, 0, .62)); animation: rush .85s ease-in-out infinite; }
body.rush #race .sun b { color: #ffd23f; font-size: 1.5em; animation: rush .85s ease-in-out infinite; }
@keyframes rush { 50% { opacity: .55; } }
.stars { font-size: 2.2em; margin: .1em 0; }
.stars span { filter: grayscale(1) opacity(.3); }
@media (max-width: 760px), (max-height: 520px) { #race { top: calc(104px + env(safe-area-inset-top)); } #race .lane span small { display: none; } }
@media (prefers-reduced-motion: reduce) { body.rush #vignette { animation: none; } }
#race .lane span:not(.me) { opacity: .75; font-size: 15px; }
#race .lane span:not(.me) small { display: none; }

/* che cảnh trong lúc nạp sẵn đồ hoạ */
#loading { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; text-align: center; background: #f6e8cc; color: #7a3b1d; font-weight: 700; padding: 20px; }
