.game-hub{max-width:900px;margin:12px auto 20px}
.hub-welcome{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:24px;padding:14px 22px;background:#eaf0df;border-radius:28px}
.hub-welcome h1{font-size:clamp(25px,4.5vw,38px);letter-spacing:-1.2px;margin:8px 0;line-height:1.15}
.hub-welcome p{font-size:16px;margin:8px 0;color:var(--muted)}
.hub-welcome>div{min-width:0}
.hub-welcome .hero-art{width:clamp(230px,35vw,340px);max-width:50%;height:auto;aspect-ratio:5/4;flex:none}
.hub-games{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.mini-game-tile{display:flex;flex-direction:column;text-align:left;border:1.5px solid var(--line);background:var(--white);border-radius:25px;padding:16px;min-width:0;min-height:210px;box-shadow:0 5px 0 #e8e7db;gap:9px}
.mini-game-tile:hover{border-color:#9caf8f;transform:translateY(-2px)}
.mini-game-art{height:104px;display:flex;justify-content:center;align-items:center;border-radius:18px;background:#f2efe3;width:100%}
.mini-game-art svg{width:100%;height:100%}
.mini-game-tile strong{font-size:20px;line-height:1.25}
.mini-game-tile>span:last-child{font-size:14px;color:var(--muted)}
.hub-collection{display:flex;align-items:center;gap:16px;width:100%;margin-top:22px;padding:12px 20px;border:1.5px solid #d1ddc7;border-radius:23px;background:#e1ecdc;text-align:left;min-height:96px}
.hub-collection svg{width:112px;height:70px;flex:none}
.hub-collection-copy{display:flex;flex-direction:column;gap:6px;flex:1}
.hub-collection strong{font-size:23px}
.hub-collection span{font-size:15px}
.hub-collection .collection-count{font-size:21px;font-weight:800;white-space:nowrap}
body.numbers-active{height:100dvh;overflow:hidden;overscroll-behavior:none}
body.numbers-active .app-shell{height:100dvh;min-height:0;padding:max(6px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
.numbers-active .site-header{height:56px;min-height:56px;flex:none}
.numbers-active .site-footer{display:none}
.numbers-active #main,.numbers-active #portrait-game{height:100%;min-height:0;min-width:0}
.number-game-root{height:100%;min-height:0;min-width:0}
.number-game{position:relative;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto auto;gap:10px;height:100%;min-height:0;max-width:900px;margin:auto}
.number-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}
.number-heading h1{font-size:25px;margin:4px 0;letter-spacing:-.8px}
.number-heading .eyebrow{font-size:10px}
.number-collection,.collection-back{min-height:44px;border:1px solid #ccd9bf;border-radius:13px;background:#e1ecdc;padding:8px 12px;font-size:13px;font-weight:800}
.number-collection span{display:block;font-size:12px;margin-top:3px}
.number-picker{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
.number-picker button{height:44px;min-width:0;padding:4px 0;border:1px solid var(--line);border-radius:11px;background:var(--white);font-size:19px;font-weight:800}
.number-picker button[aria-pressed=true]{background:var(--green);color:white;border-color:var(--green)}
.number-boards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;min-height:0}
.number-panel{display:flex;flex-direction:column;min-height:0;background:#f0f3e8;border:1px solid #d9e1ce;border-radius:21px;padding:9px}
.free-number-panel{background:#fbf4e9;border-color:#e8dfcc}
.number-panel-heading{display:flex;gap:4px;align-items:center;justify-content:space-between;min-height:28px;font-size:14px;flex:none}
.number-panel-heading span{font-size:21px;font-weight:bold;color:var(--green)}
.number-canvas-wrap{min-height:0;flex:1;position:relative;border-radius:15px;background:var(--white);overflow:hidden}
.number-canvas-wrap canvas{width:100%;height:100%;display:block;touch-action:none}
.number-feedback{font-size:14px;line-height:1.35;min-height:38px;display:flex;align-items:center;color:var(--green);font-weight:700}
.number-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:48px}
.number-tools{display:flex;gap:5px;min-width:0}
.number-tools button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:66px;min-width:72px;border:1px solid var(--line);border-radius:13px;background:var(--white);padding:7px 9px;font-size:13px;font-weight:bold}
.number-tools button[aria-pressed=true]{background:#e1ecdc;border-color:#9cb78d}
.number-next{min-height:46px;border:0;border-radius:14px;background:var(--green);color:white;padding:9px 14px;font-size:15px;font-weight:800;white-space:nowrap}
.number-next:disabled{opacity:.4}
.number-reward{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:14px;border-radius:24px;background:#f8f5ecf0;z-index:3}
.number-reward[hidden]{display:none}
.number-reward-card{width:100%;max-width:350px;padding:20px;border-radius:25px;background:var(--white);box-shadow:0 8px 28px #30493b21;text-align:center}
.number-reward-card .eyebrow{font-size:12px}
.number-reward-card h2{font-size:24px;line-height:1.2;margin:4px 0 20px}
.machine-reward-art{height:150px}
.machine-reward-art svg{height:100%;width:100%}
.number-reward-card p{font-size:14px;line-height:1.4;margin:16px 0}
.number-reward-card .number-next{width:100%}
.machine-stats{display:flex;flex-direction:column;gap:8px}
.machine-stat{display:grid;grid-template-columns:1fr auto;gap:4px 8px;text-align:left;font-size:13px}
.machine-stat progress{grid-column:1/-1;width:100%;height:8px;border:0;border-radius:8px;overflow:hidden;accent-color:#6b9258;background:#e8eee0}
.machine-stat progress::-webkit-progress-bar{background:#e8eee0;border-radius:8px}
.machine-stat progress::-webkit-progress-value{background:#6b9258;border-radius:8px}
.machine-stat progress::-moz-progress-bar{background:#6b9258;border-radius:8px}
.collection-view{max-width:950px;margin:14px auto 30px}
.collection-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}
.collection-heading h1{font-size:29px;letter-spacing:-1px;margin:8px 0}
.collection-heading h1 span{font-size:18px;color:var(--muted)}
.collection-help{font-size:15px;line-height:1.4;margin:16px 0;color:var(--muted)}
.machine-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.machine-card{position:relative;border:1.5px solid var(--line);background:var(--white);border-radius:22px;padding:14px;min-width:0}
.machine-card>svg{width:100%;height:110px}
.machine-card>strong{display:block;font-size:17px;line-height:1.25;min-height:44px;margin:5px 0 12px}
.machine-card[aria-pressed=true]{border-color:#6e9560;background:#edf3e6;outline:2px solid #9bb787;outline-offset:2px}
.machine-comparison{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:20px 0}
.machine-comparison:empty{display:none}
.machine-comparison article{padding:14px;border:1px solid #ccd9bf;border-radius:22px;background:#edf3e5;text-align:center;min-width:0}
.machine-comparison h2{font-size:18px;line-height:1.2;min-height:44px;margin:8px 0}
.machine-comparison .machine-reward-art{height:110px}
.machine-note{font-size:13px;color:var(--muted);line-height:1.5}
.duplicate-count{position:absolute;right:12px;top:12px;border-radius:10px;background:#f6d579;padding:4px 7px;font-weight:bold}
@media(max-width:600px){.hub-welcome{display:grid;grid-template-columns:minmax(0,.82fr) minmax(0,1.18fr);gap:6px;padding:12px 16px;margin-bottom:18px}.hub-welcome .hero-art{width:100%;max-width:none;height:auto}.hub-welcome h1{font-size:clamp(23px,6vw,26px)}.hub-welcome p{font-size:14px}.hub-welcome .eyebrow{font-size:10px}.hub-games{grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}.mini-game-tile{padding:12px;min-height:190px}.mini-game-tile strong{font-size:19px}.mini-game-art{height:88px}.hub-collection{padding:10px 12px;gap:7px}.hub-collection svg{width:85px;height:64px}.hub-collection strong{font-size:21px}.hub-collection span{font-size:13px}.hub-collection .collection-count{font-size:18px}.machine-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.machine-card{padding:12px}.machine-card>strong{font-size:16px}.number-game{gap:7px}.number-heading h1{font-size:23px}.number-panel{padding:7px}.number-panel-heading{font-size:12px}.number-next{padding:8px 10px;font-size:13px}.number-tools button{padding:7px 8px;font-size:12px}}
@media(max-height:600px){.numbers-active .site-header{height:48px;min-height:48px}.number-heading .eyebrow{display:none}.number-heading h1{font-size:21px}.number-game{gap:5px}.number-reward-card{padding:13px}.number-reward-card h2{font-size:21px;margin-bottom:10px}.machine-reward-art{height:105px}.number-feedback{font-size:12px;min-height:30px}}

/* Portrait collectible cards use the approved realistic artwork. */
.machine-art{display:block;width:100%;height:auto;aspect-ratio:3/4;object-fit:contain;border-radius:13px}
.machine-card{padding:0;border:0;border-radius:16px;background:transparent;box-shadow:0 5px 15px #143d2512}
.machine-card>.machine-art{height:auto}
.machine-card>strong.sr-only{margin:0;min-height:0}
.machine-reward-art{height:auto;max-height:none}
.machine-reward-art .machine-art{max-height:calc(100dvh - 260px);width:auto;max-width:100%;margin:auto}
.number-reward-card{padding:10px;max-width:350px;max-height:100%;overflow:auto}
.number-reward-card .eyebrow{margin-bottom:7px}
.number-reward-card .comparison-values{display:none}
.number-reward-card p{margin:9px 0;font-size:13px}
.machine-comparison article{padding:7px;background:#fff9e9;border:1px solid #dedac1}
.machine-comparison .machine-reward-art{height:auto}
.machine-comparison .machine-art{width:100%;height:auto;max-height:none}
.comparison-values{padding:12px 5px 4px}
.collection-gallery{display:inline-flex;align-items:center;min-height:44px;color:var(--green);margin-bottom:8px;font-size:14px;font-weight:bold}
@media(max-width:600px){.machine-card{padding:0}.number-feedback{min-height:44px;font-size:12px}.number-reward-card{padding:8px}}

.number-toolbox{display:flex;flex-direction:column;gap:2px;min-width:0}
.number-tool-icon{display:block;width:30px;height:30px;flex:none;pointer-events:none}
.number-erase-hint{display:flex;align-items:center;justify-content:center;gap:3px;color:#536f55;font-size:11px;line-height:1.2}
.number-erase-gesture{width:36px;height:28px;flex:none}
.number-erase-hand{animation:number-erase-swipe 2.4s ease-in-out infinite}
@keyframes number-erase-swipe{0%,100%{transform:translateX(-3px)}50%{transform:translateX(3px)}}
@media(prefers-reduced-motion:reduce){.number-erase-hand{animation:none}}

/* Keep the number boards usable when a phone turns sideways. */
@media(orientation:landscape) and (max-height:600px){
  .numbers-active .site-header{height:40px;min-height:40px}
  .number-game{grid-template-columns:minmax(0,1fr) 190px;grid-template-rows:auto auto minmax(0,1fr) auto;gap:6px}
  .number-boards{grid-column:1;grid-row:1/-1}
  .number-heading{grid-column:2;grid-row:1;gap:4px}
  .number-heading .eyebrow{display:none}
  .number-heading h1{font-size:18px;margin:0}
  .number-collection{min-height:36px;padding:4px 7px;font-size:11px}
  .number-collection span{font-size:10px;margin-top:1px}
  .number-picker{grid-column:2;grid-row:2}
  .number-picker button{height:30px;font-size:16px}
  .number-feedback{grid-column:2;grid-row:3;min-height:0;font-size:11px}
  .number-actions{grid-column:2;grid-row:4;flex-direction:column;gap:4px;min-height:0}
  .number-toolbox{width:100%;align-items:center}
  .number-tools button{min-height:52px;min-width:80px;padding:4px 7px;font-size:11px}
  .number-tool-icon{width:24px;height:24px}
  .number-erase-gesture{height:22px;width:29px}
  .number-next{width:100%;min-height:36px;padding:5px 9px;font-size:13px}
  .number-panel{padding:6px;border-radius:16px}
  .number-panel-heading{font-size:12px;min-height:24px}
}

body.memory-active{height:100dvh;overflow:hidden;overscroll-behavior:none}
.memory-active .app-shell{height:100dvh;min-height:0;max-width:1200px;padding:max(6px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
.memory-active .site-header{height:44px;min-height:44px;flex:none}
.memory-active .site-footer{display:none}
.memory-active #main,.memory-active #portrait-game,.memory-game-root{height:100%;min-height:0;min-width:0}
.memory-game{display:grid;grid-template-columns:minmax(0,1fr) 190px;gap:16px;height:100%;min-height:0;padding:4px 0}
.memory-grid{display:grid;grid-template-columns:repeat(var(--memory-columns),minmax(0,145px));grid-template-rows:repeat(2,minmax(0,1fr));gap:10px;min-height:0;min-width:0;justify-content:center}
.memory-card{position:relative;display:block;width:100%;height:100%;min-width:0;min-height:0;padding:0;border:2px solid #89a079;border-radius:14px;background:#e8efdf;overflow:hidden;box-shadow:0 3px 0 #ccdac0;transition:transform .18s,background .18s;touch-action:manipulation}
.memory-card:not(:disabled):active{transform:scale(.96)}
.memory-card:focus-visible,.memory-options button:focus-visible,.memory-restart:focus-visible,.memory-return:focus-visible{outline:3px solid #dda95c;outline-offset:2px}
.memory-back{position:absolute;inset:5px;border:1px dashed #b6c5a6;border-radius:9px;display:flex;flex-direction:column;align-items:center;justify-content:center;background:repeating-linear-gradient(45deg,#dbe7cb 0 12px,#e4edd7 12px 24px)}
.memory-back img{width:clamp(32px,10dvh,66px);height:auto;border-radius:50%;background:#f5f3e7;box-shadow:0 2px 6px #49643820}
.memory-back>span{font-size:clamp(22px,6dvh,34px);font-weight:800;color:#61774e;line-height:1.2}
.memory-front{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#fff9e9}
.memory-front .machine-art{width:100%;height:100%;aspect-ratio:auto;object-fit:contain;border-radius:10px}
.memory-check{position:absolute;right:4px;top:4px;width:24px;height:24px;border-radius:50%;background:#5a8051;color:white;display:grid;place-items:center;font-size:18px;font-weight:800;box-shadow:0 1px 5px #304c2a40}
.memory-card [hidden]{display:none}
.memory-card.is-matched{border-color:#54894c;background:#d2e4c5;box-shadow:0 3px 0 #a5c396}
.memory-controls{display:flex;flex-direction:column;justify-content:center;gap:10px;min-height:0}
.memory-controls h1{font-size:27px;letter-spacing:-.8px;line-height:1.15;margin:3px 0}
.memory-controls .eyebrow{font-size:10px}
.memory-options{padding:0;margin:0;border:0;min-width:0}
.memory-options legend{font-size:12px;font-weight:700;margin-bottom:6px}
.memory-options>div{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
.memory-options button{min-height:42px;padding:4px 0;border:1px solid #ccdac0;border-radius:11px;background:var(--white);font-size:19px;font-weight:800}
.memory-options button[aria-pressed=true]{background:var(--green);color:white;border-color:var(--green)}
.memory-options button:disabled{opacity:.35}
.memory-help{font-size:14px;line-height:1.4;margin:0;color:var(--muted)}
.memory-status{font-size:20px;font-weight:800;color:var(--green);min-height:24px}
.memory-won{font-size:17px}
.memory-restart,.memory-return{min-height:42px;border:1px solid #c7d5bc;border-radius:12px;background:#e1ecdc;padding:6px 10px;font-size:13px;font-weight:800;color:var(--green);display:flex;align-items:center;justify-content:center;gap:7px}
.memory-restart>span,.memory-return>span{font-size:23px;line-height:1}
.memory-restart:disabled{opacity:.4}
.memory-return{background:var(--white)}
.memory-collection-note{font-size:11px;line-height:1.35;color:var(--muted);margin:0}
.memory-empty{grid-column:1/-1;grid-row:1/-1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;background:#eaf0df;border-radius:24px;padding:18px;font-size:18px}
.memory-empty img{width:clamp(70px,30dvh,150px);height:auto}
.memory-empty p{max-width:290px;margin:0;line-height:1.4}
@media(max-height:450px){
  .memory-active .site-header{height:40px;min-height:40px}
  .memory-game{grid-template-columns:minmax(0,1fr) 174px;gap:12px}
  .memory-grid{gap:7px}
  .memory-controls{gap:6px}
  .memory-controls h1{font-size:23px}
  .memory-controls .eyebrow{display:none}
  .memory-help{font-size:12px}
  .memory-options button{min-height:36px;font-size:17px}
  .memory-restart,.memory-return{min-height:36px;font-size:12px;padding:4px 8px}
  .memory-status{font-size:17px;min-height:20px}
  .memory-collection-note{font-size:10px}
}
@media(max-height:330px){.memory-help{display:none}.memory-controls{gap:4px}.memory-collection-note{font-size:9px}}

.counting-tile-art img{display:block;width:100%;height:100%;object-fit:contain}
.hub-share{text-align:center;margin:24px auto 0}
.hub-share button{display:inline-flex;align-items:center;justify-content:center;gap:12px;min-height:56px;max-width:100%;padding:14px 22px;border:2px solid #71966a;border-radius:16px;background:#e2efd9;color:#365931;font-size:16px;font-weight:800;box-shadow:0 4px 10px #36593118}.hub-share button:hover{background:#d6e8cb}.hub-share-icon{width:25px;height:25px;flex:none}
.hub-share p{font-size:13px;color:var(--muted);line-height:1.5}
.hub-share p:empty{display:none}
.hub-share input{display:block;margin:12px auto 0;max-width:100%;width:410px;min-height:44px;border:1px solid var(--line);border-radius:10px;background:var(--white);color:var(--ink);padding:10px;font-size:14px}
.hub-share input[hidden]{display:none}

.number-reward-progress{display:block;color:var(--green);font-size:12px;font-weight:800;line-height:1.2;margin-top:3px}
