/* ==========================================================================
   המחברת האנגלית — a school-copybook look: ruled paper, red margin,
   handwriting guide lines, sticker cards and stamp-like trophies.
   ========================================================================== */
:root {
  --paper: #fbf6ea;
  --paper-2: #fffdf7;
  --rule: #d7e4f3;
  --margin: #f0a39b;
  --ink: #1d2a5b;
  --ink-soft: #55608a;
  --red: #e2554b;
  --blue: #4aa3df;
  --yellow: #ffd84d;
  --green: #2bb673;
  --shadow: 0 2px 0 rgba(29, 42, 91, .12), 0 10px 24px -12px rgba(29, 42, 91, .35);
  --radius: 18px;
  --ui: 'Fredoka', 'Varela Round', system-ui, sans-serif;
  --letter: 'Andika', 'Fredoka', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ui);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--paper);
  /* red margin line on the right (Hebrew notebook) + blue ruled lines */
  background-image:
    linear-gradient(to left, transparent 38px, var(--margin) 38px, var(--margin) 40px, transparent 40px),
    repeating-linear-gradient(to bottom, transparent 0 35px, var(--rule) 35px 36px);
  background-attachment: local;
  overflow-x: hidden;
}
#app { max-width: 760px; margin: 0 auto; padding: 0 16px 64px; padding-inline-start: 52px; }
@media (max-width: 520px) {
  body { background-image:
    linear-gradient(to left, transparent 18px, var(--margin) 18px, var(--margin) 20px, transparent 20px),
    repeating-linear-gradient(to bottom, transparent 0 35px, var(--rule) 35px 36px); }
  #app { padding-inline-start: 30px; padding-inline-end: 12px; }
}

h1, h2 { line-height: 1.2; margin: .4em 0 .3em; font-weight: 700; }
h1 { font-size: clamp(1.7rem, 5vw, 2.3rem); }
h1:focus, h2:focus { outline: none; }
h2 { font-size: 1.35rem; }
p { margin: .4em 0; }
a { color: inherit; }
.lead { color: var(--ink-soft); font-size: 1.05rem; }
.hint { color: var(--ink-soft); }
.small { font-size: .85rem; }
.warn { background: #fff1c2; border: 2px dashed #e8b500; padding: .6em .9em; border-radius: 12px; }
.error { color: var(--red); min-height: 1.4em; font-weight: 600; }
.en { font-family: var(--letter); unicode-bidi: isolate; }
.glyph { font-family: var(--letter); font-weight: 700; letter-spacing: .02em; }
.emoji { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; line-height: 1; }
.emoji.huge { font-size: 4.2rem; display: block; margin: .1em auto; }
.he { font-size: 1.1rem; color: var(--ink-soft); }
.row { display: flex; gap: 10px; justify-content: center; align-items: center; margin: 12px 0; }
.row.wrap { flex-wrap: wrap; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 10px; }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-weight: 600; color: var(--ink); text-decoration: none;
  background: #fff; border: 2.5px solid var(--ink); border-radius: 999px;
  padding: .55em 1.2em; min-height: 48px; cursor: pointer;
  box-shadow: 0 4px 0 var(--ink); transition: transform .08s, box-shadow .08s;
  display: inline-flex; align-items: center; justify-content: center; gap: .3em;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--yellow); }
.btn.ghost { background: transparent; box-shadow: none; border-style: dashed; }
.btn[hidden] { display: none; }
.speaker, .icon-btn {
  font-size: 1.35rem; width: 48px; height: 48px; border-radius: 50%;
  border: 2.5px solid var(--ink); background: #fff; cursor: pointer;
  box-shadow: 0 3px 0 var(--ink); vertical-align: middle; margin-inline: 6px;
  display: inline-grid; place-items: center; padding: 0;
}
.speaker { background: #e6f3fc; }
.speaker:active, .icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

.sheet {
  background: var(--paper-2); border: 2.5px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px;
}

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 12px; background: var(--yellow);
  border: 2.5px solid var(--ink); display: grid; place-items: center; font-size: 1.35rem;
  transform: rotate(-6deg); box-shadow: 0 3px 0 var(--ink); flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-size: .78rem; color: var(--ink-soft); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 0; margin-bottom: 6px;
  background: linear-gradient(var(--paper) 80%, transparent);
}
.back {
  font-size: 1.6rem; text-decoration: none; width: 48px; height: 48px; display: grid; place-items: center;
  border: 2.5px solid var(--ink); border-radius: 50%; background: #fff; box-shadow: 0 3px 0 var(--ink);
}
.chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.chip {
  background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: .15em .7em; font-size: .95rem;
  white-space: nowrap; text-decoration: none;
}
.chip.link:hover { background: var(--yellow); }
.icon-btn { width: 40px; height: 40px; font-size: 1.1rem; box-shadow: 0 2px 0 var(--ink); margin: 0; }
.avatar-btn {
  font-size: 1.5rem; width: 46px; height: 46px; border-radius: 50%; border: 2.5px solid var(--ink);
  background: var(--yellow); cursor: pointer; padding: 0;
}
@media (max-width: 520px) {
  .brand-text { display: none; }
  .chip { padding: .1em .5em; font-size: .85rem; }
}

