/* marhooba.com — site components built on the tokens in styles.css.
   Everything here assumes a kid is using it on a tablet: nothing
   interactive is smaller than 44px, and body type runs larger than the
   design system's default. */

:root { --u-color: var(--color-accent); }

body { font-size: 17px; }

.wrap { max-width: 760px; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-8); }
.wrap-wide { max-width: 1000px; }
.hidden { display: none !important; }
.stack > * + * { margin-top: var(--space-4); }
.row { display: flex; align-items: center; gap: var(--space-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }

/* — top bar — */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-6);
}
.topbar-me { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
.topbar-avatar {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  font-size: 22px; border-radius: 999px;
  background: color-mix(in srgb, var(--u-color) 22%, var(--color-bg));
  box-shadow: inset 0 0 0 2px var(--u-color);
}
.topbar-name { font-family: var(--font-heading); font-size: 19px; }
.topbar-links { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.topbar-links a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px;
  border-radius: 999px; text-decoration: none; color: inherit; font-size: 15px;
}
.topbar-links a:hover { background: color-mix(in srgb, var(--color-text) 8%, transparent); }
.topbar-links a[aria-current="page"] { background: var(--u-color); color: var(--color-bg); }

/* — page headings — */
.page-title { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); }
.page-title h1 { margin: 0; font-size: 38px; }
.page-lede { font-size: 19px; margin-bottom: var(--space-6); }

/* — read-aloud button — */
.speaker {
  width: 44px; height: 44px; flex: none; border: 1px solid var(--color-divider);
  background: var(--color-neutral-100); color: var(--color-accent-700);
}
.speaker:hover { background: var(--color-accent-100); border-color: var(--color-accent); }
.speaker:active { transform: scale(0.94); }

/* — hub tiles — */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.tile {
  display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-6);
  min-height: 150px; text-decoration: none; color: inherit; cursor: pointer;
  background: var(--color-surface); border-radius: calc(var(--radius-lg) * 1.15);
  box-shadow: var(--shadow-sm); transition: transform 120ms ease, box-shadow 120ms ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tile-icon {
  width: 52px; height: 52px; display: grid; place-items: center; border-radius: 999px;
  background: color-mix(in srgb, var(--u-color) 20%, var(--color-bg)); color: var(--u-color);
}
.tile-title { font-family: var(--font-heading); font-size: 23px; }
.tile-note { font-size: 15px; opacity: 0.75; margin-top: auto; }
@media (max-width: 620px) { .tiles { grid-template-columns: 1fr; } }

/* — login: pick your face — */
/* Centred wrap, not a grid: with five tiles a grid leaves the last one
   stranded against the left edge. The four kids sit on one row and the
   grown-up sits centred under them. */
.faces { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-4); }
/* Kids pick their own names, so a two-line name mustn't make one tile
   taller than its neighbours. */
.face { flex: 0 1 165px; min-height: 196px; justify-content: center; }
.face-name { text-wrap: balance; }
.faces-grown { margin-top: var(--space-6); }
.face {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  padding: var(--space-6) var(--space-3); cursor: pointer; border: 0;
  background: var(--color-surface); border-radius: calc(var(--radius-lg) * 1.15);
  box-shadow: var(--shadow-sm); font: inherit; color: inherit;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.face:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: var(--shadow-md); }
.face-avatar {
  width: 88px; height: 88px; display: grid; place-items: center; font-size: 50px;
  border-radius: 999px; background: color-mix(in srgb, var(--face-color) 22%, var(--color-bg));
  box-shadow: inset 0 0 0 3px var(--face-color);
}
.face-name { font-family: var(--font-heading); font-size: 24px; }
.face-note { font-size: 13px; opacity: 0.7; }

