/* maths-learning-site: one stylesheet for the Games Room, the map, the parent and admin pages */
:root {
  --teal: #0E6E73; --teal-2: #1B8C91; --teal-soft: #DCEDEB; --ink: #16393C; --ink-2: #4A6668;
  --paper: #F3F8F7; --card: #FFFFFF; --line: #D3E4E2; --orange: #F0892B; --orange-ink: #B85E0F; --orange-soft: #FDEBDA;
  --gold: #F5B92E; --silver: #8FA6A9; --bronze: #C7864A; --red-soft: #FBE3DE; --red-ink: #A2402B;
  --round: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 14px;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--round); font-size: 17px; line-height: 1.45; }
a { color: var(--teal); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 18px 18px 60px; }
h1 { font-size: 30px; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 22px; margin: 34px 0 10px; }
h3 { font-size: 18px; margin: 22px 0 8px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
[hidden] { display: none !important; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--teal); background: var(--card); color: var(--teal);
  border-radius: 999px; padding: 8px 16px; font-weight: 700; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn.go { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.quiet { border-color: transparent; background: transparent; }
.btn.danger { border-color: var(--red-ink); color: var(--red-ink); }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* top bar */
.top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.top .grow { flex: 1; }
.av { width: 64px; height: 64px; border-radius: 50%; background: #fff; border: 4px solid var(--teal); object-fit: cover; flex: none; }
.av.big { width: 96px; height: 96px; }
.av.orange { border-color: var(--orange); } .av.gold { border-color: var(--gold); } .av.plum { border-color: #8C5A9E; } .av.sky { border-color: #4C9BD6; }

/* Games Room: the book's contents, alive */
.unit { margin-top: 30px; }
.unit > h2 { font-size: 26px; margin: 0 0 6px; display: flex; gap: 10px; align-items: baseline; }
.unit > h2 .n { color: var(--orange); font-variant-numeric: tabular-nums; }
.sec { scroll-margin-top: 16px; display: grid; grid-template-columns: 66px 1fr; gap: 4px 12px; padding: 12px 0; border-top: 1.5px solid var(--line); }
.sec .num { font-size: 28px; font-weight: 800; color: var(--orange); font-variant-numeric: tabular-nums; line-height: 1.1; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sec .title { font-weight: 700; }
.sec .star { color: var(--orange-ink); font-size: 14px; margin-left: 6px; font-weight: 600; }
.sec.soon .num { color: var(--silver); }
.sec.soon .title { color: var(--ink-2); font-weight: 600; }
.items { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.item { display: inline-flex; align-items: center; gap: 10px; background: var(--card); border: 2px solid var(--line); border-radius: var(--r);
  padding: 10px 14px; text-decoration: none; color: var(--ink); font-weight: 700; min-height: 52px; }
.item:hover { border-color: var(--teal-2); }
.item .ic { font-size: 22px; }
.item .tag { font-size: 13px; font-weight: 600; color: var(--orange-ink); background: var(--orange-soft); border-radius: 999px; padding: 1px 8px; }
.item .done { color: var(--teal); font-size: 14px; }
.soonunits { margin-top: 30px; color: var(--ink-2); }
.soonunits li { margin: 4px 0; }

/* medallions (the map) */
.dot { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--silver); background: transparent; display: inline-block; }
.dot.bronze, .med.bronze, .medal.bronze { --m: var(--bronze); } .dot.silver, .med.silver, .medal.silver { --m: var(--silver); } .dot.gold, .med.gold, .medal.gold { --m: var(--gold); }
.dot.bronze, .dot.silver, .dot.gold { background: var(--m); border-color: var(--m); }
/* the map: islands with a trail of medallion stops */
.maptop .grow { min-width: 210px; }
.maptop .collected { margin: 4px 0 0; color: var(--ink-2); font-size: 17px; }
.invite { display: flex; gap: 16px; align-items: center; background: #fff; border: 3px solid var(--teal-soft); border-radius: 24px;
  padding: 14px 20px; margin: 18px 0 8px; text-decoration: none; color: inherit; position: relative; }
.invite:hover { border-color: var(--orange); }
.invite img, .invite .heart { width: 72px; height: 72px; border-radius: 50%; background: var(--teal-soft); flex: none; }
.invite .heart { display: grid; place-items: center; font-size: 36px; }
.invite p { margin: 0; font-size: 20px; font-weight: 700; }
.invite .go-on { color: var(--orange-ink); white-space: nowrap; }
.island { margin-top: 22px; border-radius: 30px; padding: 4px; background-color: #C6E7E3;
  background-image: radial-gradient(ellipse 18px 6px at 50% 100%, transparent 70%, #ffffff66 72%, transparent 80%);
  background-size: 64px 30px; }
.islandsvg { width: 100%; height: auto; display: block; font-family: var(--round); overflow: visible; }
.islandsvg .shore { fill: #E8D59E; } .islandsvg .land { fill: #FBF0CC; }
.islandsvg .isletitle { font-size: 24px; font-weight: 800; fill: var(--teal); }
.islandsvg .deco { font-size: 24px; }
.islandsvg .trail { fill: none; stroke: var(--orange); stroke-width: 6; stroke-dasharray: 1 13; stroke-linecap: round; opacity: .85; }
.med .disc { fill: #fff; stroke: var(--silver); stroke-width: 4; stroke-dasharray: 8 6; }
.med[role=button]:not(.bronze):not(.silver):not(.gold) .disc { stroke: var(--teal); stroke-dasharray: 8 5; }
.med .ring { fill: none; stroke: none; }
.med.bronze .disc, .med.silver .disc, .med.gold .disc { fill: var(--m); stroke: color-mix(in srgb, var(--m) 70%, #000); stroke-dasharray: none; stroke-width: 5; }
.med.bronze .ring, .med.silver .ring, .med.gold .ring { stroke: #ffffff70; stroke-width: 3; }
.med .num { font-size: 21px; font-weight: 800; fill: var(--ink-2); }
.med.bronze .num, .med.silver .num { fill: #fff; } .med.gold .num { fill: var(--ink); }
.med .lbl { font-size: 14px; font-weight: 700; fill: var(--ink); }
.med.soon { opacity: .42; }
.med[role=button] { cursor: pointer; }
.med[role=button]:hover .disc, .med[role=button]:focus .disc { stroke: var(--orange); stroke-dasharray: none; stroke-width: 6; }
.med:focus { outline: none; }
.med .starmark { font-size: 20px; fill: var(--orange); }
.med .tv circle { fill: #fff; stroke: var(--teal); stroke-width: 2.5; } .med .tv text { font-size: 15px; }
.me .pin, .me .pinring { fill: #fff; stroke: var(--teal); stroke-width: 5; } .me .pin { fill: var(--teal); }
.me .pinring.orange { stroke: var(--orange); } .me .pinring.gold { stroke: var(--gold); } .me .pinring.plum { stroke: #8C5A9E; } .me .pinring.sky { stroke: #4C9BD6; }
.me .hop { animation: hop .9s cubic-bezier(.3, 1.5, .55, 1) .2s both; }
@keyframes hop { from { transform: translateY(-90px); opacity: 0; } 60% { opacity: 1; } }
.stopcard .medal { width: 96px; height: 96px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 26px;
  border: 5px dashed var(--silver); color: var(--ink-2); background: #fff; }
.stopcard .medal.bronze, .stopcard .medal.silver, .stopcard .medal.gold { border: 6px solid var(--m); background: var(--m); color: #fff; }
.stopcard .medal.gold { color: var(--ink); }
.kidword { font-weight: 800; color: var(--teal); margin: 4px 0 14px; }
.stopitems { display: flex; flex-direction: column; gap: 10px; }
.stopitems .btn { justify-content: center; }
.later .isles { display: flex; flex-wrap: wrap; gap: 10px; }
.later .isle { background: #fff; border: 2px dashed var(--silver); border-radius: 999px; padding: 6px 14px; color: var(--ink-2); font-weight: 600; font-size: 15px; display: inline-flex; gap: 8px; }
.later .isle .n { color: var(--orange); font-weight: 800; }
.cardsec .album { display: flex; flex-wrap: wrap; gap: 12px; }
.tcg { width: 132px; min-height: 176px; border-radius: 14px; padding: 12px 10px; color: #fff; display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 6px; box-shadow: inset 0 0 0 3px #ffffff55, 0 3px 0 #0002; background: linear-gradient(160deg, var(--c1), var(--c2)); }
.tcg.teal { --c1: #0E6E73; --c2: #23A2A6; } .tcg.orange { --c1: #D46A12; --c2: #F5A24B; } .tcg.plum { --c1: #6E3F82; --c2: #A774BC; } .tcg.sky { --c1: #2D74AE; --c2: #6DB5E8; }
.tcg .gem { font-size: 40px; line-height: 1.2; margin-top: 8px; text-shadow: 0 2px 0 #0003; }
.tcg .cname { font-weight: 800; font-size: 16px; line-height: 1.2; }
.tcg .cfrom { margin-top: auto; font-size: 12px; opacity: .85; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; color: var(--ink-2); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* who's playing */
.players { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 22px; }
.player { background: var(--card); border: 3px solid var(--line); border-radius: 26px; padding: 22px 28px 18px; text-align: center; cursor: pointer; min-width: 190px; }
.player .av { width: 128px; height: 128px; }
.player:hover { border-color: var(--orange); }
.player .name { font-size: 24px; font-weight: 800; margin-top: 10px; }

/* panels, forms, tables (parent and admin) */
.panel { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-top: 12px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 4px; }
.tab { border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px 6px 6px; display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 700; }
.tab img { width: 34px; height: 34px; border-radius: 50%; }
.tab[aria-selected="true"] { border-color: var(--teal); background: var(--teal-soft); }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td:first-child { min-width: 190px; }
th { font-weight: 700; color: var(--ink-2); font-size: 14px; white-space: nowrap; }
tr.click { cursor: pointer; } tr.click:hover td { background: #F7FBFA; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.st { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 700; }
.st.needs-help { color: var(--red-ink); }
.mistake { border-left: 4px solid var(--orange); padding: 8px 12px; margin: 10px 0; background: #FFFBF6; border-radius: 0 10px 10px 0; }
.mistake.fixed { border-left-color: var(--teal); background: #F6FBFA; }
.mistake .q { font-weight: 700; }
.pill { display: inline-block; font-size: 13px; border-radius: 999px; padding: 1px 8px; background: var(--teal-soft); color: var(--teal); font-weight: 700; }
.pill.slip { background: var(--teal-soft); } .pill.nu { background: var(--orange-soft); color: var(--orange-ink); } .pill.fx { background: #E3F3E8; color: #2D7A44; }
.next li { margin: 6px 0; }
label.f { display: block; margin: 10px 0 4px; font-weight: 700; font-size: 15px; }
textarea { display: block; width: 100%; box-sizing: border-box; min-height: 12em; font-size: 17px; line-height: 1.45; border: 2px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; font: inherit; resize: vertical; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--teal, #0E6E73); }
.help section { scroll-margin-top: 12px; } .help ol { padding-left: 1.2em; margin: 0; } .help li + li { margin-top: 6px; }
input[type=text], input[type=password], select { border: 2px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; min-height: 44px; }
.pick { display: flex; gap: 10px; flex-wrap: wrap; }
.pick button { border: 3px solid transparent; border-radius: 50%; padding: 0; background: none; cursor: pointer; }
.pick button[aria-pressed="true"] { border-color: var(--orange); }
.pick img { width: 54px; height: 54px; border-radius: 50%; display: block; }
.swatch { width: 34px; height: 34px; border-radius: 50%; display: block; }

/* PIN pad */
.veil { position: fixed; inset: 0; background: #16393Caa; display: grid; place-items: center; z-index: 50; padding: 16px; }
.dlg { background: var(--card); border-radius: 22px; padding: 22px; width: min(360px, 100%); text-align: center; }
.dlg h3 { margin: 0 0 4px; }
.pinuser { display: block; box-sizing: border-box; width: 100%; margin: 12px 0 4px; padding: 11px 13px; font-size: 18px; text-align: center; border: 2px solid var(--line); border-radius: 14px; background: #fff; }
.pinshow { font-size: 30px; letter-spacing: 12px; min-height: 44px; margin: 10px 0; font-weight: 800; }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keys button { font-size: 24px; font-weight: 800; border: 2px solid var(--line); background: #fff; border-radius: 16px; min-height: 58px; cursor: pointer; }
.keys button:active { background: var(--teal-soft); }
.err { color: var(--red-ink); font-weight: 700; min-height: 1.4em; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 999px; z-index: 60; font-weight: 700; }
.hero { margin: 24px 0; }
.hero p { font-size: 19px; max-width: 60ch; }
@media (max-width: 560px) {
  h1 { font-size: 25px; } .sec { grid-template-columns: 52px 1fr; } .sec .num { font-size: 22px; }
  .av { width: 52px; height: 52px; } .av.big { width: 76px; height: 76px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* progress on the map: rings to the next medal, the journey bar, new badges, the stop card's next step */
.islandsvg .isleprog { font-size: 15px; font-weight: 700; fill: var(--ink-2); }
.med .track { fill: none; stroke: #ffffffaa; stroke-width: 6; }
.med .arc { fill: none; stroke-width: 6; stroke-linecap: round; }
.med .arc.bronze, .fill.bronze { stroke: var(--bronze); background: var(--bronze); } .med .arc.silver, .fill.silver { stroke: var(--silver); background: var(--silver); }
.med .arc.gold, .fill.gold { stroke: var(--gold); background: var(--gold); }
.med.new .disc { animation: glow 1.6s ease-out .4s 2; }
@keyframes glow { 50% { stroke: var(--orange); stroke-width: 10; } }
.journey { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; }
.jbar { flex: 1; display: flex; gap: 4px; height: 18px; }
.jbar .seg { flex: 1; border-radius: 6px; background: #fff; border: 2px dashed var(--silver); }
.jbar .seg.bronze, .jbar .seg.silver, .jbar .seg.gold { background: var(--m); border: 0; }
.jbar .seg.bronze { --m: var(--bronze); } .jbar .seg.silver { --m: var(--silver); } .jbar .seg.gold { --m: var(--gold); }
.jtext { font-weight: 800; color: var(--teal); white-space: nowrap; }
.newbadges { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; background: #FFF6DD; border: 3px solid var(--gold); border-radius: 18px; padding: 10px 16px; margin: 10px 0; }
.newbadges b { font-size: 19px; color: var(--orange-ink); }
.newbadges .nb { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.nextbox { margin: 0 0 14px; }
.nextbar { height: 14px; border-radius: 8px; background: var(--teal-soft); overflow: hidden; }
.nextbar .fill { display: block; height: 100%; border-radius: 8px; }
.nextwords { margin: 8px 0 0; font-weight: 700; }

/* the Games Room: Map / List switch and "Play next" */
.viewswitch { display: inline-flex; border: 2px solid var(--teal); border-radius: 999px; overflow: hidden; margin: 6px 0 4px; }
.viewswitch button { border: 0; background: #fff; color: var(--teal); font-weight: 800; padding: 8px 18px; min-height: 44px; cursor: pointer; }
.viewswitch button[aria-pressed="true"] { background: var(--teal); color: #fff; }
.invite .next-label { display: block; font-size: 14px; font-weight: 800; color: var(--orange-ink); margin-bottom: 2px; }
.site-foot { text-align: center; color: var(--ink-2); font-size: 13px; padding: 28px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
.tagswitch { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 4px; }
.tagswitch .lbl { font-weight: 700; color: var(--ink-2); margin-right: 2px; }
.tagswitch button { border: 2px solid var(--orange); border-radius: 999px; background: #fff; color: var(--orange-ink); font-weight: 700; padding: 6px 14px; min-height: 40px; cursor: pointer; }
.tagswitch button[aria-pressed="true"] { background: var(--orange); color: #fff; }
