:root {
  color-scheme: light;
  font-family: ui-rounded, "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
  color: #25465c;
  background: #fff3cf;
  font-synthesis: none;
  --cream: #fff3cf;
  --blue: #4a90e2;
  --gold: #f6c453;
  --ink: #25465c;
  --green: #3e8b62;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button, .shell-button {
  min-width: 48px;
  min-height: 48px;
  border: 2px solid transparent;
  border-radius: 17px;
  font-weight: 800;
  touch-action: manipulation;
}
button:focus-visible, a:focus-visible, canvas:focus-visible {
  outline: 4px solid #214f87;
  outline-offset: 4px;
}
button:disabled { cursor: default; opacity: 0.5; }
[hidden] { display: none !important; }
.game-shell { min-height: 100svh; padding: 0 24px 18px; display: flex; flex-direction: column; }
.shell-topbar {
  width: min(1180px, 100%);
  min-height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.shell-brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 900; letter-spacing: -0.5px; }
.shell-brand-mark { display: grid; place-items: center; color: #a45424; width: 38px; height: 38px; border: 2px solid #e9b240; border-radius: 12px; background: #ffdc78; font-size: 23px; }
.shell-toolbar { display: flex; align-items: center; gap: 10px; }
.shell-icon-button { display: grid; place-items: center; width: 48px; height: 48px; background: #fffaf0; border: 2px solid #e3d8b8; text-decoration: none; color: var(--ink); font-size: 22px; }
.shell-icon-button svg { width: 23px; height: 23px; }
.shell-mode-badge { display: inline-flex; align-items: center; min-height: 40px; gap: 6px; padding: 6px 13px; border-radius: 999px; background: #e4edcf; color: #315d46; font-size: 13px; font-weight: 900; white-space: nowrap; }
.shell-main { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%; gap: 14px; }
.shell-stage { flex: 0 0 auto; position: relative; overflow: hidden; max-width: 1180px; border-radius: 28px; background: #bce5ef; box-shadow: 0 8px 0 #e4d4a5, 0 18px 38px #8b72451a; isolation: isolate; }
.shell-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.shell-canvas:focus-visible { outline-offset: -5px; }
.shell-controls { display: flex; align-items: center; justify-content: center; gap: 16px; width: min(1180px, 100%); min-height: 58px; }
.shell-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #173c4970;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  overflow: hidden;
  overscroll-behavior: contain;
}
.shell-card { width: min(540px, 100%); min-height: 0; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; text-align: center; background: #fffaf0; border: 3px solid #ffffff; border-radius: 28px; padding: 25px 28px; box-shadow: 0 10px 30px #173c492b; }
.shell-card h1, .shell-card h2 { margin: 0 0 12px; font-size: clamp(26px, 3.3vw, 39px); line-height: 1.07; letter-spacing: -1px; }
.shell-eyebrow { display: block; margin: 0 0 9px; font-size: 11px; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; color: #3e795b; }
.shell-start-heading { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 12px; }
.shell-start-heading h1 { max-width: 275px; margin: 0; text-align: left; }
.shell-game-icon { width: 110px; height: 104px; object-fit: contain; }
.shell-hint { margin: 0; text-align: center; font-size: 15px; line-height: 1.4; }
.shell-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.shell-mode { min-height: 67px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; background: #f1eddc; border-color: #e1d9c3; font-size: 16px; }
.shell-mode[aria-pressed="true"] { background: #e0efdc; border-color: #3e8b62; box-shadow: inset 0 0 0 1px #3e8b62; }
.shell-mode small { font-size: 11px; font-weight: 600; opacity: 0.8; }
.shell-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 11px 22px; background: #ece7d8; color: var(--ink); text-decoration: none; line-height: 1.2; }
.shell-primary { min-height: 60px; background: var(--gold); border-color: #dbab3e; box-shadow: 0 4px 0 #d6a234; font-size: 22px; }
.shell-wide { width: 100%; }
.shell-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 18px 0 0; }
.shell-subtle { background: transparent; text-decoration: underline; text-underline-offset: 3px; font-size: 12px; margin-top: 12px; }
.shell-stars { display: flex; justify-content: center; gap: 10px; margin: 0 0 12px; color: #9f6d11; font-size: 44px; line-height: 1.1; }
.shell-result { margin: 12px 0 0; font-weight: 800; font-size: 21px; }
.shell-best { margin: 8px 0 0; font-size: 14px; color: #527080; }
.shell-parent-card { width: min(350px, 100%); }
.shell-parent-card h2 { font-size: 25px; }
.shell-answer { display: block; min-height: 49px; margin: 15px 0; padding: 9px; border: 2px solid #d5dfdf; border-radius: 12px; background: white; font-size: 22px; font-weight: 800; letter-spacing: 6px; }
.shell-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shell-keypad button { background: #e7eef1; font-size: 21px; }
.shell-keypad .shell-enter { background: #d6ebd6; }
.shell-steam { background: #25465c; color: white; margin-top: 10px; font-size: 17px; }
.shell-footer { display: flex; justify-content: center; width: 100%; margin: 16px 0 0; font-size: 11px; font-weight: 700; letter-spacing: 0.3px; color: #607769; }
.shell-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (hover: hover) {
  button:not(:disabled):hover, .shell-button:hover, .shell-icon-button:hover { filter: brightness(0.96); }
}
@media (max-width: 620px) {
  .game-shell { padding: 0 12px 12px; }
  .shell-topbar { min-height: 78px; gap: 8px; flex-wrap: wrap; padding: 10px 0; }
  .shell-brand { font-size: 15px; gap: 7px; }
  .shell-brand-mark { width: 29px; height: 29px; font-size: 18px; border-radius: 9px; }
  .shell-toolbar { gap: 5px; }
  .shell-mode-badge { position: absolute; top: 83px; left: 18px; z-index: 2; font-size: 11px; padding: 4px 10px; min-height: 28px; }
  .shell-stage { border-radius: 19px; }
  .shell-main { gap: 20px; padding-top: 34px; }
  .shell-card { padding: 24px 20px; border-radius: 25px; box-shadow: 0 9px 22px #173c4933; }
  .shell-start-heading { flex-direction: column; gap: 10px; }
  .shell-start-heading h1 { text-align: center; font-size: 34px; }
  .shell-game-icon { height: 122px; width: 150px; }
  .shell-modes { margin: 18px 0; }
  .shell-mode { min-height: 74px; }
  .shell-hint { font-size: 14px; }
  .shell-controls { flex-wrap: wrap; gap: 10px; }
  .shell-parent-card { width: 100%; }
  .shell-footer { margin-top: 16px; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .game-shell { padding: 0 10px 8px; }
  .shell-topbar { min-height: 58px; }
  .shell-card { padding: 15px 22px; }
  .shell-game-icon { width: 75px; height: 65px; }
  .shell-modes { margin: 10px 0; }
  .shell-mode { min-height: 54px; }
  .shell-card h1 { font-size: 28px; }
  .shell-hint { margin: 6px 0 10px; }
  .shell-footer { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
