* { box-sizing: border-box; }
:root { font-family: ui-rounded, "Trebuchet MS", system-ui, sans-serif; color: #34444a; background: #fff8e9; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: none; }
body { margin: 0; height: 100dvh; background: radial-gradient(circle at 10% 0%, #fff1ce, transparent 36%), #fff8e9; }
button { font: inherit; cursor: pointer; touch-action: none; }
.game-shell { display: flex; flex-direction: column; height: 100dvh; max-width: 1040px; margin: auto; padding: 16px clamp(14px, 3vw, 32px); overflow: hidden; }
.topbar { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.home-link { display: inline-block; margin-bottom: 10px; color: #6c9988; font-size: 14px; font-weight: 900; text-decoration: none; }
.home-link:hover { text-decoration: underline; }
.home-link:focus-visible { outline: 4px solid #efaf52; outline-offset: 4px; }
.eyebrow, .score-label { display: block; margin: 0 0 5px; font-size: 11px; font-weight: 900; letter-spacing: .15em; color: #c67c4b; }
h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.08; letter-spacing: -.045em; margin: 0; color: #e86d62; }
h1 span { font-size: .72em; vertical-align: .1em; }
.subtitle { margin: 7px 0 0; font-size: clamp(14px, 2vw, 18px); font-weight: 700; color: #66787b; }
.scoreboard { display: flex; gap: 8px; flex: none; }
.score-card { min-width: 82px; padding: 12px 11px; border: 3px solid #f6dfad; border-radius: 20px; background: #fff; box-shadow: 0 5px 0 #f2dfb7; text-align: center; }
.score-label { color: #a17f6a; font-size: 10px; letter-spacing: .08em; white-space: nowrap; }
.score-card strong { display: block; font-size: 30px; line-height: 1.1; color: #e86d62; }
.play-area { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; width: 100%; border: 5px solid #fff; border-radius: 32px; background: #c9eff5; box-shadow: 0 8px 0 #ead8ae, 0 15px 30px #82704421; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: pointer; }
.boost-badge { position: absolute; top: 15px; left: 15px; padding: 8px 14px; border: 3px solid #fff; border-radius: 18px; background: #ffda7f; color: #715341; font-weight: 900; box-shadow: 0 3px 0 #d9ad67; pointer-events: none; }
.boost-badge[hidden] { display: none; }
.game-message { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; background: #31536678; }
.game-message[hidden] { display: none; }
.message-card { width: min(100%, 370px); padding: 24px; border: 5px solid white; border-radius: 32px; background: #fff9ed; text-align: center; box-shadow: 0 15px 35px #31536642; }
.message-emoji { font-size: 54px; }
.message-card h2 { margin: 4px 0 6px; font-size: 32px; color: #e86d62; }
.message-card p { margin: 0 0 18px; font-size: 17px; font-weight: 700; }
.picker-card { width: min(100%, 480px); padding: 15px 20px; }
.picker-hint { font-size: 13px; color: #8e9c93; }
.character-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.character-option { min-height: 84px; border: 3px solid #eddfc9; border-radius: 18px; background: #fff; color: #485a5b; font-size: 19px; font-weight: 900; }
.character-option span { display: block; font-size: 35px; line-height: 1.1; }
.character-option[aria-pressed="true"] { border-color: #e86d62; background: #fff0db; box-shadow: 0 0 0 2px #e86d62; }
.play-again:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.play-again { border: 0; border-radius: 18px; padding: 14px 26px; background: #f18b6e; box-shadow: 0 5px 0 #cd644e; color: white; font-size: 19px; font-weight: 900; }
.play-again:active { transform: translateY(4px); box-shadow: 0 1px 0 #cd644e; }
.controls { display: flex; flex: none; align-items: center; justify-content: center; gap: clamp(12px, 4vw, 38px); margin-top: 20px; }
.move-button { width: clamp(115px, 24vw, 210px); min-height: 74px; border: 3px solid #fff; border-radius: 23px; background: #7ec5ac; box-shadow: 0 6px 0 #5b9d88; color: #fff; font-size: clamp(17px, 2.5vw, 23px); font-weight: 900; letter-spacing: .03em; user-select: none; -webkit-user-select: none; }
.move-button span { font-size: .8em; }
.move-button:active, .move-button.pressed { transform: translateY(5px); box-shadow: 0 1px 0 #5b9d88; background: #63b496; }
.control-hint { min-width: 175px; margin: 0; text-align: center; font-weight: 800; line-height: 1.5; color: #6b7b79; }
.control-hint span { font-size: 13px; color: #9aaba4; }
.footer-note { flex: none; margin: 16px 0 0; text-align: center; color: #a58f7c; font-size: 13px; font-weight: 700; }
button:focus-visible { outline: 4px solid #efaf52; outline-offset: 4px; }
@media (max-width: 600px) {
  .game-shell { padding-top: 16px; }
  .topbar { align-items: flex-start; flex-wrap: wrap; margin-bottom: 15px; }
  .scoreboard { width: 100%; }
  .eyebrow { font-size: 9px; }
  .subtitle { max-width: 200px; line-height: 1.2; }
  .score-card { flex: 1; min-width: 0; padding: 6px; border-radius: 14px; }
  .score-label { font-size: 9px; }
  .score-card strong { font-size: 23px; }
  .play-area { border-radius: 24px; }
  .picker-card { padding: 15px; }
  .picker-card h2 { font-size: 26px; }
  .picker-card p { margin-bottom: 10px; font-size: 14px; }
  .character-options { gap: 7px; margin-bottom: 12px; }
  .character-option { min-height: 68px; font-size: 15px; }
  .character-option span { font-size: 28px; }
  .controls { gap: 13px; margin-top: 17px; }
  .move-button { flex: 1; min-height: 78px; width: auto; }
  .control-hint { display: none; }
  .footer-note { margin-top: 12px; }
}
@media (max-height: 740px) {
  .game-shell { padding-top: 9px; padding-bottom: 8px; }
  .topbar { margin-bottom: 9px; }
  .home-link { margin-bottom: 4px; }
  .controls { margin-top: 9px; }
  .move-button { min-height: 60px; }
  .footer-note { margin-top: 10px; font-size: 11px; }
  .picker-card { padding: 8px 12px; }
  .picker-card h2 { margin: 0; font-size: 22px; }
  .picker-card p { margin-bottom: 6px; font-size: 12px; line-height: 1.2; }
  .picker-hint { font-size: 11px; }
  .character-options { gap: 4px; margin-bottom: 8px; }
  .character-option { min-height: 44px; font-size: 13px; }
  .character-option span { font-size: 19px; }
  .picker-card .play-again { padding: 9px 17px; font-size: 16px; }
}
