:root {
  color-scheme: light;
  --ink: #30594f;
  --muted: #758277;
  --cream: #fffdf4;
  --theme-main: #429880;
  --theme-accent: #add8bd;
  --theme-paste: #deeee0;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: #f5f3e9; font-family: ui-rounded, "SF Pro Rounded", system-ui, sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, a { transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease; }
button:focus-visible, a:focus-visible, canvas:focus-visible { outline: 3px solid #275f54; outline-offset: 4px; }
button:active { transform: translateY(2px); }
button:hover { filter: brightness(.98); }
svg { display: block; width: 100%; height: 100%; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.game-shell { width: min(1440px, calc(100% - 64px)); margin: auto; }
.game-shell .topbar { grid-template-columns: 44px minmax(0, 1fr) auto; padding: 19px 0; gap: 17px; }
.game-shell .home-link { width: 42px; height: 42px; border: 1px solid #dedfd3; border-radius: 50%; background: #fffdf7; box-shadow: 0 2px 0 #e6e5d9; color: var(--ink); font-size: 21px; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { display: block; width: 52px; height: 52px; padding: 4px; background: #dce9db; border-radius: 17px; transform: rotate(-7deg); }
.eyebrow { font-size: 9px; letter-spacing: .17em; font-weight: 800; margin: 0 0 5px; }
.brand .eyebrow { text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(21px, 2.2vw, 30px); letter-spacing: -.05em; line-height: 1.15; }
.header-actions { display: flex; align-items: center; gap: 22px; }
.welcome-note { display: flex; align-items: center; gap: 9px; color: #687d70; font-size: 11px; }
.welcome-note i { width: 6px; height: 6px; background: #719779; border-radius: 50%; box-shadow: 0 0 0 4px #e1e8da; }

.brushing-station { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; height: calc(100svh - 133px); min-height: 535px; max-height: 850px; }
.stage { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid #bdd2c5; border-radius: 28px; background: #dcebe0; box-shadow: 0 10px 25px #294d4208; }
.station-heading { flex: 0 0 43px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #c5ded0; border-bottom: 1px solid #b9d3c4; color: #416b5b; font-size: 9px; letter-spacing: .12em; font-weight: 750; }
.station-heading i { font-style: normal; margin-right: 9px; font-size: 18px; color: #997d44; }
.station-heading > span:last-child { font-size: 10px; letter-spacing: 0; font-weight: 500; }
.play-area { position: relative; flex: 1; min-height: 0; }
#brushCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: none; touch-action: none; }
.mirror-note { position: absolute; top: 23px; left: 25px; display: grid; gap: 2px; pointer-events: none; }
.mirror-note .eyebrow { color: #6e8775; font-size: 8px; }
.mirror-note strong { font-size: 15px; letter-spacing: -.035em; }
.station-caption { flex: 0 0 54px; display: flex; align-items: center; gap: 12px; padding: 10px 23px; background: #f6f8ee; border-top: 1px solid #c6d8c7; }
.caption-icon { font-size: 26px; color: #b2894e; }
.station-caption p { flex: 1; margin: 0; font-size: 12px; font-weight: 600; }
.drag-hint { color: #7c8b7a; font-size: 8px; font-weight: 750; letter-spacing: .12em; white-space: nowrap; }
.controls { display: flex; flex-direction: column; gap: 17px; background: var(--cream); padding: 22px; border: 1px solid #e0e2d5; border-radius: 28px; }
.toolkit-heading { display: flex; align-items: center; justify-content: space-between; }
.toolkit-heading .eyebrow { font-size: 8px; color: #80917b; }
.toolkit-heading h2 { font-size: 21px; margin: 0; letter-spacing: -.05em; }
.toolkit-heading > span { font-size: 27px; color: #c5a05d; }
.brush-sets { display: grid; gap: 9px; }
.set-button { display: grid; position: relative; align-items: center; grid-template-columns: 70px 1fr 12px; gap: 8px; width: 100%; height: 61px; padding: 2px 12px 2px 5px; border: 1px solid #e1e5d8; border-radius: 15px; background: #f8f8ee; box-shadow: 0 3px 0 #e8eadd; text-align: left; }
.set-button .set-preview { width: 68px; height: 55px; display: block; }
.set-label { display: grid; gap: 3px; font-size: 12px; font-weight: 750; }
.set-label small { font-size: 8px; font-weight: 500; color: #738275; }
.set-check { width: 7px; height: 7px; border: 1px solid #bac6b6; border-radius: 50%; }
.set-button.is-active { border-color: #6b9c7d; background: #e3eddf; box-shadow: 0 3px 0 #b6cdb5, inset 0 0 0 1px #6b9c7d; }
.set-button.is-active .set-check { background: #4d7d60; border-color: #4d7d60; }
.set-button:hover .set-preview { transform: rotate(-5deg); }
.shine-card { margin-top: auto; padding-top: 15px; border-top: 1px solid #e1e5d7; }
.shine-heading { display: flex; align-items: center; gap: 9px; }
.shine-star { font-size: 25px; color: #b68c48; }
.shine-heading h3 { font-size: 10px; margin: 0 0 4px; }
.shine-heading p { font-size: 9px; color: #788675; margin: 0; }
.shine-heading > strong { margin-left: auto; font-size: 17px; letter-spacing: -.05em; }
.meter-track { height: 7px; border-radius: 8px; background: #e1e8d9; overflow: hidden; margin-top: 12px; }
.meter-fill { height: 100%; width: 0; background: #649371; border-radius: inherit; transition: width 160ms ease; }
.tooth-progress { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.tooth-progress svg { width: 19px; height: 22px; opacity: .3; }
.tooth-progress svg.is-clean { opacity: 1; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.actions button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; border: 1px solid #d5ddd0; border-radius: 13px; font-size: 11px; font-weight: 700; background: #f4f5e9; box-shadow: 0 3px 0 #e1e5d7; }
.actions #rinseButton { background: #e0eff0; border-color: #b9d3d1; box-shadow: 0 3px 0 #c3dcda; }
#rinseButton svg { width: 33px; height: 33px; }
#newSmileButton svg { width: 16px; height: 16px; }
footer { display: flex; justify-content: space-between; padding: 14px 4px; color: #7a8877; font-size: 10px; }
footer > span:first-child { font-style: italic; }
.complete-badge { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); display: grid; grid-template-columns: 25px 1fr; gap: 3px 7px; padding: 10px 17px; background: #fff9e8; border: 1px solid #d9bc78; box-shadow: 0 4px 15px #54745a15; border-radius: 17px; white-space: nowrap; }
.complete-badge[hidden] { display: none; }
.complete-badge > span:first-child { grid-row: span 2; align-self: center; font-size: 27px; color: #c49843; }
.complete-badge strong { font-size: 13px; }
.complete-badge > span:last-child { font-size: 9px; color: #8d855e; }
@media (max-height: 760px) and (min-width: 801px) {
  .game-shell .topbar { padding: 15px 0; }
  .brushing-station { height: calc(100svh - 121px); }
  .controls { padding: 20px; gap: 12px; }
  .set-button { height: 57px; }
  .set-button .set-preview { height: 51px; }
  .brush-sets { gap: 8px; }
}
@media (max-width: 1050px) {
  .game-shell { width: calc(100% - 32px); }
  .brushing-station { grid-template-columns: minmax(0, 1fr) 255px; gap: 15px; }
  .controls { padding: 18px; }
  .welcome-note { display: none; }
  .station-heading > span:last-child, .drag-hint { display: none; }
  .mirror-note { left: 18px; top: 18px; }
}
@media (max-width: 800px) {
  .game-shell { width: calc(100% - 24px); }
  .game-shell .topbar { grid-template-columns: 36px minmax(0, 1fr) auto; padding: 16px 0; gap: 10px; }
  .game-shell .topbar > .header-actions { grid-column: auto; justify-self: end; }
  .game-shell .home-link { width: 35px; height: 35px; }
  .brand { gap: 8px; }
  .brand-mark { width: 40px; height: 40px; border-radius: 13px; }
  h1 { font-size: 21px; }
  .brand .eyebrow { font-size: 8px; }
  .brushing-station { height: auto; max-height: none; display: flex; flex-direction: column; gap: 14px; }
  .stage { border-radius: 22px; }
  .play-area { flex: none; height: clamp(325px, 67vw, 530px); }
  .mirror-note { top: 14px; left: 15px; }
  .mirror-note strong { font-size: 12px; }
  .mirror-note .eyebrow { font-size: 7px; }
  .controls { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; border-radius: 22px; }
  .toolkit-heading, .brush-sets { grid-column: 1 / -1; }
  .brush-sets { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .set-button { height: 100px; grid-template-columns: 1fr; justify-items: center; gap: 0; padding: 4px; text-align: center; }
  .set-label { font-size: 10px; }
  .set-label small { display: none; }
  .set-check { position: absolute; right: 7px; top: 7px; }
  .shine-card { margin: 0; padding: 0; border: 0; }
  .actions { align-content: center; }
}
@media (max-width: 480px) {
  .brand-mark { display: none; }
  h1 { font-size: 19px; }

  .station-heading { padding-inline: 15px; font-size: 8px; }
  .station-caption { padding: 10px 15px; }
  .station-caption p { font-size: 11px; }
  .controls { gap: 15px; padding: 17px; }
  .brush-sets { grid-template-columns: repeat(3, 1fr); }
  .set-button { height: 85px; }
  .shine-card, .actions { grid-column: 1 / -1; }
  footer { gap: 15px; font-size: 8px; }
  .complete-badge { top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