/* ---------- auth ---------- */
.auth { padding-top: 28px; }
.auth-hero { text-align: center; margin-bottom: 18px; }
.auth-hero .brand { justify-content: center; }
.hero-letters { direction: ltr; display: flex; justify-content: center; gap: 10px; margin: 18px 0 6px; }
.hero-letters span {
  font-size: 2.2rem; width: 62px; height: 62px; display: grid; place-items: center;
  background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink);
  animation: drop .55s cubic-bezier(.2, 1.4, .4, 1) both;
}
.hero-letters span:nth-child(odd) { transform: rotate(-5deg); background: #e6f3fc; }
.hero-letters span:nth-child(even) { transform: rotate(4deg); background: #fff3c4; }
.hero-letters span:nth-child(3) { background: #ffe1dc; }
@keyframes drop { from { opacity: 0; translate: 0 -40px; } to { opacity: 1; translate: 0 0; } }
@media (max-width: 420px) { .hero-letters span { width: 50px; height: 50px; font-size: 1.8rem; } }

.auth-box { max-width: 480px; margin: 0 auto; }
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.profile {
  font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #fff; border: 2.5px solid var(--ink); border-radius: 16px; padding: 14px 8px; box-shadow: 0 4px 0 var(--ink);
}
.profile:hover { background: #fff8db; }
.profile .avatar { font-size: 2.4rem; }
.profile .nick { font-weight: 700; }
.profile .meta { font-size: .8rem; color: var(--ink-soft); }
.profile.add { border-style: dashed; box-shadow: none; background: transparent; }
.profile.add .avatar { font-size: 2rem; }
.form { display: flex; flex-direction: column; gap: 6px; }
.form label, .form .label { font-weight: 600; margin-top: 8px; }
.form input {
  font: inherit; font-size: 1.15rem; padding: .6em .8em; border: 2.5px solid var(--ink); border-radius: 12px;
  background: #fff; color: var(--ink); min-height: 50px;
}
.form input.pin { letter-spacing: .6em; text-align: center; font-size: 1.5rem; max-width: 220px; align-self: center; }
.who { display: flex; align-items: center; gap: 12px; justify-content: center; }
.avatar.big { font-size: 3rem; }
.avatar-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.avatar-pick button {
  font-size: 1.8rem; aspect-ratio: 1; border-radius: 12px; border: 2px solid transparent; background: #fff;
  cursor: pointer; padding: 0;
}
.avatar-pick button.on { border-color: var(--ink); background: var(--yellow); transform: scale(1.08) rotate(-4deg); }
.avatar-more { margin-top: 6px; }
.avatar-more > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .4em;
  font-weight: 600; color: var(--ink); padding: .3em .8em; border: 2px dashed var(--ink); border-radius: 999px;
  min-height: 40px; user-select: none;
}
.avatar-more > summary::-webkit-details-marker { display: none; }
.avatar-more > summary::after { content: '▾'; transition: transform .2s; }
.avatar-more[open] > summary::after { transform: rotate(180deg); }
.avatar-more > summary:hover { background: var(--yellow); }
.avatar-more > summary:focus-visible { outline: 3px solid var(--blue, #4aa3df); outline-offset: 2px; }
.avatar-more > .avatar-pick { margin-top: 8px; }
.shop-free > summary { margin: 14px 0 10px; }
@media (prefers-reduced-motion: reduce) { .avatar-more > summary::after { transition: none; } }

/* ---------- home path ---------- */
.home h1 .wave { display: inline-block; animation: wave 1.6s ease-in-out 2; transform-origin: 70% 80%; }
@keyframes wave { 0%, 100% { rotate: 0deg; } 25% { rotate: 18deg; } 50% { rotate: -8deg; } 75% { rotate: 14deg; } }
.path { list-style: none; padding: 0; margin: 20px 0; display: flex; flex-direction: column; gap: 18px; position: relative; }
.path::before { /* dashed trail */
  content: ''; position: absolute; inset-block: 20px; inset-inline-start: 50%; border-inline-start: 3px dashed #b9c6dd; z-index: -1;
}
.unit { width: min(100%, 520px); animation: rise .5s both; animation-delay: calc(var(--i) * 60ms); }
.unit:nth-child(odd) { align-self: flex-start; rotate: -.6deg; }
.unit:nth-child(even) { align-self: flex-end; rotate: .6deg; }
@keyframes rise { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
.unit > a, .unit > div {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 14px 16px; text-decoration: none; background: #fff; border: 2.5px solid var(--ink);
  border-radius: var(--radius); box-shadow: 0 5px 0 var(--ink); position: relative; transition: transform .12s;
}
.unit > a::before { /* washi tape */
  content: ''; position: absolute; top: -10px; inset-inline-end: 22px; width: 64px; height: 20px;
  background: color-mix(in srgb, var(--c) 55%, transparent); rotate: 4deg; border-radius: 2px;
}
.unit > a:hover { transform: translateY(-3px) rotate(-.5deg); }
.unit-icon {
  font-size: 2rem; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 16px;
  background: color-mix(in srgb, var(--c) 22%, #fff); border: 2.5px solid var(--ink);
}
.unit-icon.big { width: 72px; height: 72px; font-size: 2.6rem; }
.unit-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.unit-num { font-size: .78rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }
.unit-title { font-size: 1.2rem; }
.unit-text small { color: var(--ink-soft); }
.unit-progress { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 70px; }
.meter { width: 70px; height: 10px; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; background: #fff; }
.meter i { display: block; height: 100%; background: var(--c); }
.unit.locked > div { background: #f1efe8; box-shadow: 0 3px 0 #b9b4a6; border-color: #9a978f; color: #77746c; }
.unit.locked .unit-icon { filter: grayscale(1); background: #e6e3db; border-color: #9a978f; }
.unit.current > a { box-shadow: 0 5px 0 var(--ink), 0 0 0 5px color-mix(in srgb, var(--c) 35%, transparent); }
.unit.current > a::after {
  content: 'ממשיכים מכאן'; position: absolute; bottom: -14px; inset-inline-start: 18px; font-size: .75rem; font-weight: 700;
  background: var(--ink); color: #fff; padding: 1px 10px; border-radius: 999px;
}
@media (max-width: 520px) {
  .unit { width: 100%; }
  .unit > a, .unit > div { gap: 10px; padding: 12px; }
  .unit-icon { width: 48px; height: 48px; font-size: 1.6rem; }
  .meter { width: 54px; } .unit-progress { min-width: 54px; }
}

/* ---------- unit page ---------- */
.unit-head { display: flex; align-items: center; gap: 14px; margin: 8px 0 18px; }
.unit-head h1 { margin: 0; }
.unit-head .lead { margin: 0; }
.unit-total { margin-inline-start: auto; font-weight: 700; background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: .2em .8em; white-space: nowrap; }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.game-card {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 4px 12px; align-items: center;
  text-decoration: none; background: #fff; border: 2.5px solid var(--ink); border-radius: var(--radius);
  padding: 14px; box-shadow: 0 5px 0 var(--ink); transition: transform .12s;
  animation: rise .45s both; animation-delay: calc(var(--k) * 70ms);
}
.game-card:hover { transform: translateY(-3px); background: color-mix(in srgb, var(--c) 10%, #fff); }
.game-icon { grid-row: span 2; font-size: 2rem; width: 54px; height: 54px; display: grid; place-items: center;
  border-radius: 50%; background: color-mix(in srgb, var(--c) 22%, #fff); border: 2px solid var(--ink); }
.game-text { display: flex; flex-direction: column; line-height: 1.25; }
.game-text small { color: var(--ink-soft); font-size: .85rem; }
.badge { justify-self: start; background: var(--ink); color: #fff; font-size: .75rem; padding: 1px 10px; border-radius: 999px; }
.stars { letter-spacing: 2px; font-size: 1.2rem; }
.stars .on { color: #f2b705; text-shadow: 0 1px 0 #a87d00; }
.stars .off { color: #d9d4c4; }
.stars.big { font-size: 3.2rem; display: block; text-align: center; letter-spacing: 8px; }
.stars.animate .on { display: inline-block; animation: stamp .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.stars.animate .on:nth-child(2) { animation-delay: .25s; }
.stars.animate .on:nth-child(3) { animation-delay: .5s; }
@keyframes stamp { from { scale: 2.4; opacity: 0; rotate: -30deg; } to { scale: 1; opacity: 1; rotate: 0deg; } }

/* ---------- play ---------- */
.play-title { font-size: 1.4rem; display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.play-title small { font-size: .95rem; color: var(--ink-soft); font-weight: 500; }
.hud { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.hud-track { flex: 1; height: 16px; border: 2.5px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; }
.hud-fill { height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--c), var(--c) 10px, color-mix(in srgb, var(--c) 75%, #fff) 10px 20px); transition: width .4s; }
.hud-score { font-weight: 700; white-space: nowrap; }
.hud-streak { font-weight: 700; color: var(--red); min-width: 2.5em; }
.hud-streak.pop { animation: pop .4s; }
@keyframes pop { 50% { scale: 1.5; } }

.stage { text-align: center; }
.prompt {
  background: var(--paper-2); border: 2.5px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.ask { font-weight: 600; font-size: 1.15rem; margin: 0; }
.card-pop { animation: cardpop .35s cubic-bezier(.2, 1.3, .5, 1); }
@keyframes cardpop { from { scale: .92; opacity: 0; } to { scale: 1; opacity: 1; } }
.word { font-size: 1.6rem; font-weight: 700; }
.word.big { font-size: 2.6rem; }
.word.reading { font-size: 3.6rem; letter-spacing: .08em; padding: 0 .3em; background: linear-gradient(transparent 62%, #fff3a8 62% 88%, transparent 88%); }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.option {
  font: inherit; color: var(--ink); cursor: pointer; min-height: 76px; padding: 12px 8px;
  background: #fff; border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: 0 5px 0 var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: transform .08s, background .2s;
}
.option:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.option .glyph { font-size: 3rem; line-height: 1; }
.option .emoji { font-size: 2.8rem; }
.option.pictures { min-height: 110px; }
.option.right { background: #c9f0da; border-color: #157a48; box-shadow: 0 5px 0 #157a48; animation: pop .35s; }
.option.wrong { background: #fdd6d2; border-color: #a8352c; box-shadow: 0 5px 0 #a8352c; animation: shake .4s; }
@keyframes shake { 20%, 60% { translate: -6px 0; } 40%, 80% { translate: 6px 0; } }

/* learn */
.detail { margin: 6px 0 14px; }
.letter-card, .word-card {
  background: var(--paper-2); border: 2.5px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; display: grid; gap: 10px; justify-items: center; text-align: center;
}
.letter-card { grid-template-columns: auto 1fr; text-align: start; justify-items: stretch; align-items: center; }
@media (max-width: 520px) { .letter-card { grid-template-columns: 1fr; text-align: center; } }
.copy-lines { /* handwriting guide: blue top, dashed blue middle, red baseline */
  direction: ltr; padding: 0 18px; line-height: 1;
  background:
    linear-gradient(var(--blue), var(--blue)) 0 14% / 100% 2px no-repeat,
    repeating-linear-gradient(to right, var(--blue) 0 8px, transparent 8px 16px) 0 45% / 100% 2px no-repeat,
    linear-gradient(var(--red), var(--red)) 0 80% / 100% 2px no-repeat;
}
.copy-lines.big .glyph { font-size: 7rem; display: block; padding: 0 0 .22em; }
.facts { display: flex; flex-direction: column; gap: 8px; }
.fact { background: #fff; border-radius: 12px; border: 2px solid var(--rule); padding: 6px 10px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.fact.example .emoji { font-size: 1.8rem; }
.learn-count { font-weight: 600; text-align: center; margin: 4px 0 10px; }
.learn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; margin-bottom: 18px; }
.learn-grid.letters { direction: ltr; }
.learn-grid:not(.letters) { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.tile {
  font: inherit; color: var(--ink); cursor: pointer; aspect-ratio: 1; background: #fff; border: 2.5px solid var(--ink);
  border-radius: 14px; box-shadow: 0 4px 0 var(--ink); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; position: relative; padding: 4px;
}
.learn-grid:not(.letters) .tile { aspect-ratio: auto; min-height: 104px; }
.tile .glyph { font-size: 1.9rem; }
.tile .emoji { font-size: 2.2rem; }
.tile-word { font-size: 1rem; font-weight: 700; }
.tile.seen::after { content: '✓'; position: absolute; top: 3px; inset-inline-end: 6px; font-size: .8rem; color: var(--green); font-weight: 700; }
.tile.active { background: var(--yellow); transform: rotate(-3deg) scale(1.04); }
#app .btn.primary[hidden] { display: none; }
.learn-grid + .btn { display: flex; margin: 0 auto; }
.spelled { display: flex; gap: 8px; }
.letter-chip {
  font-family: var(--letter); font-weight: 700; font-size: 2.6rem; width: 64px; height: 72px; cursor: pointer;
  background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink); color: var(--ink);
}
.letter-chip:nth-child(1) { background: #ffe1dc; } .letter-chip:nth-child(2) { background: #fff3c4; } .letter-chip:nth-child(3) { background: #dff1fb; }

/* memory */
.memory-info { display: flex; justify-content: space-between; font-weight: 600; margin: 6px 0 10px; }
.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; perspective: 800px; }
@media (max-width: 420px) { .memory-grid { grid-template-columns: repeat(3, 1fr); } }
.mcard {
  aspect-ratio: 3 / 4; position: relative; border: 0; background: none; cursor: pointer; padding: 0;
  transform-style: preserve-3d; transition: transform .4s; font: inherit; color: var(--ink);
}
.mcard > span { position: absolute; inset: 0; display: grid; place-items: center; backface-visibility: hidden;
  border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink); }
.mback { background: repeating-linear-gradient(45deg, #dff1fb 0 8px, #fff 8px 16px); font-size: 2rem; font-weight: 700; color: var(--blue); }
.mface { background: #fff; transform: rotateY(180deg); font-size: 2.8rem; }
.mcard.low .mface { background: #fff7d6; }
.mcard.flipped { transform: rotateY(180deg); }
.mcard.matched .mface { background: #c9f0da; border-color: #157a48; box-shadow: 0 4px 0 #157a48; }
.mcard.matched { animation: pop .4s .3s; }

/* trace */
.trace-stage { position: relative; width: min(100%, 340px); aspect-ratio: 1; margin: 10px auto; }
.trace-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 18px; }
.trace-guide { background: #fff; border: 2.5px solid var(--ink); box-shadow: var(--shadow); }
.trace-ink { touch-action: none; cursor: crosshair; }
.glyph.inline { font-size: 1.8rem; margin: 0 .2em; vertical-align: middle; }
.feedback { min-height: 1.6em; font-weight: 700; margin: 4px 0; }
.feedback.good { color: #157a48; } .feedback.bad { color: var(--red); }

/* spell */
.slots, .tiles { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.slot, .ltile {
  font-family: var(--letter); font-weight: 700; font-size: 2rem; width: 54px; height: 62px; padding: 0;
  border-radius: 12px; cursor: pointer; color: var(--ink);
}
.slot { background: transparent; border: 0; border-bottom: 4px solid var(--red); border-radius: 0; }
.slot.filled { background: #fff; border: 2.5px solid var(--ink); border-radius: 12px; animation: pop .25s; }
.slot.right { background: #c9f0da; border-color: #157a48; }
.slot.wrong { background: #fdd6d2; border-color: #a8352c; animation: shake .4s; }
.slot.reveal { background: #fff3c4; }
.ltile { background: #fff; border: 2.5px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.ltile:disabled { opacity: .2; box-shadow: none; cursor: default; }
@media (max-width: 420px) { .slot, .ltile { width: 44px; height: 54px; font-size: 1.7rem; } }

/* say */
.mic {
  font-size: 2.4rem; width: 96px; height: 96px; border-radius: 50%; border: 3px solid var(--ink); background: #ffe1dc;
  box-shadow: 0 5px 0 var(--ink); cursor: pointer; margin: 12px auto; display: grid; place-items: center;
}
.mic.rec { animation: pulse 1s infinite; background: var(--red); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(226, 85, 75, .6); } 100% { box-shadow: 0 0 0 22px rgba(226, 85, 75, 0); } }

/* ---------- results overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(29, 42, 91, .45); backdrop-filter: blur(3px); animation: fade .25s;
}
@keyframes fade { from { opacity: 0; } }
.result { width: min(100%, 440px); text-align: center; animation: cardpop .4s cubic-bezier(.2, 1.3, .5, 1); max-height: 92vh; overflow: auto; }
.result h2 { font-size: 2rem; margin-top: 0; }
.points-won { font-size: 1.4rem; font-weight: 700; color: #a87d00; }
.record, .unlock { font-weight: 700; background: #fff3c4; border-radius: 10px; padding: 4px 8px; }
.unlock { background: #c9f0da; }
.new-trophies { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin: 8px 0; }
.trophy-mini { background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px; display: inline-flex; gap: 4px; }

/* ---------- trophies ---------- */
.trophy-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.trophy {
  background: #fff; border: 2.5px solid var(--ink); border-radius: 50% 50% 18px 18px / 30% 30% 18px 18px;
  padding: 16px 10px 12px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: 0 4px 0 var(--ink);
}
.trophy:nth-child(3n+1) { rotate: -1.5deg; } .trophy:nth-child(3n+2) { rotate: 1deg; }
.trophy-icon { font-size: 2.6rem; width: 70px; height: 70px; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff8cf, var(--yellow)); border: 3px double var(--ink); }
.trophy small { color: var(--ink-soft); font-size: .8rem; line-height: 1.3; }
.trophy time { font-size: .75rem; color: var(--green); font-weight: 600; }
.trophy.locked { background: #f4f2ec; border-color: #a9a59a; box-shadow: 0 3px 0 #c8c3b5; color: #7a776f; }
.trophy.locked .trophy-icon { background: #e6e3db; border-color: #a9a59a; filter: grayscale(1); }
.stats, .board { margin-top: 22px; }
.stats dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 0; }
.stats dl div { background: #fff; border: 2px solid var(--rule); border-radius: 12px; padding: 8px 12px; }
.stats dt { font-size: .85rem; color: var(--ink-soft); }
.stats dd { margin: 0; font-size: 1.5rem; font-weight: 700; }
.board ol { padding: 0; margin: 0; list-style: none; counter-reset: r; }
.board li { display: grid; grid-template-columns: 2em auto 1fr auto auto; gap: 10px; align-items: center; padding: 6px 8px; border-bottom: 1px dashed var(--rule); counter-increment: r; }
.board li::before { content: counter(r); font-weight: 700; color: var(--ink-soft); }
.board li.me { background: #fff3c4; border-radius: 10px; }

/* ---------- toasts & confetti ---------- */
.toasts { position: fixed; bottom: 16px; inset-inline: 16px; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: #fff; border-radius: 16px; padding: 10px 18px; box-shadow: var(--shadow); animation: up .4s cubic-bezier(.2, 1.3, .5, 1); transition: opacity .4s, translate .4s; }
.toast.out { opacity: 0; translate: 0 20px; }
@keyframes up { from { translate: 0 30px; opacity: 0; } }
.toast-trophy { display: flex; align-items: center; gap: 12px; }
.big-emoji { font-size: 2.2rem; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { top: 105vh; rotate: 720deg; translate: 40px 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- cloud login bits ---------- */
.loading { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink-soft); }
.loading .brand-mark { animation: wobble 1s ease-in-out infinite; }
@keyframes wobble { 50% { rotate: 6deg; scale: 1.08; } }
.form input.password { text-align: left; letter-spacing: .15em; }
.form input[hidden] { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.linkish { font: inherit; color: var(--blue); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.btn:disabled { opacity: .6; cursor: wait; }

/* ============================================================
   smart practice: daily review card + per-unit mastery grid (js/review.js)
   ========================================================================== */
.review-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  margin: 16px 0 6px; padding: 12px 16px; text-decoration: none; color: inherit;
  background: #f4eefc; border: 2.5px solid var(--ink); border-radius: var(--radius);
  box-shadow: 0 5px 0 var(--ink); transition: transform .12s; max-width: 520px;
}
a.review-card:hover { transform: translateY(-3px); }
.review-card.done { background: #eaf7ef; box-shadow: 0 3px 0 #9fbfab; border-color: #6f9a80; }
.review-icon { font-size: 1.8rem; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
.review-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.review-text b { font-size: 1.15rem; }
.review-text small { color: var(--ink-soft); }
.review-card .small-btn { padding: .3em .9em; font-size: .95rem; min-height: 38px; }
@media (max-width: 520px) {
  .review-card { grid-template-columns: auto 1fr; padding: 10px 12px; }
  .review-card .small-btn { display: none; }
  .review-icon { width: 44px; height: 44px; font-size: 1.5rem; }
}

.mastery { margin-top: 22px; }
.mastery-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mastery-head h2 { margin: 0; font-size: 1.15rem; }
.mastery-count { font-weight: 700; background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: .05em .7em; font-size: .9rem; }
.mastery-grid { display: grid; gap: 6px; margin: 12px 0 8px; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
.mastery-grid.words, .mastery-grid.reading { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.mitem {
  font: inherit; color: var(--ink); cursor: pointer; border-radius: 10px; padding: 4px 2px; min-height: 40px;
  display: flex; align-items: center; justify-content: center; gap: 4px; line-height: 1.1;
  background: #fff; border: 2px dashed #b9c6dd;
}
.mitem .glyph { font-size: 1.05rem; }
.mitem .memoji { font-size: 1.1rem; }
.mitem .mword { font-size: .8rem; text-align: center; overflow-wrap: anywhere; }
.mitem.practicing { background: #fff3c4; border: 2px solid #e8b500; }
.mitem.mastered { background: #d8f3e3; border: 2px solid var(--green); }
.mitem:active { transform: scale(.95); }
.mastery-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-soft); }
.legend { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; background: #fff; border: 2px dashed #b9c6dd; }
.legend.practicing i { background: #fff3c4; border: 2px solid #e8b500; }
.legend.mastered i { background: #d8f3e3; border: 2px solid var(--green); }

   course content (course-content session): letter sounds, order game, sentences
   ========================================================================== */
.sound-btn { min-height: 40px; padding: .2em .9em; font-size: .95rem; box-shadow: 0 3px 0 var(--ink); margin-inline-start: 6px; background: #e6f3fc; }
.letter-chip.blending { background: var(--yellow) !important; transform: translateY(-6px) scale(1.08); transition: transform .12s; }
.word-card .row { flex-wrap: wrap; }

/* order game */
.seq-row { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.seq-cell {
  min-width: 64px; height: 72px; padding: 0 10px; display: inline-grid; place-items: center;
  background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink);
}
.seq-cell .glyph { font-size: 2.6rem; }
.seq-cell.is-word { height: 60px; }
.seq-cell .word { font-size: 1.3rem; }
.seq-cell.blank { background: #fff3c4; border-style: dashed; box-shadow: none; font-size: 2rem; font-weight: 700; color: var(--red); }
.seq-arrow { font-size: 2rem; font-weight: 700; color: var(--ink-soft); }
.option .word { overflow-wrap: anywhere; }
.slot.wide, .ltile.wide { width: auto; min-width: 120px; padding: 0 12px; font-size: 1.3rem; }
.sort-slots .slot:not(.filled) { background: rgba(255, 255, 255, .6); }
@media (max-width: 420px) {
  .seq-cell { min-width: 52px; height: 62px; }
  .seq-cell .glyph { font-size: 2.1rem; }
  .seq-cell.is-word { height: 52px; padding: 0 6px; }
  .seq-cell .word { font-size: 1.05rem; }
  .slot.wide, .ltile.wide { min-width: 0; width: calc(50% - 8px); font-size: 1.15rem; }
}

/* sentences */
.learn-grid.sentences { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.learn-grid.sentences .tile-word { font-size: .95rem; line-height: 1.25; }
.sentence-words { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.word-chip {
  font-family: var(--letter); font-weight: 700; font-size: 1.7rem; min-height: 56px; padding: 0 14px; cursor: pointer;
  background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink); color: var(--ink);
}
.word-chip:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.sentence-text { font-size: 2.3rem; font-weight: 700; padding: 0 .3em; line-height: 1.3;
  background: linear-gradient(transparent 62%, #fff3a8 62% 88%, transparent 88%); }
.option.pictures .emoji { font-size: 2.6rem; letter-spacing: .05em; }
.build-slots, .build-tiles { display: flex; justify-content: center; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.wslot, .wtile {
  font-family: var(--letter); font-weight: 700; font-size: 1.6rem; min-width: 78px; min-height: 58px; padding: 0 14px;
  border-radius: 12px; cursor: pointer; color: var(--ink);
}
.wslot { background: transparent; border: 0; border-bottom: 4px solid var(--red); border-radius: 0; }
.wslot.filled { background: #fff; border: 2.5px solid var(--ink); border-radius: 12px; animation: pop .25s; }
.wslot.right { background: #c9f0da; border-color: #157a48; }
.wslot.wrong { background: #fdd6d2; border-color: #a8352c; animation: shake .4s; }
.wslot.reveal { background: #fff3c4; }
.build-dot { font-family: var(--letter); font-size: 2.2rem; font-weight: 700; line-height: 1; }
.wtile { background: #fff; border: 2.5px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.wtile:disabled { opacity: .2; box-shadow: none; cursor: default; }
@media (max-width: 420px) {
  .sentence-text { font-size: 1.8rem; }
  .wslot, .wtile { font-size: 1.35rem; min-width: 64px; min-height: 52px; padding: 0 10px; }
  .word-chip { font-size: 1.4rem; }
}
/* multi-emoji pictures ("🧒🐶") read left-to-right like the English sentence */
.learn-grid.sentences .emoji, .sentence-card .emoji, .option.pictures .emoji, .prompt .emoji { direction: ltr; unicode-bidi: isolate; }

   Engagement: daily goal ring, streak week, coins & shop, notebook themes
   (js/rewards.js, js/shop.js)
   ========================================================================== */

/* ---------- notebook themes: custom-property overrides ---------- */
[data-theme="classic"] { --paper: #fbf6ea; --paper-2: #fffdf7; --rule: #d7e4f3; --margin: #f0a39b; --ink: #1d2a5b; --ink-soft: #55608a; --yellow: #ffd84d; }
[data-theme="mint"]   { --paper: #eaf7ef; --paper-2: #f7fdf9; --rule: #c6e6d2; --margin: #7fcc9e; --ink: #12483a; --ink-soft: #4b7a6a; --yellow: #a8ecc4; }
[data-theme="sky"]    { --paper: #ecf3fd; --paper-2: #f8fbff; --rule: #c9d9f3; --margin: #8eb1ea; --ink: #182e6b; --ink-soft: #52639a; --yellow: #a9dcff; }
[data-theme="bubble"] { --paper: #fdeef4; --paper-2: #fff8fb; --rule: #f3cfdf; --margin: #e78bb3; --ink: #4b1c50; --ink-soft: #81577f; --yellow: #ffc4de; }
[data-theme="kraft"]  { --paper: #f2e4ca; --paper-2: #fbf4e6; --rule: #e0cba3; --margin: #d4835a; --ink: #3c2a18; --ink-soft: #725a40; --yellow: #ffbf5e; }

/* ---------- goal ring (conic progress around an emoji / count) ---------- */
.goal-ring {
  --pct: 0; --size: 30px; width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  display: inline-grid; place-items: center; padding: 3px; vertical-align: middle;
  background: conic-gradient(var(--green) calc(var(--pct) * 1%), color-mix(in srgb, var(--ink) 14%, transparent) 0);
}
.goal-ring-in { width: 100%; height: 100%; border-radius: 50%; background: #fff; display: grid; place-items: center; line-height: 1; }
.goal-ring.mini { --size: 26px; padding: 2.5px; font-size: .8rem; }
.goal-ring.big { --size: 92px; padding: 9px; font-size: 1.5rem; }
.goal-ring.big .goal-ring-in { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ink) 18%, transparent); }
.goal-ring.big b { font-size: 2rem; }
.goal-ring.full { background: conic-gradient(var(--green) 100%, transparent 0); }
.goal-ring.big.full .goal-ring-in { font-size: 2.6rem; animation: pop .6s; }
.streak-chip { display: inline-flex; align-items: center; gap: 4px; padding-inline-start: .2em; }
.coin-chip b { color: #a87d00; }

/* ---------- home: today card ---------- */
.today-card { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; margin: 14px 0 6px; position: relative; }
.today-card::before { /* washi tape */
  content: ''; position: absolute; top: -10px; inset-inline-start: 26px; width: 70px; height: 20px; rotate: -4deg;
  background: color-mix(in srgb, var(--green) 45%, transparent); border-radius: 2px;
}
.today-card.met { background: color-mix(in srgb, var(--green) 9%, var(--paper-2)); }
.today-ring { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.today-ring small { color: var(--ink-soft); font-size: .8rem; }
.today-main h2 { margin: 0 0 .1em; font-size: 1.2rem; }
.today-msg { margin: 0 0 8px; color: var(--ink-soft); font-size: .95rem; }
.today-card.met .today-msg { color: #157a48; font-weight: 600; }
.week { list-style: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; padding: 0; margin: 0; }
.wday { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .78rem; color: var(--ink-soft); }
.wday-mark {
  width: 100%; max-width: 40px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px;
  border: 2px dashed color-mix(in srgb, var(--ink) 25%, transparent); font-weight: 700; font-size: .9rem; color: var(--ink);
}
.wday.done .wday-mark { background: var(--green); border: 2px solid #157a48; color: #fff; font-size: 1.1rem; }
.wday.frozen .wday-mark { background: #dff1fb; border: 2px solid var(--blue); }
.wday.missed .wday-mark { color: color-mix(in srgb, var(--ink) 35%, transparent); }
.wday.today .wday-mark { border: 2.5px solid var(--ink); background: #fff; font-size: .78rem; }
.wday.is-today .wday-name { color: var(--ink); font-weight: 700; }
.today-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.streak-big { font-weight: 600; }
.streak-big b { font-size: 1.3rem; }
.freeze-held { color: var(--blue); font-weight: 600; }
.shop-btn { min-height: 40px; padding: .3em 1em; font-size: .95rem; box-shadow: 0 3px 0 var(--ink); }
@media (max-width: 520px) {
  .today-card { grid-template-columns: 1fr; justify-items: stretch; text-align: center; padding: 14px; }
  .today-ring { flex-direction: row; justify-content: center; }
  .goal-ring.big { --size: 76px; padding: 8px; }
  .today-foot { justify-content: center; }
}

/* ---------- results overlay: coins & goal ---------- */
.coins-won { font-size: 1.15rem; font-weight: 700; color: #a87d00; margin: 0; }
.goal-done { font-weight: 700; background: #c9f0da; border-radius: 10px; padding: 4px 8px; animation: pop .5s .4s both; }
.goal-left { color: var(--ink-soft); font-size: .95rem; }

/* ---------- shop ---------- */
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.shop-head h1 { margin-bottom: 0; }
.wallet {
  font-size: 1.5rem; font-weight: 700; background: #fff; border: 2.5px solid var(--ink); border-radius: 999px;
  padding: .15em .9em; box-shadow: 0 3px 0 var(--ink); white-space: nowrap;
}
.wallet b { color: #a87d00; }
.shop section { margin-top: 18px; }
.shop-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.shop-grid.themes { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.shop-item {
  background: #fff; border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 var(--ink);
  padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
}
.shop-item.on { background: color-mix(in srgb, var(--yellow) 45%, #fff); }
.shop-avatar { font-size: 2.4rem; line-height: 1.1; }
.shop-item:not(.owned) .shop-avatar { filter: saturate(.85); }
.shop-item .btn { min-height: 38px; padding: .2em .8em; font-size: .9rem; box-shadow: 0 3px 0 var(--ink); width: 100%; }
.shop-item .btn:disabled { cursor: not-allowed; opacity: .45; }
.shop-item .btn.sure { animation: pop .3s; }
.shop-item .btn.equip { background: transparent; border-style: dashed; box-shadow: none; }
.tag { font-size: .85rem; font-weight: 700; color: #157a48; min-height: 38px; display: grid; place-items: center; }
.theme-swatch {
  width: 100%; height: 72px; border-radius: 10px; border: 2px solid var(--ink); position: relative; overflow: hidden;
  background-color: var(--paper);
  background-image:
    linear-gradient(to left, transparent 14px, var(--margin) 14px, var(--margin) 16px, transparent 16px),
    repeating-linear-gradient(to bottom, transparent 0 15px, var(--rule) 15px 16px);
}
.sw-mark {
  position: absolute; top: 10px; inset-inline-end: 26px; width: 34px; height: 34px; border-radius: 8px; rotate: -6deg;
  background: var(--yellow); border: 2px solid var(--ink); color: var(--ink); display: grid; place-items: center;
  font-family: var(--letter); font-weight: 700; font-size: .95rem;
}
.sw-btn { position: absolute; bottom: 10px; inset-inline-start: 12px; width: 44px; height: 14px; border-radius: 999px; background: var(--ink); }
.freeze-item { flex-direction: row; text-align: start; max-width: 520px; gap: 12px; padding: 12px 14px; }
.freeze-item .freeze-text { flex: 1; display: flex; flex-direction: column; }
.freeze-item .freeze-text small { color: var(--ink-soft); }
.freeze-item .btn, .freeze-item .tag { width: auto; flex: none; min-width: 90px; }
@media (max-width: 520px) {
  .shop-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .shop-grid .shop-item { padding: 8px 4px; border-radius: 14px; }
  .shop-grid .shop-avatar { font-size: 2rem; }
  .shop-grid .btn, .shop-grid .tag { font-size: .8rem; padding: .2em .3em; min-height: 34px; }
  .shop-grid.themes { grid-template-columns: 1fr 1fr; }
  .wallet { font-size: 1.2rem; }
}
/* the top bar holds one more chip (coins) – keep it on one line on phones */
@media (max-width: 420px) {
  .topbar { gap: 4px; }
  .chips { gap: 4px; }
  .chip { padding: .1em .38em; font-size: .8rem; }
  .goal-ring.mini { --size: 22px; padding: 2px; font-size: .7rem; }
  .icon-btn { width: 34px; height: 34px; font-size: 1rem; }
  .avatar-btn { width: 40px; height: 40px; font-size: 1.3rem; }
  .brand-mark, .back { width: 40px; height: 40px; }
  .brand-mark { font-size: 1.15rem; }
}
@media (max-width: 370px) { .topbar .brand { display: none; } .chips { gap: 3px; } .chip { padding: .1em .3em; } }
=======
/* ---------- parents & groups (report.js / parent.js / groups.js) ---------- */
.trophy-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 18px; }
.rp-head, .gr-head, .gr-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.rp-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.rp-section, .gr-section { margin-top: 18px; }
.rp-section h2, .gr-section h2 { font-size: 1.3rem; }
.rp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.rp-tile { background: #fff; border: 2px solid var(--rule); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; }
.rp-tile-label { font-size: .85rem; color: var(--ink-soft); }
.rp-tile b { font-size: 1.45rem; }
.rp-tile small { font-size: .75rem; color: var(--ink-soft); }
.rp-chart { margin: 0; }
.rp-chart figcaption { color: var(--ink-soft); font-size: .9rem; margin-bottom: 6px; }
.rp-bars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(14, 1fr); gap: 2px; align-items: end; }
.rp-bar { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; border-radius: 6px; }
.rp-bar-val { font-size: .75rem; font-weight: 700; min-height: 1.1em; }
.rp-bar-col { width: 100%; height: 120px; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1.5px solid var(--ink-soft); }
.rp-bar-col i { display: block; width: min(70%, 26px); background: var(--blue); border-radius: 4px 4px 0 0; }
.rp-bar.only-played .rp-bar-col i { background: repeating-linear-gradient(45deg, var(--blue) 0 3px, transparent 3px 6px); border: 1px solid var(--blue); }
.rp-bar-day { font-size: .68rem; color: var(--ink-soft); text-align: center; line-height: 1.15; }
.rp-bar-min { font-size: .7rem; font-weight: 600; min-height: 1.1em; direction: ltr; }
.rp-bar:hover .rp-bar-col i, .rp-bar:focus-visible .rp-bar-col i { background: var(--ink); }
.rp-scroll { overflow-x: auto; }
.rp-table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.rp-table th, .rp-table td { padding: 6px 8px; border-bottom: 1px dashed var(--rule); text-align: start; white-space: nowrap; }
.rp-table thead th { font-size: .8rem; color: var(--ink-soft); border-bottom: 2px solid var(--rule); }
.rp-table tbody th { font-weight: 600; }
.rp-table tr.st-none { color: #8a8678; }
.rp-table tr.st-excellent td:nth-child(3) { color: var(--green); font-weight: 700; }
.rp-meter { display: inline-block; vertical-align: middle; width: 60px; height: 8px; border-radius: 4px; background: #e8e4d8; overflow: hidden; }
.rp-meter i { display: block; height: 100%; background: var(--yellow); border-inline-end: 1px solid #c9a400; }
.rp-weak { margin: 0; padding-inline-start: 1.2em; }
.rp-weak li { margin: 4px 0; }
.rp-weak small, .gr-card small { color: var(--ink-soft); }
.rp-foot { margin-top: 14px; }

.gr-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 18px; }
.gr-form h2 { font-size: 1.25rem; margin-top: 0; }
.gr-code-input { font-family: var(--letter); font-size: 1.5rem; letter-spacing: .3em; text-align: center; text-transform: uppercase; }
.gr-preview p { margin: 6px 0; }
.gr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gr-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid var(--rule); border-radius: 14px; background: #fff; color: inherit; text-decoration: none; }
.gr-card:hover { border-color: var(--blue); }
.gr-card > span:last-child { display: flex; flex-direction: column; }
.gr-icon { font-size: 1.8rem; }
.gr-code-box { display: flex; flex-direction: column; align-items: center; background: #fff3c4; border: 2px dashed #e8b500; border-radius: 14px; padding: 8px 16px; }
.gr-code-box > span { font-size: .8rem; color: var(--ink-soft); }
.gr-code { font-family: var(--letter); font-size: 1.8rem; letter-spacing: .2em; }
.gr-table th.gr-unit, .gr-table td.gr-unit { text-align: center; padding-inline: 4px; }
.gr-table th.gr-unit small { display: block; font-size: .65rem; }
.gr-table td.zero { color: #b9b4a6; }
.gr-actions { justify-content: flex-start; margin-top: 18px; }
.danger { color: var(--red); }
.btn.danger { border-color: var(--red); }

@media (max-width: 520px) {
  .rp-bar-month { display: none; }
  .rp-bar-col { height: 90px; }
}
@media print {
  body { background: #fff; font-size: 12pt; }
  #app { max-width: none; padding: 0; }
  .topbar, .no-print, .toasts, .confetti { display: none !important; }
  .sheet { box-shadow: none; border: 1px solid #999; break-inside: avoid; padding: 10px 14px; }
  .rp-section, .gr-section, .board { margin-top: 10px; }
  .rp-bar-col i, .rp-meter i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rp-scroll { overflow: visible; }
  .rp-table th, .rp-table td { white-space: normal; }
  a { color: inherit; text-decoration: none; }
}
=======
/* ---------- polish & safety ---------- */
a.avatar-btn { display: grid; place-items: center; text-decoration: none; flex: none; }
.account { display: grid; gap: 18px; }
.account .who { margin-top: 18px; }
.recovery-code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-weight: 700; font-size: clamp(1.15rem, 5.4vw, 1.6rem);
  letter-spacing: .08em; text-align: center; background: #fff; border: 2.5px dashed var(--ink); border-radius: 12px;
  padding: .5em .4em; margin: .6em 0; user-select: all; word-break: break-all;
}
.recovery-code .en { font-family: inherit; }
.form input.code-input { text-align: left; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; text-transform: uppercase; letter-spacing: .06em; }
.form input.code-input::placeholder { text-transform: none; letter-spacing: .02em; opacity: .5; }
