:root {
  color-scheme: light;
  --ink: #193f48;
  --muted: #49666a;
  --cream: #fffdf3;
  --mint: #eaf6dc;
  --berry: #a92e5b;
  --pink: #f7abbe;
  --line: #c9e0d3;
  --strong-line: #b0d3c5;
  font-family: "PingFang SC", "Microsoft YaHei", "Heiti SC", sans-serif;
  color: var(--ink);
  background: #edf7eb;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; background: radial-gradient(ellipse at 9% 0%, #feffe9 0%, transparent 48%), radial-gradient(ellipse at 100% 87%, #d5efed 0%, transparent 53%); }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
button:focus-visible { outline: 3px solid #005772; outline-offset: 3px; }
button:disabled { cursor: default; opacity: .6; }
[hidden] { display: none !important; }
p, h1, h2, h3 { margin: 0; }
.game { width: min(1460px, 100%); margin: auto; padding: 18px clamp(15px, 3vw, 48px) 22px; }
.topbar { display: flex; align-items: center; gap: clamp(10px, 1.5vw, 23px); margin-bottom: 15px; }
.brand { display: flex; gap: 12px; align-items: center; flex: 1; }
.brand-icon { width: 57px; height: 57px; background: #fff3c2; border-radius: 20px 18px 19px 16px; border: 1px solid #e8d899; transform: rotate(-7deg); }
.edition { font-size: 12px; font-weight: 700; color: #527569; letter-spacing: .18em; margin-bottom: 2px; }
h1 { font-size: clamp(24px, 2.55vw, 38px); line-height: 1.18; letter-spacing: .04em; font-weight: 850; white-space: nowrap; }
.inventory, .top-actions { display: flex; align-items: center; gap: 8px; }
.currency { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; font-size: 13px; background: #fffdf5; white-space: nowrap; }
.currency strong { margin-left: 3px; font-size: 16px; font-variant-numeric: tabular-nums; }
.coins { border-color: #eadca7; background: #fff8d5; }
.water { border-color: #c1e0e3; background: #ebfcfa; }
.coin-icon { display: inline-grid; place-items: center; border-radius: 50%; width: 20px; height: 20px; background: #ffd670; color: #8a5406; border: 2px solid #e4ad36; font-size: 13px; }
.drop-icon { display: inline-block; width: 15px; height: 15px; margin: 1px 3px 0; border-radius: 85% 11% 75% 75%; background: #78d6ef; border: 1px solid #3198b6; box-shadow: inset 2px 2px #d9f9ff; transform: rotate(-45deg); vertical-align: middle; }
.icon-button { background: #fcfff3; border: 1px solid var(--line); border-radius: 13px; min-width: 42px; min-height: 42px; font-size: 22px; font-weight: 700; }
.icon-button[aria-pressed="true"] { background: #d8f0d7; }
.start { color: #fff; background: #a92e5b; padding: 10px 16px; min-height: 44px; border: 1px solid #8d204b; border-bottom-width: 3px; border-radius: 14px; font-weight: 800; white-space: nowrap; }
.start span { color: #ffdc84; margin-right: 3px; font-size: .85em; }
.play-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(224px, 21vw, 268px); gap: 14px; align-items: stretch; }
.play-column { min-width: 0; display: flex; flex-direction: column; }
.viewport { position: relative; isolation: isolate; width: 100%; aspect-ratio: 1000 / 650; background: #a8e1e8; border: 1px solid #9fcfd0; border-radius: 25px 25px 14px 14px; overflow: hidden; box-shadow: 0 5px 0 #c8e2d9; }
#world { width: 100%; height: 100%; display: block; touch-action: manipulation; }
#world:focus-visible { outline: 3px solid #005772; outline-offset: -4px; }
.map-title { position: absolute; top: 14px; left: 14px; display: flex; gap: 7px; align-items: center; padding: 7px 10px; border-radius: 12px; background: #fffcf0; color: #274954; font-weight: 800; border: 1px solid #95bac0; box-shadow: 0 2px #427f8d31; }
.map-title small { font-size: 11px; color: #426a70; font-weight: 600; padding-left: 7px; border-left: 1px solid #ceddd1; }
.map-dot { width: 9px; height: 9px; border-radius: 50%; background: #6fba84; border: 1px solid #3d8765; flex: none; }
.pin { position: absolute; z-index: 1; top: var(--y); left: var(--x); transform: translate(-50%, -50%); font-size: clamp(11px, 1.1vw, 14px); font-weight: 800; min-height: 33px; white-space: nowrap; background: #fffcf0; padding: 5px 10px; border: 1px solid #8aaa8b; border-radius: 12px; box-shadow: 0 3px 0 #41695646; }
.pin:hover, .pin:focus-visible { background: #fff0b8; }
.pin-water { border-color: #5da9bb; background: #eefcfc; }
.pin-wheel { border-color: #cd90a9; }
.pin-shop { border-color: #d2b26f; }
.retry { position: absolute; top: 14px; right: 14px; background: #fffcf0; border: 1px solid #95bac0; padding: 7px 10px; min-height: 36px; border-radius: 12px; font-weight: 750; }
.toast, .ride-strip { position: absolute; z-index: 3; bottom: 12px; left: 50%; transform: translateX(-50%); padding: 9px 14px; border: 1px solid #a5c4ac; background: #fffdf2; border-radius: 14px; text-align: center; max-width: calc(100% - 20px); width: max-content; font-weight: 700; font-size: 14px; box-shadow: 0 3px 0 #3767523d; pointer-events: none; }
.ride-strip { bottom: auto; top: 12px; right: 12px; left: auto; transform: none; padding: 5px 6px 5px 10px; pointer-events: auto; }
.ride-strip button { margin-left: 8px; padding: 5px 8px; border-radius: 8px; background: #efd0dd; font-size: 13px; }
.control-strip { display: flex; min-height: 51px; align-items: center; justify-content: space-between; gap: 9px; padding: 7px 9px 2px 3px; }
.control-strip p { color: #3e6465; font-size: 13px; font-weight: 650; }
.control-strip p span { color: #31795d; margin-right: 4px; }
.dpad { display: flex; gap: 4px; flex: none; }
.dpad button { background: #fcfff4; min-width: 32px; min-height: 32px; border: 1px solid var(--strong-line); border-bottom-width: 2px; border-radius: 8px; font-weight: 700; touch-action: manipulation; }
.journal { display: flex; flex-direction: column; gap: 15px; background: #fffdf3; border-radius: 22px; border: 1px solid #d8e2ca; box-shadow: 0 4px 0 #d9e7d8; padding: 14px; margin-bottom: 3px; }
.character { display: flex; gap: 9px; align-items: center; }
.character canvas { width: 65px; height: 65px; background: #e3f2c2; border: 1px solid #c8dfab; border-radius: 18px; flex: none; }
.character h2 { font-size: 21px; line-height: 1.2; }
.character p { color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: 4px; }
.mission { border-radius: 14px; background: #eaf7f7; border: 1px solid #c8e4e5; padding: 12px; }
.mission-heading { display: flex; align-items: center; gap: 6px; }
.mission h3, .speech h3 { font-size: 15px; }
.mission p, .speech p { color: #426065; font-size: 14px; line-height: 1.55; margin-top: 7px; }
.medals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 12px; text-align: center; }
.medal { display: grid; padding: 5px 1px; border-radius: 8px; gap: 3px; font-size: 11px; background: #f9ffff; border: 1px dashed #aacbd0; }
.medal span { font-size: 16px; color: #547777; line-height: 1; }
.medal.earned { background: #fff2be; border: 1px solid #e2c674; }
.medal.earned span { color: #9a5b06; }
.speech { padding: 11px 12px; background: #f9eef1; border: 1px solid #eed4de; border-radius: 13px 13px 13px 2px; }
.speech h3 { color: #992d57; }
.help { align-self: flex-start; margin-top: auto; min-height: 34px; padding: 3px 9px; font-size: 13px; border-radius: 10px; background: #edf4e4; border: 1px solid #d3e2cc; }
.help span { display: inline-grid; place-items: center; margin-right: 3px; color: #fff; background: #477a64; width: 18px; height: 18px; border-radius: 100%; font-weight: 750; }
.dock { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-top: 13px; }
.dock button { display: flex; align-items: center; justify-content: center; gap: 9px; background: var(--cream); border: 1px solid #d3e3d2; border-bottom-width: 3px; border-radius: 13px; min-height: 56px; padding: 7px; font-size: 14px; font-weight: 800; }
.dock small { display: inline-block; color: #406b58; margin-left: 3px; font-size: 11px; font-variant-numeric: tabular-nums; }
.tile { display: grid; place-items: center; position: relative; width: 30px; height: 30px; border-radius: 9px; flex: none; }
.tile.wheel { color: #a63767; background: #faddE8; }
.wheel i { border: 2px solid; border-radius: 100%; width: 19px; height: 19px; background: repeating-conic-gradient(transparent 0 13deg, currentColor 14deg 20deg, transparent 21deg 45deg); }
.tile.train { color: #417b61; background: #deefcf; }
.train i { width: 18px; height: 12px; border: 2px solid; border-radius: 4px 6px 4px 4px; box-shadow: 0 -3px 0 -1px currentColor; }
.train i::after { content: ""; position: absolute; left: 7px; bottom: 7px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 11px 0 currentColor; }
.tile.shop { color: #a35a37; background: #ffedb8; }
.shop i { width: 17px; height: 14px; border: 2px solid; border-top: 5px solid; border-radius: 3px; }
.tile.flower { font: 24px/1 sans-serif; color: #9964af; background: #eee1f4; }
button:hover:not(:disabled) { filter: brightness(.97); }
button:active:not(:disabled) { filter: brightness(.92); }
dialog { width: min(560px, calc(100% - 28px)); max-height: calc(100dvh - 28px); border: 1px solid #98b9ac; box-shadow: 0 10px 0 #2249492b, 0 20px 80px #183b4b4a; border-radius: 23px; padding: 18px; background: #fffdf4; color: var(--ink); }
dialog::backdrop { background: #193f486b; }
.dialog-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.dialog-top h2 { font-size: 25px; }
.dialog-top button { font-size: 24px; }
.dialog-intro { color: var(--muted); line-height: 1.65; font-size: 14px; margin: 0 0 12px; }
.rows { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 11px; padding: 10px; background: #edf6ea; border: 1px solid #ccdeca; border-radius: 12px; }
.row:nth-child(2) { background: #fff3cc; border-color: #ead79c; }
.row:nth-child(3) { background: #f9e8f1; border-color: #e9c6db; }
.row .info { flex: 1; }
.row h3 { font-size: 16px; margin-bottom: 3px; }
.row p { font-size: 13px; line-height: 1.45; color: var(--muted); }
.row button, .primary, .secondary { padding: 8px 11px; min-height: 40px; border-radius: 10px; font-weight: 750; }
.row button, .primary { background: #226959; color: white; border-bottom: 2px solid #164e43; }
.secondary { background: #eaf4e6; border: 1px solid #c4dbca; }
.gallery { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.gallery button { display: grid; place-items: center; gap: 4px; padding: 7px 2px; border-radius: 10px; background: #eaf3e3; border: 1px solid #cfe1c9; font-size: 12px; font-weight: 700; }
.gallery button span { font-size: 25px; line-height: 1; }
.gallery button small { color: var(--muted); font-size: 10px; }
.dialog-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.shop-art { width: 46px; height: 46px; flex: none; }
@media (min-width: 1100px) and (max-height: 840px) {
  .game { width: min(100%, calc((100dvh - 181px) * 1.538 + 390px)); }
}
@media (max-width: 850px) {
  .play-layout { grid-template-columns: minmax(0, 1fr) 194px; gap: 9px; }
  .journal { gap: 9px; padding: 10px; }
  .character canvas { width: 48px; height: 48px; border-radius: 12px; }
  .character h2 { font-size: 17px; }
  .mission, .speech { padding: 8px; }
  .mission p, .speech p { font-size: 13px; }
}
@media (max-width: 690px) {
  .game { padding-top: 12px; }
  .topbar { flex-wrap: wrap; gap: 8px; justify-content: space-between; }
  .brand { flex-basis: 100%; }
  .brand-icon { width: 43px; height: 43px; border-radius: 13px; }
  .edition { font-size: 10px; }
  .inventory, .top-actions { gap: 5px; }
  .currency { gap: 4px; padding: 6px 7px; font-size: 12px; }
  .currency strong { font-size: 14px; }
  .top-actions .icon-button { min-width: 35px; min-height: 38px; }
  .top-actions .start { min-height: 38px; padding: 6px 10px; font-size: 14px; }
  .play-layout { grid-template-columns: minmax(0, 1fr); }
  .viewport { border-radius: 15px 15px 10px 10px; }
  .map-title, .retry { top: 7px; font-size: 12px; }
  .map-title { left: 7px; padding: 4px 6px; }
  .retry { right: 7px; min-height: 28px; padding: 4px 6px; }
  .map-title small { font-size: 9px; }
  .journal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mission { grid-column: 2; grid-row: 1 / span 2; }
  .speech { grid-column: 1; }
  .help { justify-self: start; }
  .control-strip { padding-right: 0; }
  .control-strip p { font-size: 11px; }
  .dpad button { min-width: 34px; min-height: 37px; }
  .dock { gap: 5px; margin-top: 9px; }
  .dock button { flex-direction: column; gap: 4px; min-height: 60px; font-size: 11px; padding: 5px 1px; }
  .dock small { margin: 0; font-size: 9px; }
  .pin { min-height: 27px; padding: 3px 5px; border-radius: 7px; }
  .ride-strip { top: 7px; right: 7px; font-size: 11px; }
  .toast { bottom: 5px; padding: 5px 8px; font-size: 12px; }
}
