@font-face { font-family: 'Lexend'; src: url('../fonts/lexend-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Lexend'; src: url('../fonts/lexend-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Andika'; src: url('../fonts/andika-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Andika'; src: url('../fonts/andika-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --ink: #1b1f3b;
  --muted: #4a5078;
  --card: #ffffff;
  --go: #16a34a;
  --go-d: #0f7a37;
  --alt: #4361ee;
  --warn: #ff9f1c;
  --word-font: 'Andika', 'Lexend', Verdana, sans-serif;
  --ui-font: 'Lexend', 'Andika', Verdana, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: var(--ui-font); color: var(--ink); letter-spacing: 0.01em;
  background: linear-gradient(#3f8cff 0%, #8ec9ff 38%, #ffe6f5 62%, #ffe6f5 100%);
  touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-text-size-adjust: 100%;
}
button { font-family: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
input, textarea, select { font-family: inherit; font-size: 18px; -webkit-user-select: text; user-select: text; }
.hidden { display: none !important; }

#app { position: fixed; left: 0; right: 0; top: 0; display: flex; flex-direction: column; height: 100%; }
#stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
#c { position: absolute; left: 0; right: 0; top: var(--play-top, 0px); width: 100%; height: calc(100% - var(--play-top, 0px)); display: block; }

#hidden-input { position: fixed; left: 0; top: 0; width: 2px; height: 2px; opacity: 0; font-size: 16px; border: 0; padding: 0; pointer-events: none; caret-color: transparent; }

.hbtn { width: 54px; height: 54px; border-radius: 16px; border: 3px solid #c9d2ff; background: #fff; font-size: 26px; display: grid; place-items: center; flex: 0 0 auto; }
.hbtn:active { transform: scale(0.93); }
.hud-mode { display: flex; flex-direction: column; line-height: 1.1; font-weight: 700; font-size: 20px; }
.hud-mode small { font-weight: 400; font-size: 15px; color: var(--muted); }
.hud-stat { font-size: 22px; background: #fff; border-radius: 14px; padding: 6px 12px; border: 2px solid #e2e6ff; white-space: nowrap; }
.hud-spacer { flex: 1; }

#wordline .done { color: var(--go); }
#wordline .cur { color: var(--ink); border-bottom: 5px solid var(--warn); }
#wordline .todo { color: #7a80a8; }
#wordline .blank { color: #b1b6d6; }
#wordline .rev { color: #b8860b; }
#wordline .sep { color: #7a80a8; }

#cheer { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none;
  font-size: clamp(40px, 8vw, 80px); font-weight: 700; color: #fff; -webkit-text-stroke: 3px #1b1f3b; text-shadow: 0 6px 0 #1b1f3b;
  animation: cheer 1.2s ease-out forwards; white-space: nowrap; }
@keyframes cheer { 0% { transform: translate(-50%, -30%) scale(0.4); opacity: 0; } 20% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(-50%, -80%) scale(1); opacity: 0; } }

#popups { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.popup { position: absolute; font-weight: 700; font-size: 30px; color: #fff; -webkit-text-stroke: 2px #1b1f3b; animation: pop 0.9s ease-out forwards; transform: translate(-50%, -50%); }
@keyframes pop { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -70px; } }

#typehint { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 6; background: #fff; border: 3px solid var(--alt);
  font-size: 24px; font-weight: 700; padding: 12px 22px; border-radius: 18px; animation: bounce 1s infinite alternate; }
@keyframes bounce { to { transform: translate(-50%, -8px); } }

/* ---------- Play top bar (HUD + word + timer). The canvas starts below it, so tiles can never sit under the word. ---------- */
#playtop { position: absolute; left: 0; right: 0; top: 0; z-index: 5; display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top); background: rgba(255,255,255,0.92); box-shadow: 0 3px 14px rgba(0,0,0,0.14); }
#hud { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px 4px; }
#wordrow { display: flex; justify-content: center; padding: 2px 8px 6px; }
#wordline { font-family: var(--word-font); font-weight: 700; font-size: clamp(24px, 4vw, 42px); line-height: 1.25; letter-spacing: 0.08em;
  background: #fff; border: 3px solid #e2e6ff; padding: 0 18px 2px; border-radius: 16px; white-space: nowrap; max-width: 100%; overflow: hidden; min-height: calc(1.25em + 8px); min-width: 4em; text-align: center; }
#wordline.peek { border-color: #4361ee; box-shadow: 0 0 0 4px rgba(67,97,238,0.25); }
#wordline .peeklabel { font-family: var(--ui-font); font-size: 0.5em; letter-spacing: 0; color: #4361ee; vertical-align: middle; margin-right: 10px; }
#timer { height: 7px; background: rgba(27,31,59,0.08); }
#timer.vh { visibility: hidden; }
#timer-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #16a34a, #ffcf3f); transform-origin: left; border-radius: 0 6px 6px 0; }
#timer.low #timer-fill { background: linear-gradient(90deg, #ff9f1c, #ff5d73); }

/* ---------- Screens ---------- */
.screen { position: absolute; inset: 0; z-index: 10; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.screen.overlay { display: grid; place-items: center; background: rgba(27,31,59,0.35); padding: 20px; }
.card { background: var(--card); border-radius: 28px; padding: 26px 30px; max-width: 760px; width: 100%; text-align: center; box-shadow: 0 16px 50px rgba(0,0,0,0.25); animation: zoomIn 0.25s ease-out; }
.card.wide { max-width: 880px; }
.card h2 { margin: 0 0 10px; font-size: 30px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 16px; }
.muted { color: var(--muted); font-size: 17px; }
.big-btn { font-size: 24px; font-weight: 700; padding: 14px 26px; border-radius: 20px; border: none; color: #fff; background: var(--alt); box-shadow: 0 6px 0 #2a3fb0; min-height: 60px; }
.big-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #2a3fb0; }
.big-btn.go { background: var(--go); box-shadow: 0 6px 0 var(--go-d); }
.big-btn.go:active { box-shadow: 0 2px 0 var(--go-d); }
.big-btn.alt { background: #fff; color: var(--ink); border: 3px solid #c9d2ff; box-shadow: 0 6px 0 #c9d2ff; }
.btn { font-size: 18px; padding: 10px 16px; border-radius: 14px; border: 3px solid #c9d2ff; background: #fff; font-weight: 700; }
.btn.danger { border-color: #ffb3bd; color: #b3122b; }

/* Title */
#title { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 7vh; }
.title-card { text-align: center; background: rgba(255,255,255,0.88); padding: 30px 46px; border-radius: 36px; box-shadow: 0 16px 50px rgba(0,0,0,0.2); margin: 0 16px; }
.title-card h1 { margin: 0; font-size: clamp(40px, 7vw, 72px); line-height: 1.05; }
.rainbow { background: linear-gradient(90deg, #ff5d73, #ff9f1c, #e0a800, #2ec4b6, #4361ee, #9b5de5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { font-size: 22px; color: var(--muted); margin: 10px 0 20px; }
.tiny { font-size: 16px; color: var(--muted); }
#btn-start { font-size: 32px; padding: 18px 44px; animation: bounce2 1.2s infinite alternate; }
@keyframes bounce2 { to { transform: scale(1.05); } }

/* Menu */
#menu { background: rgba(255,255,255,0.35); }
.menu-wrap { max-width: 1000px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 18px 30px; }
.menu-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; background: #fff; border-radius: 24px; padding: 14px 20px; box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.menu-head h2 { margin: 0; font-size: 32px; }
.list-name { color: var(--muted); font-size: 18px; }
.menu-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { background: #f3f5ff; border: 2px solid #dfe4ff; border-radius: 999px; padding: 8px 14px; font-size: 19px; }
.wordset { display: flex; align-items: center; gap: 8px; margin: 16px 0 10px; font-size: 20px; font-weight: 700; flex-wrap: wrap; }
.seg { font-size: 19px; font-weight: 700; padding: 10px 18px; border-radius: 999px; border: 3px solid #c9d2ff; background: #fff; }
.seg.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px; }
.mode-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; border: none; border-radius: 22px; padding: 16px; min-height: 150px;
  background: #fff; box-shadow: 0 6px 0 var(--c), 0 10px 22px rgba(0,0,0,0.12); border-top: 10px solid var(--c); }
.mode-card:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--c); }
.mode-card .mi { font-size: 40px; }
.mode-card b { font-size: 23px; }
.mode-card small { font-size: 16px; color: var(--muted); }
.mode-card.locked { filter: grayscale(0.8); opacity: 0.75; }
.mode-card.locked::after { content: '🔒'; position: absolute; right: 12px; top: 10px; font-size: 26px; }
.words-h { margin: 22px 0 8px; font-size: 22px; }
.words-h small { font-weight: 400; color: var(--muted); font-size: 16px; }
.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.wchip { background: #fff; border-radius: 14px; padding: 8px 12px; border: 2px solid #e2e6ff; text-align: left; font-family: var(--word-font); font-size: 22px; font-weight: 700; display: flex; flex-direction: column; }
.wchip .stars { font-size: 15px; letter-spacing: 1px; color: #e0a800; font-family: var(--ui-font); }
.wchip .stars .off { color: #d5d8ea; }
.wchip.need { border-color: #ffc27a; background: #fff8ee; }
.wchip .tag { font-size: 12px; font-family: var(--ui-font); color: #b35c00; font-weight: 700; }
.menu-foot { margin-top: 24px; display: flex; justify-content: center; }
.hold-btn { position: relative; overflow: hidden; touch-action: none; -webkit-touch-callout: none; font-size: 17px; font-weight: 700; padding: 12px 20px; border-radius: 16px; border: 3px solid #c9d2ff; background: #fff; }
.hold-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #c9d2ff; }
.hold-label { position: relative; }

/* Reveal */
.reveal-word { font-family: var(--word-font); font-weight: 700; font-size: clamp(46px, 9vw, 96px); letter-spacing: 0.06em; margin: 8px 0; }
.reveal-word .ok { color: var(--go); }
.reveal-word .rest { color: #d9480f; }

/* Summary */
.sum-stats { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 8px 0 14px; }
.sum-stats .pill { font-size: 20px; }
.sum-words { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; text-align: left; max-height: 40vh; overflow-y: auto; }
.sw { border-radius: 14px; padding: 8px 12px; border: 2px solid #e2e6ff; font-size: 20px; }
.sw b { font-family: var(--word-font); font-size: 24px; }
.sw.good { background: #ecfdf3; border-color: #9fe0b8; }
.sw.ok { background: #fffbea; border-color: #f5d97a; }
.sw.bad { background: #fff1f0; border-color: #ffb3a8; }
.sw small { display: block; color: var(--muted); font-size: 15px; }

/* Test */
#test { background: rgba(255,255,255,0.55); }
.test-wrap { max-width: 820px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) 18px 18px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; }
.test-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.test-count, .test-score { font-size: 24px; font-weight: 700; background: #fff; padding: 8px 16px; border-radius: 16px; }
.test-say { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.test-hint { font-size: 19px; color: var(--muted); }
.t-answer { min-height: 96px; background: #fff; border: 5px solid #4361ee; border-radius: 22px; font-family: var(--word-font); font-weight: 700; font-size: clamp(40px, 7vw, 68px); letter-spacing: 0.06em; display: flex; align-items: center; justify-content: center; padding: 6px 16px; white-space: pre; }
.caret { display: inline-block; width: 4px; height: 0.9em; background: #4361ee; margin-left: 4px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.t-feedback { font-size: 24px; font-weight: 700; padding: 12px; border-radius: 18px; }
.t-feedback.good { background: #ecfdf3; color: #0f6b33; }
.t-feedback.bad { background: #fff1f0; color: #a4161a; }
.t-feedback .w { font-family: var(--word-font); font-size: 40px; display: block; letter-spacing: 0.05em; color: var(--ink); }

/* Parent */
#parent { background: #eef1ff; z-index: 20; }
.parent-wrap { max-width: 900px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) 16px 40px; }
.parent-head { display: flex; justify-content: space-between; align-items: center; }
.parent-head h2 { margin: 0; font-size: 30px; }
.panel { background: #fff; border-radius: 22px; padding: 16px 20px; margin-top: 14px; box-shadow: 0 4px 14px rgba(0,0,0,0.08); display: flex; flex-direction: column; gap: 10px; }
.panel h3 { margin: 0; font-size: 22px; }
.panel label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 16px; }
.panel label.check { flex-direction: row; align-items: center; gap: 10px; }
.panel label.check input { width: 26px; height: 26px; }
.panel input[type=text], .panel input[type=date], .panel textarea, .panel select { border: 2px solid #c9d2ff; border-radius: 12px; padding: 10px; font-weight: 400; color: var(--ink); background: #fff; }
.panel textarea { font-family: var(--word-font); font-size: 20px; resize: vertical; }
.field-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.field-row label { flex: 1; min-width: 220px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-family: var(--word-font); font-weight: 700; font-size: 19px; padding: 6px 12px; border-radius: 999px; border: 2px solid #c9d2ff; background: #f7f8ff; }
.chip.need { background: #fff1dc; border-color: #ff9f1c; }
.chip.need::before { content: '⚠ '; }
.p-msg { font-weight: 700; color: var(--go-d); min-height: 1.2em; }
.p-msg.err { color: #b3122b; }
.file-btn { position: relative; overflow: hidden; display: inline-flex !important; flex-direction: row !important; }
.file-btn input { position: absolute; inset: 0; opacity: 0; font-size: 100px; }

/* Toasts */
#toasts { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1b1f3b; color: #fff; font-weight: 700; font-size: 21px; padding: 12px 20px; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.25); animation: toast 3s ease-out forwards; text-align: center; max-width: 90vw; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-10px); } 10% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- On-screen keyboard ---------- */
#osk { flex: 0 0 auto; background: #2b2f55; padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 7px; z-index: 15; box-shadow: 0 -4px 16px rgba(0,0,0,0.2); }
.krow { display: flex; gap: 6px; justify-content: center; }
.key { flex: 1 1 0; max-width: 96px; height: 64px; border: none; border-radius: 14px; background: #fff; color: var(--ink); font-family: var(--word-font); font-weight: 700; font-size: 32px;
  box-shadow: 0 4px 0 #9aa3d8; display: grid; place-items: center; padding: 0; -webkit-user-select: none; user-select: none; touch-action: none; }
.key.pressed { transform: translateY(3px); box-shadow: 0 1px 0 #9aa3d8; background: #ffe98a; }
.key.wide { flex-grow: 1.6; max-width: 150px; font-size: 22px; font-family: var(--ui-font); background: #dfe4ff; }
.key.space { flex-grow: 5; max-width: 420px; font-size: 20px; font-family: var(--ui-font); }
.key.enter { background: #16a34a; color: #fff; box-shadow: 0 4px 0 #0f7a37; }
#osk:not(.test) .testonly { display: none; }
@media (max-height: 820px) { .key { height: 54px; font-size: 28px; } #osk { gap: 5px; padding-top: 6px; } }
@media (max-width: 700px) { .hud-stat { font-size: 18px; padding: 4px 8px; } .hbtn { width: 48px; height: 48px; font-size: 22px; } .hud-mode { font-size: 17px; } }
@media (max-width: 520px) { #hud { gap: 6px; padding: 6px 8px 2px; } .hbtn { width: 42px; height: 42px; font-size: 19px; border-radius: 12px; } .hud-stat { font-size: 15px; padding: 3px 7px; } .hud-mode { font-size: 15px; } .hud-mode small { font-size: 13px; } .key { font-size: 24px; border-radius: 10px; } .krow { gap: 4px; } }

#bootfail { display: none; position: fixed; left: 20px; right: 20px; top: 20px; background: #fff; border: 4px solid #d00; border-radius: 16px; padding: 16px; z-index: 999; font-size: 18px; }

#t-main { display: flex; flex-direction: column; gap: 12px; }
#t-main.hidden { display: none !important; }

/* Test Day with on-screen keys: the ✓ key does Check/Next, so hide the big buttons and tighten up */
body.osk-on #t-main .row { display: none; }
.t-feedback small { display: block; font-size: 18px; color: var(--muted); font-weight: 400; }
@media (max-height: 820px) {
  .test-wrap { gap: 8px; padding-top: calc(8px + env(safe-area-inset-top)); }
  #t-main { gap: 8px; }
  .test-count, .test-score { font-size: 20px; padding: 6px 12px; }
  .test-say .big-btn { min-height: 50px; font-size: 20px; padding: 8px 18px; }
  .test-hint { font-size: 16px; }
  .t-answer { min-height: 74px; font-size: 46px; }
  .t-feedback { font-size: 20px; padding: 8px; }
  .t-feedback .w { font-size: 34px; }
  #t-choose { padding: 16px; }
}

/* ================= v2: timer, combo meter, rewards ================= */
.ring { width: 30px; height: 30px; transform: rotate(-90deg); vertical-align: middle; }
.rbg { fill: none; stroke: #e2e6ff; stroke-width: 5; }
.rfg { fill: none; stroke: #16a34a; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 94.25; stroke-dashoffset: 94.25; transition: stroke-dashoffset 0.4s; }
.hud-time { display: flex; align-items: center; gap: 5px; }
.hud-time small { font-size: 14px; color: var(--muted); }
.hud-time.done .rfg { stroke: #e0a800; }
.hud-combo { display: flex; align-items: center; gap: 4px; }
.hud-combo .mult { font-size: 15px; font-weight: 700; color: #fff; background: #ff5d73; border-radius: 8px; padding: 1px 6px; }
.hud-combo .mult.x1 { background: #b1b6d6; }
.cmeter { display: inline-block; width: 38px; height: 8px; border-radius: 4px; background: #e2e6ff; overflow: hidden; }
#hud-cfill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff9f1c, #ff5d73); transition: width 0.15s; }
.popup.big { font-size: 34px; color: #ffe066; }
.popup.speed { color: #7cf5ff; }

.players { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; width: 100%; }
.players .lbl { font-size: 16px; color: var(--muted); font-weight: 700; }
.pchip { font-size: 17px; font-weight: 700; padding: 6px 14px; border-radius: 999px; border: 3px solid #c9d2ff; background: #fff; }
.pchip.on { background: #4361ee; border-color: #4361ee; color: #fff; }

.menu-row2 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-top: 14px; }
@media (max-width: 640px) { .menu-row2 { grid-template-columns: 1fr; } }
.goal-card { display: flex; gap: 14px; align-items: center; background: #fff; border-radius: 22px; padding: 12px 16px; box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.goal-card.done { background: #fffbea; }
.goal-ring { position: relative; width: 92px; height: 92px; flex: 0 0 auto; }
.goal-ring svg { width: 92px; height: 92px; transform: rotate(-90deg); }
.goal-ring svg .rbg, .goal-ring svg .rfg { stroke-width: 4; }
.goal-card.done .rfg { stroke: #e0a800; }
.goal-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 38px; }
.goal-ring span.locked { filter: grayscale(1) brightness(0) opacity(0.22); }
.goal-title { font-size: 20px; }
.goal-sub { font-size: 16px; color: var(--muted); }
.week { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.day { width: 40px; text-align: center; border-radius: 10px; border: 2px solid #e2e6ff; font-size: 12px; font-weight: 700; color: var(--muted); padding: 2px 0; }
.day .e { display: block; font-size: 20px; line-height: 1.2; }
.day.met { background: #ecfdf3; border-color: #9fe0b8; color: #0f6b33; }
.day.today { border-color: #4361ee; }
.goal-streak { font-size: 16px; font-weight: 700; margin-top: 4px; }
.challenge-card { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; text-align: left; border: none; border-radius: 22px; padding: 14px 16px;
  background: #fff; box-shadow: 0 6px 0 #e0a800, 0 10px 22px rgba(0,0,0,0.12); border-top: 10px solid #ffcf3f; }
.challenge-card .mi { font-size: 34px; }
.challenge-card b { font-size: 21px; }
.challenge-card small { font-size: 15px; color: var(--muted); }
.challenge-card.done { background: #ecfdf3; }
.menu-buttons { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.menu-buttons .big-btn { font-size: 20px; min-height: 52px; padding: 10px 18px; }

.tabs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.item { position: relative; background: #f7f8ff; border: 2px solid #e2e6ff; border-radius: 18px; padding: 10px 8px; text-align: center; }
.item .ic { font-size: 46px; line-height: 1.1; display: block; }
.item b { display: block; font-size: 15px; }
.item small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.25; }
.item.got { background: #fffbea; border-color: #f5d97a; }
.item.locked .ic { filter: grayscale(1) brightness(0) opacity(0.2); }
.item.today { border-color: #4361ee; border-style: dashed; }
.item .cnt { position: absolute; right: 8px; top: 6px; font-size: 13px; font-weight: 700; background: #ff5d73; color: #fff; border-radius: 999px; padding: 0 7px; }
.themes .item { cursor: pointer; }
.themes .swatch { height: 56px; border-radius: 12px; margin-bottom: 6px; }
.themes .item.on { border-color: #16a34a; border-width: 3px; }
.sboard { margin-bottom: 12px; }
.sboard h4 { margin: 6px 0; font-size: 18px; }
.sboard ol { margin: 0; padding-left: 26px; font-size: 17px; }
.sboard li.me { font-weight: 700; color: #4361ee; }

.toast.award { background: #fff; color: var(--ink); border: 4px solid #ffcf3f; display: flex; align-items: center; gap: 12px; text-align: left; animation: toast 4.2s ease-out forwards; }
.toast.award .aic { font-size: 46px; animation: popin 0.6s cubic-bezier(.2,1.8,.4,1) both; }
.toast.award small { display: block; font-weight: 400; font-size: 16px; color: var(--muted); }
.toast.warn { background: #b3122b; color: #fff; font-size: 22px; border: 4px solid #ffcf3f; animation: toast 5s ease-out forwards; }
@keyframes popin { 0% { transform: scale(0) rotate(-30deg); } 100% { transform: scale(1) rotate(0); } }
.sum-banner { font-size: 22px; font-weight: 700; color: #b35c00; margin: 4px 0 8px; }
#wordline .boss { font-family: var(--ui-font); font-size: 0.5em; letter-spacing: 0; color: #b35c00; vertical-align: middle; margin-right: 10px; }
#wordline.bossw { border-color: #ffb703; box-shadow: 0 0 0 4px rgba(255,183,3,0.3); }
@media (max-width: 920px) { #hud .cmeter, #hud-goal { display: none; } #hud { gap: 6px; } }

/* ---------------- v3: the cats ---------------- */
#catbox { position: absolute; left: 6px; bottom: 4px; z-index: 4; pointer-events: none; display: flex; align-items: flex-end; --cat: clamp(58px, 12vmin, 104px); }
#catbox.hidden { display: none; }
#catbox .cat { width: var(--cat); height: var(--cat); object-fit: contain; filter: drop-shadow(0 3px 4px rgba(30, 20, 70, 0.25)); transform-origin: 50% 100%; }
#catbox .cat + .cat { margin-left: calc(var(--cat) * -0.18); }
#catbox .cat.pop { animation: catpop 0.35s cubic-bezier(.2, 1.6, .4, 1); }
#catbox .cat.hop { animation: cathop 0.32s ease-out; }
#catbox[data-mood="sleep"] .cat { animation: catbreathe 2.6s ease-in-out infinite; }
#catbox[data-mood="yay"] .cat, #catbox[data-mood="cheer"] .cat { animation: catcheer 0.5s ease-in-out 3; }
@keyframes catpop { 0% { transform: scale(0.8); } 100% { transform: scale(1); } }
@keyframes cathop { 0% { transform: translateY(0); } 45% { transform: translateY(-14%) scale(1.04, 0.97); } 100% { transform: translateY(0); } }
@keyframes catcheer { 0%, 100% { transform: rotate(0) translateY(0); } 30% { transform: rotate(-6deg) translateY(-8%); } 70% { transform: rotate(6deg) translateY(-8%); } }
@keyframes catbreathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.02, 0.97); } }
.catsay { position: absolute; left: 4px; bottom: calc(var(--cat) + 6px); max-width: min(300px, 72vw); background: #fff; color: var(--ink); border: 3px solid #2e2a4f; border-radius: 16px; padding: 6px 12px; font-weight: 800; font-size: clamp(14px, 2.2vmin, 19px); line-height: 1.2; box-shadow: 0 4px 0 rgba(46, 42, 79, 0.25); animation: popin 0.3s cubic-bezier(.2, 1.8, .4, 1) both; white-space: normal; }
.catsay::after { content: ''; position: absolute; left: 26px; bottom: -11px; border: 8px solid transparent; border-top-color: #2e2a4f; }
.catsay.hidden { display: none; }
.catsay b { display: block; font-size: clamp(22px, 4vmin, 34px); color: #3b5bdb; letter-spacing: 0.04em; font-family: var(--word-font, inherit); }
.catsay .sg { font-size: 1.25em; margin-right: 4px; }
.luck-art { width: min(260px, 62vw); height: auto; display: block; margin: -8px auto 0; }
.luck-cap { margin: 0 0 6px; font-weight: 800; color: #7a5cff; }
.pause-cat { width: 150px; height: auto; display: block; margin: -6px auto 0; }
.sum-card { position: relative; }
.sum-cats { position: absolute; left: -14px; top: -58px; display: flex; align-items: flex-end; pointer-events: none; }
.sum-cats img { width: 96px; height: 96px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(30, 20, 70, 0.25)); }
.sum-cats img + img { margin-left: -20px; }
.sum-cats img.luck { width: 150px; height: auto; }
.sum-cats .cap { position: absolute; left: 150px; top: 18px; width: 200px; font-weight: 800; font-size: 14px; color: #7a5cff; background: #fff; border-radius: 12px; padding: 4px 8px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
@media (max-width: 700px) { .sum-cats { left: -6px; top: -46px; } .sum-cats img { width: 72px; height: 72px; } .sum-cats img.luck { width: 112px; } .sum-cats .cap { left: 112px; top: 8px; width: 150px; font-size: 12px; } }
.title-cats { display: flex; justify-content: center; gap: 4px; margin: -10px 0 -6px; }
.title-cats img { width: clamp(80px, 16vmin, 140px); height: auto; }
.item img.ic { width: 64px; height: 64px; object-fit: contain; margin: 0 auto 2px; }
.wall.kittens .item img.ic { width: 78px; height: 78px; }
.toast.award .aimg { width: 64px; height: 64px; object-fit: contain; }
.has-new { position: relative; }
.has-new::after { content: ''; position: absolute; top: -5px; right: -5px; width: 18px; height: 18px; border-radius: 50%; background: #ff3b5c; border: 3px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); animation: dotpulse 1.4s ease-in-out infinite; }
@keyframes dotpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
.wall.kittens .item.wide { grid-column: span 2; }
.wall.kittens .item.wide img.ic { width: 100%; max-width: 240px; height: 95px; }
#catbox.ducked .cat, .catsay.ducked { visibility: hidden; }

/* "Let me in!" Hobo at the glass door (JB on the patio) - menu goal card, only before any play today */
.goal-knock { display: none; width: clamp(72px, 14vmin, 120px); height: auto; flex: 0 0 auto; margin-left: auto; border-radius: 12px; transform-origin: 50% 100%; }
.goal-card.knock .goal-knock { display: block; animation: knock 2.4s ease-in-out infinite; }
@keyframes knock { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-4deg) translateY(-2px); } 82% { transform: rotate(3deg); } 88% { transform: rotate(-3deg) translateY(-2px); } 94% { transform: rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .goal-card.knock .goal-knock { animation: none; } }

/* Gizmo, the compound word cat: quick pop-up when a compound word is spelled (never covers tiles: ducks away) */
.gizmo-pop { position: absolute; right: 6px; bottom: 4px; z-index: 4; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 2px; --gz: clamp(56px, 11vmin, 96px); }
.gizmo-pop.hidden { display: none; }
.gizmo-pop.ducked { visibility: hidden; }
.gizmo-pop img { width: var(--gz); height: var(--gz); object-fit: contain; filter: drop-shadow(0 3px 4px rgba(30, 20, 70, .25)); order: 3; }
.gizmo-pop .gp-parts { display: flex; gap: 0; order: 1; }
.gizmo-pop .gp { font: 700 clamp(14px, 2.4vmin, 20px) var(--ui-font, Lexend, sans-serif); color: #2e2a4f; padding: 3px 9px; border: 3px solid #2e2a4f; border-radius: 10px; background: #f3b377; }
.gizmo-pop .gp-b { background: #b9a6ff; }
.gizmo-pop .gp-word { order: 2; font: 700 clamp(15px, 2.6vmin, 22px) var(--ui-font, Lexend, sans-serif); color: #fff; background: #50474a; border: 3px solid #2e2a4f; border-radius: 12px; padding: 2px 10px; opacity: 0; }
.gizmo-pop.go { animation: gzin 1.35s ease-out forwards; }
.gizmo-pop.go .gp-a { animation: gza 1.35s cubic-bezier(.3, 1.4, .5, 1) forwards; }
.gizmo-pop.go .gp-b { animation: gzb 1.35s cubic-bezier(.3, 1.4, .5, 1) forwards; }
.gizmo-pop.go .gp-word { animation: gzword 1.35s ease-out forwards; }
.gizmo-pop.go img { animation: gzcat 1.35s ease-out forwards; }
@keyframes gzin { 0% { opacity: 0; transform: translateY(14px) scale(.8); } 12% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(6px); } }
@keyframes gza { 0% { transform: translateX(-26px) rotate(-8deg); } 40% { transform: translateX(3px); } 50%, 100% { transform: translateX(0); } }
@keyframes gzb { 0% { transform: translateX(26px) rotate(8deg); } 40% { transform: translateX(-3px); } 50%, 100% { transform: translateX(0); } }
@keyframes gzword { 0%, 42% { opacity: 0; transform: scale(.6); } 55% { opacity: 1; transform: scale(1.15); } 65%, 100% { opacity: 1; transform: scale(1); } }
@keyframes gzcat { 0%, 45% { transform: none; } 55% { transform: translateY(-8px) rotate(-4deg); } 65% { transform: translateY(0) rotate(3deg); } 75%, 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .gizmo-pop.go, .gizmo-pop.go * { animation-duration: .01s !important; } .gizmo-pop.go .gp-word { opacity: 1; } }
/* Gizmo's patch progress on the Cat History wall */
.patchwrap { position: relative; display: inline-block; }
.patchwrap .patchgrid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 2px; }
.patchwrap .patchgrid i { background: #e9e7f2; border-radius: 6px; border: 2px dashed #c9c4de; }
.patchwrap .patchgrid i.on { background: transparent; border-color: transparent; }
.wall .item.locked .patchwrap img.ic { filter: none; opacity: 1; }

/* Week planner, photo import review, Word Hunt */
.planner { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.pl-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; background: #f6f5ff; border-radius: 14px; padding: 8px 12px; }
.pl-row.now { background: #e3f8e9; outline: 3px solid #16a34a; }
.pl-row b { font-size: 18px; } .pl-row small { display: block; color: var(--muted); font-size: 14px; }
.pl-tag { font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #dfe4ff; margin-left: 6px; }
.pl-tag.now { background: #16a34a; color: #fff; } .pl-tag.future { background: #ffe9b8; } .pl-tag.past { background: #eee; }
.pl-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.file-btn.go-btn { background: #16a34a; color: #fff; }
.ph-bar { height: 10px; background: #eceaf7; border-radius: 99px; overflow: hidden; margin: 6px 0; } .ph-bar i { display: block; height: 100%; width: 0; background: #4361ee; transition: width .3s; }
.ph-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 12px; margin: 8px 0; }
.ph-row { display: flex; gap: 6px; align-items: center; background: #fff; border: 2px solid #e2e0f0; border-radius: 12px; padding: 4px 6px; }
.ph-row.unsure { border-color: #f4a340; background: #fff7ea; }
.ph-row.off { opacity: .5; }
.ph-row input[type=checkbox] { width: 26px; height: 26px; flex: none; }
.ph-row input[type=text] { flex: 1; min-width: 0; font-size: 20px; padding: 6px 8px; border: none; background: transparent; font-family: var(--word-font); }
.ph-row .x { flex: none; width: 36px; height: 36px; border-radius: 10px; border: none; background: #f1eff9; font-size: 18px; }
label.check { display: flex; gap: 8px; align-items: center; font-size: 17px; margin: 6px 0; } label.check input { width: 24px; height: 24px; }
.hunt-review { display: flex; flex-direction: column; gap: 6px; }
.hr-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: #fff7ea; border: 2px solid #f4a340; border-radius: 12px; padding: 6px 10px; }
.hr-row input { font-size: 20px; font-family: var(--word-font); padding: 4px 8px; border-radius: 8px; border: 2px solid #e2e0f0; width: 12em; }
.hr-row small { color: var(--muted); }
#p-hunt-panel.empty { display: none; }
.hunt-card .mi-img { width: 52px; height: 52px; object-fit: contain; }
.hunt-head { display: flex; gap: 14px; align-items: center; justify-content: center; }
.hunt-gizmo img { width: clamp(80px, 14vmin, 130px); height: clamp(80px, 14vmin, 130px); object-fit: contain; display: block; }
.hunt-gizmo .patchgrid i { background: rgba(233, 231, 242, .92); }
.hunt-gizmo .patchgrid i.on { background: transparent; border-color: transparent; animation: patchon .5s ease-out; }
@keyframes patchon { 0% { background: #ffd166; transform: scale(1.2); } 100% { background: transparent; transform: none; } }
.hunt-say { display: flex; flex-direction: column; text-align: left; font-size: 19px; } .hunt-say b { font-size: 26px; }
.hunt-found .chip.ok { background: #e3f8e9; border-color: #16a34a; } .hunt-found .chip.held { background: #fff1d6; border-color: #f4a340; }
#h-found { justify-content: center; }
body.osk-on #hunt .row { display: none; }
@media (max-height: 820px) { .hunt-say { font-size: 16px; } .hunt-say b { font-size: 21px; } .hunt-wrap { gap: 8px; } }
#hunt { background: rgba(255,255,255,0.6); }
.t-feedback.held { background: #fff1d6; border-color: #f4a340; }

/* ---- School test results & goals (optional) */
.tgoal-card { display: flex; align-items: center; gap: 12px; margin-top: 12px; background: linear-gradient(90deg, #fff8d6, #fff); border: 3px solid #ffd23f; border-radius: 22px; padding: 8px 14px; box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.tgoal-card img { width: 72px; height: 72px; flex: none; }
.tg-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tg-info b { font-size: 22px; } .tg-info small { font-size: 15px; color: var(--muted); }
.tgoal-card .btn { flex: none; min-height: 52px; font-size: 18px; }
@media (max-width: 640px) { .tgoal-card { flex-wrap: wrap; } .tgoal-card img { width: 56px; height: 56px; } .tg-info b { font-size: 19px; } }
.wchip.review { border-style: dashed; border-color: #7a9cff; background: #f1f5ff; }
.wchip .tag.rv { color: #3552c9; }
.tg-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(20, 24, 60, 0.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tg-box { background: #fff; border-radius: 28px; padding: 18px 24px 22px; max-width: 560px; width: 100%; text-align: center; box-shadow: 0 16px 50px rgba(0,0,0,0.3); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tg-box img { width: min(240px, 34vh); height: auto; }
.tg-overlay:not(.met) .tg-box img { width: min(300px, 40vh); }
.tg-box h2 { margin: 0; font-size: 32px; } .tg-box p { margin: 0; font-size: 19px; color: #444; line-height: 1.35; }
.tg-overlay.met .tg-box { border: 5px solid #ffd23f; }
.tg-overlay.met .tg-box img { animation: tgpop .7s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes tgpop { from { transform: scale(.3) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tg-overlay.met .tg-box img { animation: none; } }
.sc-body { display: flex; flex-direction: column; gap: 12px; }
.sc-box { background: #f6f5ff; border-radius: 16px; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.segs { display: flex; flex-wrap: wrap; gap: 8px; }
.segs .seg { min-height: 50px; }
.sc-n input { width: 64px; font-size: 18px; padding: 4px 6px; border-radius: 10px; border: 2px solid #c9d2ff; text-align: center; }
.sc-n.dim input { opacity: .75; }
.sc-cap select { font-size: 18px; padding: 4px 8px; }
.sc-chart { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sc-chart svg { display: block; font-family: var(--ui-font); }
.sc-chart .gl { stroke: #dfe3f5; stroke-width: 1; } .sc-chart .ax { font-size: 11px; fill: #888; }
.sc-chart rect.school { fill: #4361ee; } .sc-chart rect.game { fill: #ff9f1c; }
.sc-chart .goal { stroke: #16a34a; stroke-width: 4; stroke-linecap: round; }
.sc-chart .lbl { font-size: 12px; font-weight: 700; fill: #333; } .sc-chart .wk { font-size: 12px; font-weight: 700; fill: #333; } .sc-chart .wk2 { font-size: 11px; fill: #777; }
.sc-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 14px; color: #555; }
.sc-legend .k { display: inline-block; width: 16px; height: 16px; border-radius: 4px; vertical-align: middle; margin-right: -8px; }
.sc-legend .k.school { background: #4361ee; } .sc-legend .k.game { background: #ff9f1c; } .sc-legend .k.goal { background: #16a34a; height: 5px; }
#sc-missed .chip.rv { background: #f1f5ff; border-color: #7a9cff; } #sc-missed .chip.ok { background: #e3f8e9; border-color: #16a34a; }
#sc-missed .chip small { font-family: var(--ui-font); font-weight: 400; font-size: 13px; color: #555; }
.tr-score span { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 700; }
.tr-score input { width: 84px; font-size: 22px; text-align: center; }
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.tr-w { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 12px; border-radius: 14px; border: 2px solid #d6dcf5; background: #fff; font-family: var(--word-font); font-size: 20px; font-weight: 700; text-align: left; }
.tr-w .bx { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 3px solid #b8c0e0; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; }
.tr-w.miss { background: #fff0f0; border-color: #e5484d; } .tr-w.miss .bx { background: #e5484d; border-color: #e5484d; }
.tr-w.sug { outline: 3px dotted #f4a340; outline-offset: 2px; }
.tgoal-card .btn.go-btn { background: #16a34a; color: #fff; border-color: #16a34a; }
.panel label.sc-cap { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.panel label.sc-cap select { width: auto; min-width: 72px; }

/* ---- Players: big name chip, picker, first-run setup, Grown-ups players panel */
.namechip { display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 18px 6px 8px; border-radius: 999px; border: 3px solid #4361ee; background: #eef1ff; font-size: 22px; font-weight: 800; color: var(--ink); }
.namechip .av { width: 44px; height: 44px; border-radius: 50%; background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 28px; }
.namechip .sw { font-size: 15px; font-weight: 700; color: #4361ee; }
.namechip.test { border-color: #8a5a44; background: #fff4e8; }
.who-box { max-width: 760px; max-height: calc(100vh - 32px); overflow: auto; }
.who-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; width: 100%; margin: 6px 0; }
.who-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 130px; border-radius: 22px; border: 4px solid #d6dcf5; background: #fff; font-size: 26px; font-weight: 800; color: var(--ink); padding: 10px; }
.who-btn .av { font-size: 52px; line-height: 1; }
.who-btn small { font-size: 14px; font-weight: 700; color: var(--muted); }
.who-btn.on { border-color: #4361ee; background: #eef1ff; }
.who-btn.test { min-height: 100px; font-size: 19px; border-style: dashed; background: #fffaf3; }
.who-btn.test .av { font-size: 36px; }
#setup { overflow: auto; }
.setup-wrap { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px 16px; }
.setup-card { background: #fff; border-radius: 28px; padding: 20px 26px; width: min(680px, 100%); box-shadow: 0 10px 34px rgba(0,0,0,0.15); display: flex; flex-direction: column; gap: 12px; }
.setup-card h2 { margin: 0; font-size: 32px; }
.su-cat { width: 110px; height: 110px; align-self: center; }
.su-big { display: flex; flex-direction: column; gap: 8px; font-size: 22px; font-weight: 800; }
.su-big input { font-size: 30px; padding: 12px 16px; border-radius: 16px; border: 3px solid #c9d2ff; font-family: var(--word-font); }
.su-grade { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; } .su-grade select { font-size: 20px; padding: 6px 10px; }
.su-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.su-opt { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 96px; border-radius: 18px; border: 3px solid #c9d2ff; background: #f6f5ff; font-size: 18px; font-weight: 800; cursor: pointer; overflow: hidden; }
.su-opt span { font-size: 36px; }
.su-opt input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
#su-words { font-size: 22px; font-family: var(--word-font); padding: 10px 14px; border-radius: 16px; border: 3px solid #c9d2ff; width: 100%; box-sizing: border-box; }
.setup-card .row { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.su-switch { opacity: .85; }
@media (max-width: 640px) { .su-opts { grid-template-columns: 1fr; } .su-opt { min-height: 64px; flex-direction: row; } .su-opt span { font-size: 28px; } }
.pp-list { display: flex; flex-direction: column; gap: 8px; }
.pp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #f6f5ff; border-radius: 14px; padding: 8px 12px; }
.pp-row .nm { font-size: 20px; font-weight: 800; flex: 1; min-width: 160px; }
.pp-row .nm small { display: block; font-size: 14px; font-weight: 600; color: var(--muted); }
.pp-row.on { outline: 3px solid #4361ee; background: #eef1ff; }
.pp-row select { font-size: 16px; padding: 4px 6px; }
.pp-add .pp-grade { flex: 0 0 auto; min-width: 150px; }
.pp-test { gap: 6px; }
.borrow-note { background: #fff4e8; border: 3px dashed #d99a55; font-size: 17px; }
#parent.borrowed #p-editor, #parent.borrowed #pl-new, #parent.borrowed label:has(#p-photo), #parent.borrowed label:has(#p-photo2), #parent.borrowed #p-hunt-panel { display: none; }

/* ---- Test mode: persistent banner + hold-to-enter tile */
.testbar { flex: 0 0 auto; z-index: 70; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: calc(6px + env(safe-area-inset-top)) 12px 6px; background: repeating-linear-gradient(135deg, #ffd23f 0 18px, #ffc300 18px 36px); color: #3a2a00; font-weight: 800; font-size: 19px; box-shadow: 0 3px 10px rgba(0,0,0,0.25); border-bottom: 3px solid #8a5a00; }
.testbar .btn { min-height: 44px; font-size: 17px; font-weight: 800; background: #fff; border: 3px solid #3a2a00; color: #3a2a00; }
@media (max-width: 640px) { .testbar { font-size: 16px; gap: 8px; } }
body.test-mode .menu-wrap { padding-top: 12px; }
.who-btn.test { position: relative; overflow: hidden; touch-action: none; -webkit-touch-callout: none; user-select: none; }
.who-btn.test > *:not(.hold-fill) { position: relative; }
.who-btn.test .hold-fill { background: #ffd9a8; }
.who-btn.nudge { animation: nudge .45s ease; }
@keyframes nudge { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---- Family account (sync) */
.cloud-ico { position: relative; width: 50px; height: 50px; border-radius: 50%; border: 3px solid #c9d2ff; background: #fff; font-size: 24px; line-height: 1; padding: 0; cursor: pointer; flex: 0 0 auto; }
.cloud-ico i { position: absolute; right: -4px; bottom: -4px; min-width: 22px; height: 22px; border-radius: 11px; font-style: normal; font-size: 14px; font-weight: 800; line-height: 22px; color: #fff; background: #9aa3c7; padding: 0 3px; }
.cloud-ico i:empty { display: none; }
.cloud-ico[data-state="ok"] i { background: #22a45d; }
.cloud-ico[data-state="busy"] i { background: #3f6bff; animation: clspin 1s linear infinite; }
.cloud-ico[data-state="err"] i { background: #f08c00; }
.cloud-ico[data-state="offline"] i { background: #868e96; }
.cloud-ico[data-state="test"] { opacity: .6; }
@keyframes clspin { to { transform: rotate(360deg); } }
.cl-form { align-items: flex-end; }
.cl-form label { flex: 1 1 220px; }
.cl-form input { width: 100%; font-size: 18px; padding: 10px 12px; border-radius: 12px; border: 2px solid #c9d2ff; box-sizing: border-box; }
#cl-who { margin: 4px 0 10px; }
.su-signin { align-self: center; margin-top: 14px; font-size: 16px; }

/* public build: "Try a sample list" in the first-run setup */
.su-sample { align-self: center; background: none; border: 2px dashed #b9c3ff; border-radius: 14px; padding: 8px 14px; font: inherit; font-size: 16px; font-weight: 700; color: #3949ab; cursor: pointer; }
.su-sample:hover, .su-sample:focus-visible { background: #f0f2ff; }
