:root { color-scheme: light; font-family: ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", sans-serif; color: #493c47; background: #f6e8d5; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #f6e8d5; min-height: 100svh; }
button, a, canvas { -webkit-tap-highlight-color: transparent; }
button { font: inherit; font-weight: 800; cursor: pointer; touch-action: manipulation; border: 0; color: #493c47; }
button:focus-visible, a:focus-visible, canvas:focus-visible { outline: 4px solid #d47c62; outline-offset: 4px; }
.playroom { max-width: 1180px; margin: auto; padding: 14px 28px 12px; display: flex; flex-direction: column; min-height: 100svh; }
.topbar { display: flex; align-items: center; gap: 13px; min-height: 68px; flex-wrap: wrap; }
.title-block { line-height: 1.1; }
.eyebrow { text-transform: uppercase; font-size: 10px; font-weight: 800; letter-spacing: .17em; margin: 0 0 3px; color: #8b6e72; }
h1 { font-size: clamp(24px, 3.2vw, 32px); letter-spacing: -.03em; margin: 0; }
.difficulties { margin-left: auto; display: flex; gap: 7px; }
.pill { height: 40px; padding: 0 15px; border-radius: 999px; font-size: 14px; background: #fffaf0; border: 2px solid #d8bca8; }
.pill[aria-pressed="true"] { background: #d47c62; color: #fff; }
.game-row { display: flex; gap: 24px; align-items: stretch; flex: 1; min-height: 0; padding-bottom: 10px; }
.maze-card { flex: 1; min-width: 0; background: #fffaf0; border: 3px solid #d8bca8; border-radius: 30px; box-shadow: 0 9px 0 #9f79652e; display: flex; flex-direction: column; }
.maze-heading { display: flex; align-items: flex-start; justify-content: space-between; padding: 17px 24px 8px; }
.maze-heading h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.sparkle { font-size: 35px; font-weight: 900; color: #e6a64d; line-height: 1; }
.board-wrap { position: relative; flex: 1; min-height: 230px; margin: 0 20px 17px; }
canvas { display: block; width: 100%; height: 100%; position: absolute; inset: 0; touch-action: none; }
.controls { width: 280px; flex-shrink: 0; background: #ffffff7a; border: 2px solid #fff; border-radius: 26px; padding: 20px; display: flex; flex-direction: column; gap: 15px; align-self: center; }
.hud { display: flex; flex-direction: column; gap: 9px; padding: 5px 0; text-align: center; }
.hud-label { margin: 0; font-size: 10px; font-weight: 800; letter-spacing: .14em; color: #8b6e72; }
.hud-value { margin: 0; font-size: 27px; font-weight: 900; }
.hud-timer { margin: 0; font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; }
.hud-best { margin: 0; font-size: 14px; font-weight: 700; color: #8d6370; }
.hint { margin: 0; text-align: center; font-size: 15px; font-weight: 700; color: #8b6e72; }
.dpad { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dpad-row { display: flex; gap: 8px; }
.dpad-btn { width: 54px; height: 48px; border-radius: 14px; background: #fffaf0; border: 2px solid #d8bca8; font-size: 26px; line-height: 1; }
.primary { width: 100%; height: 48px; border-radius: 15px; background: #ffd675; border: 2px solid #493c47; font-size: 16px; }
.quiet { width: 100%; height: 44px; border-radius: 15px; background: #ffffffb3; border: 2px solid #d8bca8; font-size: 15px; }
button:hover { filter: brightness(1.04); }
button:active { transform: translateY(2px); }
.footer { display: flex; justify-content: space-between; height: 30px; align-items: center; font-size: 11px; font-weight: 900; letter-spacing: .1em; color: #8b6e72; }
.win-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 2; }
.win-card { background: #fffaf0; border: 3px solid #493c47; border-radius: 25px; box-shadow: 0 8px 0 #775c5033; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.win-sparkle { font-size: 42px; font-weight: 900; color: #e6a64d; line-height: 1; }
.win-title { margin: 0; font-size: 31px; font-weight: 900; letter-spacing: -.02em; }
.win-stats { margin: 0; font-size: 16px; font-weight: 700; color: #8b6e72; }
.win-best { margin: 0; font-size: 15px; font-weight: 900; color: #cf695f; }
.win-actions { display: flex; gap: 9px; margin-top: 4px; }
.play-again { padding-inline: 14px; min-width: 125px; min-height: 48px; border-radius: 999px; background: #a9d8b6; font-size: 16px; }
.harder { min-width: 105px; min-height: 48px; border-radius: 999px; background: #d47c62; color: #fff; font-size: 16px; }
.celebration { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.celebration span { position: absolute; font-weight: 900; transform: translate(-50%, -50%); }
@media (max-width: 800px) {
  .playroom { padding: 12px 12px 10px; }
  .topbar { gap: 9px; }
  .difficulties { margin-left: 0; width: 100%; justify-content: flex-end; }
  .eyebrow { font-size: 9px; }
  h1 { font-size: clamp(19px, 5vw, 26px); }
  .game-row { flex-direction: column; }
  .board-wrap:has(.win-overlay:not([hidden])) { min-height: 265px; }
  .board-wrap { min-height: 0; aspect-ratio: 3 / 2; }
  .controls { width: 100%; align-self: stretch; }
  .maze-heading h2 { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { button:active { transform: none; } }