/* — keypads — */
.pad-shell { max-width: 420px; margin: 0 auto; }
.pad-dots { display: flex; justify-content: center; gap: 10px; min-height: 34px; align-items: center; margin-bottom: var(--space-4); }
.pad-dot {
  width: 18px; height: 18px; border-radius: 999px;
  background: color-mix(in srgb, var(--color-text) 14%, transparent);
}
.pad-dot.filled { background: var(--u-color); }
.pad-chip {
  min-width: 42px; height: 42px; padding: 0 8px; display: grid; place-items: center;
  font-size: 24px; border-radius: 12px; background: var(--color-neutral-200);
}
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.key {
  min-height: 68px; font-family: var(--font-heading); font-size: 28px; cursor: pointer;
  background: var(--color-surface); border: 1px solid var(--color-divider);
  border-radius: var(--radius-md); color: inherit;
}
.key:hover { background: var(--color-neutral-200); }
.key:active { transform: scale(0.96); }
.key-wide { grid-column: span 1; font-size: 18px; }
.emoji-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }
.emoji-key {
  min-height: 74px; font-size: 36px; cursor: pointer; background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.emoji-key:hover { background: var(--color-neutral-200); }
.emoji-key:active { transform: scale(0.94); }

/* — the goofy "will you remember?" dialog — */
.goofy { text-align: center; }
.goofy-emoji { font-size: 58px; line-height: 1; margin-bottom: var(--space-3); }
.goofy .dialog-actions { flex-direction: column; align-items: stretch; }
.goofy .btn { min-height: 54px; font-size: 17px; }

/* — lesson player — */
.progress-rail { height: 12px; border-radius: 999px; background: var(--color-neutral-300); overflow: hidden; }
.progress-fill { height: 100%; background: var(--u-color); border-radius: 999px; transition: width 220ms ease; }
.block {
  background: var(--color-surface); border-radius: calc(var(--radius-lg) * 1.15);
  padding: var(--space-6); box-shadow: var(--shadow-sm);
}
.block-text { font-size: 22px; line-height: 1.5; }
.block-tip { background: var(--color-accent-2-100); box-shadow: inset 0 0 0 2px var(--color-accent-2-300); }
.block-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--color-accent-700); margin-bottom: var(--space-3); }
.choices { display: grid; gap: var(--space-3); margin-top: var(--space-4); }
.choice {
  display: flex; align-items: center; gap: var(--space-3); text-align: left; cursor: pointer;
  min-height: 62px; padding: var(--space-3) var(--space-4); font: inherit; font-size: 19px; color: inherit;
  background: var(--color-bg); border: 2px solid var(--color-divider); border-radius: var(--radius-md);
}
.choice:hover { border-color: var(--u-color); }
.choice.right { border-color: var(--color-ok-line); background: var(--color-ok-bg); color: var(--color-ok-text); }
.choice.wrong { border-color: var(--color-bad-line); background: var(--color-bad-bg); color: var(--color-bad-text); }
.choice:disabled { cursor: default; }
.lesson-nav { display: flex; gap: var(--space-3); margin-top: var(--space-4); }
.lesson-nav .btn { min-height: 56px; font-size: 18px; flex: 1; }

/* — lists: lessons, letters, wall — */
.list-row {
  display: flex; align-items: center; gap: var(--space-4); width: 100%; text-align: left;
  padding: var(--space-4); background: var(--color-surface); border: 0; font: inherit; color: inherit;
  border-radius: calc(var(--radius-lg) * 0.9); box-shadow: var(--shadow-sm); cursor: pointer;
  text-decoration: none;
}
.list-row:hover { background: var(--color-neutral-200); }
.list-badge {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 999px;
  font-size: 22px; background: color-mix(in srgb, var(--row-color, var(--u-color)) 20%, var(--color-bg));
  box-shadow: inset 0 0 0 2px var(--row-color, var(--u-color));
}
.list-title { font-family: var(--font-heading); font-size: 19px; line-height: 1.2; }
.list-sub { font-size: 14px; opacity: 0.72; }
.list-row.unread .list-title::after {
  content: ""; display: inline-block; width: 9px; height: 9px; margin-left: 8px;
  border-radius: 999px; background: var(--color-accent); vertical-align: middle;
}
.stamp { font-size: 13px; opacity: 0.65; font-variant-numeric: tabular-nums; }

.post { background: var(--color-surface); border-radius: calc(var(--radius-lg) * 1.15); padding: var(--space-4) var(--space-6); box-shadow: var(--shadow-sm); }
.post-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); }
.post-author { font-family: var(--font-heading); font-size: 17px; }
.post-body { font-size: 18px; }
.post-body p:last-child { margin-bottom: 0; }

textarea.input { min-height: 150px; border-radius: var(--radius-md); padding: 12px 14px; resize: vertical; font: inherit; font-size: 18px; }
.input { min-height: 50px; font-size: 17px; }
.field > label { font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px;
  border-radius: 999px; cursor: pointer; font: inherit; font-size: 16px; color: inherit;
  background: var(--color-bg); border: 2px solid var(--color-divider);
}
.chip[aria-pressed="true"] { background: var(--u-color); border-color: var(--u-color); color: var(--color-bg); }

.empty { text-align: center; padding: var(--space-8) var(--space-4); opacity: 0.7; font-size: 18px; }
.notice { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: 16px; }
.notice-bad { background: var(--color-bad-bg); color: var(--color-bad-text); box-shadow: inset 0 0 0 2px var(--color-bad-line); }
.notice-good { background: var(--color-ok-bg); color: var(--color-ok-text); box-shadow: inset 0 0 0 2px var(--color-ok-line); }

/* ── Nineties treatment ───────────────────────────────────────────────────
   The palette lives in styles.css; these are the structural bits that make
   it read as Memphis rather than just "teal and pink": hard black rules on
   every surface, and a sparse confetti of shapes behind the page. */

body {
  background-color: var(--color-bg);
  background-image:
    radial-gradient(circle at 8% 14%,  var(--color-accent-300) 0 6px, transparent 6px),
    radial-gradient(circle at 63% 8%,  var(--color-accent-2-200) 0 5px, transparent 5px),
    radial-gradient(circle at 88% 33%, var(--color-pop) 0 5px, transparent 5px),
    radial-gradient(circle at 24% 58%, var(--color-accent-2-200) 0 4px, transparent 4px),
    radial-gradient(circle at 78% 78%, var(--color-accent-300) 0 6px, transparent 6px),
    radial-gradient(circle at 42% 92%, var(--color-pop) 0 4px, transparent 4px);
  background-size: 420px 420px;
  background-attachment: fixed;
}

.card, .tile, .face, .block, .post, .list-row, .dialog, .kid, .choice, .input, .key, .emoji-key {
  border: 3px solid var(--color-text);
}
.btn-primary, .btn-secondary { border: 3px solid var(--color-text); box-shadow: 3px 3px 0 var(--color-text); }
.btn-primary:active, .btn-secondary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--color-text); }
.btn-ghost, .btn-icon.btn-ghost { border: 0; box-shadow: none; }
.speaker { border: 3px solid var(--color-text); box-shadow: 2px 2px 0 var(--color-text); }
.progress-rail { border: 3px solid var(--color-text); height: 18px; }
.topbar-links a[aria-current="page"] { box-shadow: 3px 3px 0 var(--color-text); border: 3px solid var(--color-text); }

/* The tiles tilt very slightly, like stickers on a Trapper Keeper. */
.face:nth-child(odd) { transform: rotate(-1.4deg); }
.face:nth-child(even) { transform: rotate(1.4deg); }
.face:hover { transform: translateY(-4px) rotate(0deg); }


/* ── Review queue ─────────────────────────────────────────────────────── */
.nav-badge {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; font-family: var(--font-heading); font-size: 12px; line-height: 1;
  background: var(--color-accent-2); color: var(--color-bg); border: 2px solid var(--color-text);
}
.tag-warn { background: var(--color-pop); color: var(--color-text); }
.review-item {
  padding: var(--space-3) var(--space-4); margin-top: var(--space-3);
  background: var(--color-bg); border: 2px solid var(--color-text); border-radius: var(--radius-md);
}

/* ── Footer ───────────────────────────────────────────────────────────────
   The Jazz cup: purple brush dashes and pink flecks above, teal zigzag below,
   and a clear band through the middle where the text sits. The text still
   carries a surface-coloured outline in case the pattern shifts under it. */

.site-footer {
  display: block;
  width: fit-content;
  max-width: calc(100% - var(--space-8));
  margin: var(--space-8) auto var(--space-6);
  padding: 16px 30px;
  border: 3px solid var(--color-text);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--color-text);
  background-color: var(--color-surface);
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='120'%20height='52'%3E%3Cpath%20d='M-8%2048%20L7%2036%20L22%2048%20L37%2036%20L52%2048%20L67%2036%20L82%2048%20L97%2036%20L112%2048%20L127%2036'%20fill='none'%20stroke='%2300b3a4'%20stroke-width='4.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3Cpath%20d='M3%2012%20L18%205'%20stroke='%23b14aed'%20stroke-width='4.5'%20stroke-linecap='round'/%3E%3Cpath%20d='M45%2010%20L60%203'%20stroke='%23b14aed'%20stroke-width='4.5'%20stroke-linecap='round'/%3E%3Cpath%20d='M87%2013%20L102%206'%20stroke='%23b14aed'%20stroke-width='4.5'%20stroke-linecap='round'/%3E%3Ccircle%20cx='30'%20cy='7'%20r='2.4'%20fill='%23ff2e88'/%3E%3Ccircle%20cx='72'%20cy='9'%20r='2.4'%20fill='%23ff2e88'/%3E%3Ccircle%20cx='113'%20cy='5'%20r='2.4'%20fill='%23ff2e88'/%3E%3C/svg%3E");
  background-size: 120px 52px;
  background-position: center;
  background-repeat: repeat-x;
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
  color: var(--color-text);
  text-shadow:
     0 1px 0 var(--color-surface),  0 -1px 0 var(--color-surface),
     1px 0 0 var(--color-surface), -1px  0 0 var(--color-surface),
     1px 1px 0 var(--color-surface), -1px -1px 0 var(--color-surface),
     1px -1px 0 var(--color-surface), -1px  1px 0 var(--color-surface);
}
