/* Lea Valley Karate Academy — site styles
 * Palette taken from the syllabus cover: deep navy + warm cream-yellow,
 * kept restrained so the page suits adults reading grading info as well as kids. */

:root {
  --navy:        #14213d;
  --navy-soft:   #1f2d52;
  --navy-line:   #2a3a66;
  --cream:       #f5e8a8;
  --cream-soft:  #fbf3c8;
  --paper:       #f7f5ee;
  --ink:         #1d1f25;
  --ink-soft:    #4a4d57;
  --ink-muted:   #7a7e8a;
  --line:        #e3e0d4;
  --accent:      #c89d2c;
  --shadow:      0 1px 0 rgba(20,33,61,0.04);
  --radius:      6px;
  --radius-lg:   10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* HTML's `hidden` attribute should always win — `display:none` from the
 * user-agent sheet has lower specificity than class-level `display`, so a
 * `<button class="btn" hidden>` would still render without this. */
[hidden] { display: none !important; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--navy);
  color: var(--cream);
  border-bottom: 3px solid var(--cream);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--cream);
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: block;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-text strong {
  font-size: 16px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.brand-text span {
  font-size: 12px;
  color: var(--cream-soft);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.site-nav {
  display: flex;
  gap: 6px;
}
.site-nav a {
  color: var(--cream);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
}
.site-nav a:hover {
  background: var(--navy-soft);
  text-decoration: none;
}
.site-nav a[aria-current="page"] {
  background: var(--cream);
  color: var(--navy);
}

/* Hamburger button — only shown on small screens (mobile media query below). */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-toggle:hover { background: var(--navy-soft); }
.nav-toggle:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--cream);
  border-radius: 1px;
  transition: transform .2s ease, opacity .15s ease;
}
.nav-toggle.is-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Access gate ---------- */

.page-gate {
  background: var(--navy);
  color: var(--cream);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gate-main {
  width: 100%;
  max-width: 420px;
  padding: 32px 20px;
}
.gate-card {
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 12px 40px -16px rgba(0,0,0,0.5);
}
.gate-mark {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  object-fit: contain;
}
.gate-card h1 {
  font-size: 22px;
  margin: 0 0 6px;
}
.gate-sub {
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 14px;
}
#gate-form {
  display: grid;
  gap: 10px;
}
#gate-form input {
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  text-align: center;
  letter-spacing: 1px;
}
#gate-form input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(20,33,61,0.12);
}
#gate-form button { padding: 12px; }
.gate-error {
  margin: 4px 0 0;
  font-size: 13px;
  color: #b1271f;
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 64px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 13px;
}

/* ---------- Typography ---------- */

h1 {
  font-size: 36px;
  line-height: 1.15;
  margin: 8px 0 14px;
  color: var(--navy);
}
h2 {
  font-size: 22px;
  margin: 0 0 8px;
  color: var(--navy);
}
h3 {
  font-size: 16px;
  margin: 0;
  color: var(--ink);
}
.eyebrow {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: var(--accent);
}
.lead {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 60ch;
}
.muted { color: var(--ink-muted); font-size: 14px; }

/* ---------- Home / hero ---------- */

.hero { padding: 48px 24px 16px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.big-card {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  color: inherit;
  position: relative;
  transition: transform .12s ease, border-color .12s ease;
}
.big-card:hover {
  text-decoration: none;
  border-color: var(--navy);
  transform: translateY(-2px);
}
.big-card.disabled {
  opacity: 0.6;
  pointer-events: none;
}
.big-card-tag {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  background: var(--cream);
  color: var(--navy);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  margin-bottom: 12px;
}
.big-card h2 { margin-bottom: 6px; }
.big-card p { color: var(--ink-soft); margin: 0 0 14px; }
.big-card-cta {
  font-weight: 600;
  color: var(--navy);
}

.quote {
  margin: 40px 0 0;
  padding: 20px 24px;
  background: #fff;
  border-left: 4px solid var(--cream);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--ink-soft);
}
.quote cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-weight: 600;
  color: var(--ink);
}

/* ---------- Grading layout ---------- */

.grading-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  padding: 32px 24px 0;
}

@media (max-width: 800px) {
  .grading-layout { grid-template-columns: 1fr; }
}

.sidebar-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--ink-muted);
  margin: 4px 0 10px;
}

.belt-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.belt-nav li + li { border-top: 1px solid var(--line); }

.belt-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--ink);
}
.belt-link:hover {
  background: var(--cream-soft);
  text-decoration: none;
}
.belt-link.is-active {
  background: var(--navy);
  color: var(--cream);
}
.belt-link.is-active .belt-rank { color: var(--cream); }
.belt-link.is-active .belt-name { color: var(--cream-soft); }

.belt-link-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.belt-rank {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}
.belt-name {
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Visual belt swatch — flat horizontal strip with optional stripes. */
.belt-swatch {
  flex: 0 0 auto;
  position: relative;
  display: inline-block;
  width: 56px;
  height: 14px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.15);
  overflow: hidden;
}
.belt-stripe {
  position: absolute;
  left: 0;
  right: 0;
}

/* Single-stripe belts (12th, 11th, 4th, 2nd Kyu): one horizontal band
 * through the middle, taking the centre 1/3 of the height. */
.belt-swatch.stripes-1 .belt-stripe {
  top: 33.333%;
  height: 33.334%;
}

/* Two-stripe belt (1st Kyu — Brown / Two White): five equal horizontal
 * bands of 20% each — base / stripe / base / stripe / base. */
.belt-swatch.stripes-2 .belt-stripe { height: 20%; }
.belt-swatch.stripes-2 .belt-stripe:nth-child(1) { top: 20%; }
.belt-swatch.stripes-2 .belt-stripe:nth-child(2) { top: 60%; }

/* ---------- Belt detail card ---------- */

.belt-detail .placeholder {
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-muted);
}

.belt-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.belt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.belt-card-heading { min-width: 0; }
.belt-card-header h2 { font-size: 28px; }
.belt-card-swatch { flex: 0 0 auto; }
.belt-card-swatch .belt-swatch {
  width: 140px;
  height: 22px;
}

.belt-sections {
  display: grid;
  gap: 16px;
}

.req-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.req-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.req-list {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
}
.req-list li + li { margin-top: 4px; }
.req-footnote {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
  font-style: italic;
}

/* Stripe badges — coloured dot + label, mapped to the belt-tape colours. */
.stripe-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.stripe-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.stripe-yellow { color: #b88a00; background: #fff7d6; border-color: #f0e2a0; }
.stripe-red    { color: #b1271f; background: #fde6e4; border-color: #f4b9b3; }
.stripe-blue   { color: #1f3a8a; background: #e1e7fb; border-color: #b8c4ee; }
.stripe-white  { color: #5a5a5a; background: #fff;    border-color: #d8d8d8; }
.stripe-black  { color: #1a1a1a; background: #ececec; border-color: #c4c4c4; }

.belt-note {
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--cream-soft);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--ink-soft);
}

.belt-extras {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}
.belt-extras h3 {
  margin-bottom: 6px;
}

/* ---------- Glossary ---------- */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.glossary-main { padding: 32px 24px 0; }

.glossary-search {
  position: relative;
  margin: 18px 0 8px;
  max-width: 560px;
}
.glossary-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--ink-muted);
  pointer-events: none;
}
.glossary-search input {
  width: 100%;
  padding: 12px 44px 12px 40px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.glossary-search input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(20,33,61,0.12);
}
.glossary-search input::-webkit-search-decoration,
.glossary-search input::-webkit-search-cancel-button { display: none; }

.glossary-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  display: none;
}
.glossary-clear:hover { background: var(--paper); color: var(--ink); }
.glossary-clear.is-visible { display: inline-flex; align-items: center; justify-content: center; }

.glossary-count {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 0 0 16px;
  min-height: 18px;
}

.glossary-list {
  display: grid;
  gap: 22px;
}

.g-group {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.g-group-title {
  margin: 0;
  padding: 12px 18px;
  background: var(--cream-soft);
  color: var(--navy);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.g-group-count {
  font-size: 11px;
  font-weight: 700;
  background: var(--navy);
  color: var(--cream);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

.g-entries {
  list-style: none;
  margin: 0;
  padding: 0;
}
.g-entry {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 2fr;
  gap: 18px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.g-entry:first-child { border-top: 0; }
.g-jp {
  font-weight: 700;
  color: var(--navy);
}
.g-en {
  color: var(--ink-soft);
}
.g-note {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 2px;
  font-style: italic;
}

mark {
  background: var(--cream);
  color: var(--ink);
  padding: 0 2px;
  border-radius: 2px;
}

.g-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-muted);
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
}

/* Visual reference gallery shown under a glossary group (e.g. Stances).
 * Compact tiles, image capped so it never feels overwhelming. */
.g-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px dashed var(--line);
  background: #fdfcf6;
}
.g-gallery-item {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.g-gallery-item img {
  width: 100%;
  max-width: 130px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
}
.g-gallery-item figcaption {
  text-align: center;
  margin-top: 6px;
  line-height: 1.3;
}
.gg-en {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}
.gg-jp {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  font-style: italic;
  margin-top: 2px;
}

@media (max-width: 600px) {
  .g-entry {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .g-gallery { grid-template-columns: repeat(2, 1fr); padding: 12px; }
  .g-gallery-item img { max-width: 110px; }
}

/* ---------- Footer ---------- */

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer-inner p { margin: 0; }
.footer-admin-link {
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.6;
}
.footer-admin-link:hover { opacity: 1; }

.footer-credit {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}
.footer-credit:hover { color: var(--navy); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .08s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn-primary {
  background: var(--navy);
  color: var(--cream);
  border-color: var(--navy);
}
.btn-primary:hover { background: var(--navy-soft); }

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--paper); }

.btn-danger {
  background: #d62828;
  color: #fff;
  border-color: #d62828;
}
.btn-danger:hover { background: #b1271f; border-color: #b1271f; }

.t-pos { color: #2f9e43; }
.t-neg { color: #d62828; }

.back-link { color: var(--navy); }
.small-print { font-size: 12px; }

/* ---------- Game (Numbers) ---------- */

.game-main { padding: 32px 24px 0; }

.menu-section-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--ink-muted);
  margin: 28px 0 12px;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.level-card {
  position: relative;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.level-card:hover {
  border-color: var(--navy);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px -10px rgba(20,33,61,0.25);
}

.level-tag {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  color: var(--accent);
}
.level-range {
  display: block;
  font-size: 36px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
  margin: 4px 0 12px;
}
.level-meta {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.level-top {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  font-size: 13px;
}
.level-top li {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 8px;
  padding: 4px 0;
  border-top: 1px dashed var(--line);
  align-items: baseline;
}
.level-top li:first-child { border-top: 0; }
.lt-rank { color: var(--ink-muted); font-weight: 700; }
.lt-name {
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lt-score { color: var(--navy); font-weight: 700; }
.level-top-empty {
  margin: 0 0 16px;
  padding: 10px 12px;
  background: var(--paper);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--ink-muted);
}

.level-cta {
  display: block;
  font-weight: 700;
  color: var(--navy);
  font-size: 14px;
}

/* ---------- Game HUD + stage ---------- */

.game-hud {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin: 8px 0 8px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hud-item:first-child { align-items: flex-start; text-align: left; }
.hud-item:last-child  { align-items: flex-end;   text-align: right; }
.hud-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--ink-muted);
}
.hud-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
}
.hud-score .hud-value { font-size: 32px; }

@keyframes hudBump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.hud-bump { animation: hudBump 280ms ease-out; }

.time-bar {
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 0 22px;
}
.time-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--accent));
  width: 100%;
  transition: width 100ms linear;
}

/* Countdown 3, 2, 1, GO! */

.countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0 24px;
}
#countdown-num {
  font-size: 96px;
  font-weight: 900;
  color: var(--navy);
  line-height: 1;
  animation: cdPop 700ms ease-out;
}
#countdown-num.cd-go {
  color: #2f9e43;
}
@keyframes cdPop {
  0%   { transform: scale(0.4); opacity: 0; }
  40%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Stage with the big number + answers */

.stage {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 24px 28px;
}

.big-number {
  font-size: 180px;
  font-weight: 900;
  color: var(--navy);
  text-align: center;
  line-height: 1;
  letter-spacing: -4px;
  margin: 0 0 28px;
}
@keyframes bnPop {
  0%   { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.bn-pop { animation: bnPop 250ms ease-out; }

.floating-points {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  font-size: 32px;
  font-weight: 800;
  pointer-events: none;
  opacity: 0;
  z-index: 2;
  padding: 6px 16px;
  border-radius: 999px;
}
.floating-points.fp-pos { color: #fff; background: #2f9e43; }
.floating-points.fp-neg { color: #fff; background: #d62828; }
@keyframes floatUp {
  0%   { transform: translate(-50%, 10px); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translate(-50%, -70px); opacity: 0; }
}
.floating-points.is-show { animation: floatUp 900ms ease-out forwards; }

.answers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.answer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 16px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  transition: background .12s ease, border-color .12s ease, transform .08s ease;
}
.answer-btn:hover {
  background: var(--cream-soft);
  border-color: var(--accent);
}
.answer-btn:active { transform: translateY(1px); }
.answer-jp {
  font-size: 30px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.15;
  text-align: center;
}

.answer-btn.is-correct {
  background: #e7f6ea;
  border-color: #2f9e43;
}
.answer-btn.is-correct .answer-jp { color: #1e6e2c; }
.answer-btn.is-wrong {
  background: #fde6e4;
  border-color: #d62828;
}
.answer-btn.is-wrong .answer-jp { color: #b1271f; }

@media (max-width: 600px) {
  .answers { grid-template-columns: 1fr; }
  .answer-btn { padding: 20px 14px; }
  .answer-jp { font-size: 26px; }
  .big-number { font-size: 120px; margin-bottom: 18px; }
  #countdown-num { font-size: 72px; }
}

/* ---------- Japanese Master ---------- */

.hud-value-sm { font-size: 18px; font-weight: 700; }

.term-direction {
  margin: 0 0 8px;
  text-align: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: var(--accent);
}

/* Big term display — shrinks for longer prompts (font-size set inline by JS). */
.big-term {
  font-weight: 800;
  color: var(--navy);
  text-align: center;
  line-height: 1.1;
  margin: 4px 0 28px;
  word-break: break-word;
  hyphens: auto;
  padding: 0 8px;
}

/* Variant of .answers used by Japanese Master — text labels can run long, so
 * answer cards stack 1-per-row by default, growing in height for long phrases. */
.answers-text {
  grid-template-columns: 1fr;
  gap: 10px;
}
.answers-text .answer-btn {
  padding: 18px 18px;
}
.answer-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  text-align: center;
  word-break: break-word;
}

.answer-btn.is-correct .answer-text { color: #1e6e2c; }
.answer-btn.is-wrong   .answer-text { color: #b1271f; }

.mode-tag {
  font-size: 26px !important;
  letter-spacing: 1px;
}
.mode-desc {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 10px;
  line-height: 1.4;
}

@media (max-width: 600px) {
  .answers-text .answer-btn { padding: 14px 14px; }
  .answer-text { font-size: 18px; }
}

/* ---------- Result view ---------- */

.result-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.big-score {
  font-size: 96px;
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
  margin: 8px 0 4px;
}
.big-score.is-positive { color: #2f9e43; }
.big-score.is-negative { color: #d62828; }
.result-message {
  color: var(--ink-soft);
  margin: 0 0 24px;
}

.save-form {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  margin: 0 0 24px;
  text-align: left;
}
.save-form label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-muted);
  margin-bottom: 8px;
}
.save-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}
.save-row input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 15px;
  outline: none;
}
.save-row input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(20,33,61,0.12);
}
.save-row input:disabled { background: #f1efe8; color: var(--ink-muted); }

.save-feedback {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.save-feedback.is-ok   { color: #1e6e2c; }
.save-feedback.is-warn { color: #b1271f; }

@media (max-width: 480px) {
  .save-row { grid-template-columns: 1fr; }
}

.leaderboard-card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  margin-bottom: 22px;
  text-align: left;
}
.leaderboard-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.leaderboard-header h3 { font-size: 14px; }
.lb-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lb-entry {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius);
  font-size: 14px;
  border-top: 1px solid var(--line);
}
.lb-entry:first-child { border-top: 0; }
.lb-rank { color: var(--ink-muted); font-weight: 700; }
.lb-name {
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-score { color: var(--navy); font-weight: 700; }
.lb-entry.is-new {
  background: var(--cream);
  border-color: var(--accent);
}
.lb-empty {
  padding: 14px 10px;
  color: var(--ink-muted);
  font-size: 13px;
}

.result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Admin ---------- */

.admin-main { padding: 32px 24px 0; max-width: 880px; }

.admin-login { max-width: 360px; }
.login-form {
  display: grid;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.login-form label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-muted);
}
.login-form input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
  outline: none;
}
.login-form input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(20,33,61,0.12);
}
.login-form button { margin-top: 4px; }
.login-error {
  margin: 0;
  font-size: 13px;
  color: #b1271f;
}

.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--cream-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 22px;
}
.admin-status {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}

.admin-lb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin: 14px 0 22px;
}
.admin-lb-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px 12px;
}
.admin-lb-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.admin-lb-card h3 { font-size: 14px; }
.admin-lb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}
.admin-lb-list li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  padding: 5px 0;
  border-top: 1px dashed var(--line);
}
.admin-lb-list li:first-child { border-top: 0; }
.alb-rank  { color: var(--ink-muted); font-weight: 700; }
.alb-name  { color: var(--ink); }
.alb-score { color: var(--navy); font-weight: 700; }

/* ---------- Fee Calculator ---------- */

.fee-main { padding: 32px 24px 0; max-width: 880px; }

.fee-disclaimer {
  margin: 4px 0 24px;
  font-size: 13px;
  color: var(--ink-muted);
  font-style: italic;
}

.fee-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.fee-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.fee-card-header h2 { font-size: 18px; }
.fee-count {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-muted);
  font-weight: 700;
}

.people-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.person-row {
  display: grid;
  grid-template-columns: 32px 1fr auto 32px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.person-index {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--cream);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.person-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.person-select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(20,33,61,0.12);
}

.person-swatch .belt-swatch {
  width: 64px;
  height: 16px;
}
.belt-swatch.empty {
  background: #fff;
  border-style: dashed;
  border-color: var(--line);
}

.row-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.row-remove:hover { background: #fde6e4; color: #b1271f; border-color: #f4b9b3; }
.row-remove-placeholder { display: inline-block; width: 28px; height: 28px; }

.fee-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.fee-actions .btn-primary { margin-left: auto; }

.fee-error {
  margin: 12px 0 0;
  padding: 10px 14px;
  background: #fde6e4;
  border: 1px solid #f4b9b3;
  border-radius: var(--radius);
  color: #b1271f;
  font-size: 14px;
}

@media (max-width: 600px) {
  .person-row { grid-template-columns: 28px 1fr 32px; }
  .person-swatch { grid-column: 2 / 3; grid-row: 2; }
  .fee-actions { flex-direction: column; align-items: stretch; }
  .fee-actions .btn-primary { margin-left: 0; }
}

/* ---------- Fee result ---------- */

.fee-result {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.fee-total-card {
  background: var(--navy);
  color: var(--cream);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
}
.fee-total-card .eyebrow {
  color: var(--cream-soft);
  margin-bottom: 6px;
}
.fee-total {
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  color: var(--cream);
  margin: 4px 0;
}
.fee-total-suffix {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--cream-soft);
}

.breakdown-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px 22px;
}
.breakdown-header { margin-bottom: 12px; }
.breakdown-header h2 { font-size: 16px; }

.breakdown-table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.bd-row {
  display: grid;
  grid-template-columns: 32px 2fr 1fr 1fr 80px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.bd-row:first-child { border-top: 0; }
.bd-head {
  background: var(--paper);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-muted);
  font-weight: 700;
}
.bd-num { color: var(--ink-muted); font-weight: 700; }
.bd-belt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.bd-belt .belt-swatch {
  flex: 0 0 auto;
  width: 40px;
  height: 12px;
}
.bd-belt-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  color: var(--ink);
}
.bd-tier { color: var(--ink-soft); }
.bd-position { color: var(--navy); font-weight: 600; }
.bd-fee { font-weight: 700; color: var(--navy); text-align: right; }

.breakdown-explain {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
}

@media (max-width: 700px) {
  .bd-row {
    grid-template-columns: 24px 1fr 70px;
    grid-template-areas:
      "num  belt fee"
      ".    tier tier"
      ".    pos  pos";
    row-gap: 4px;
  }
  .bd-num      { grid-area: num; }
  .bd-belt     { grid-area: belt; }
  .bd-fee      { grid-area: fee; text-align: right; }
  .bd-tier     { grid-area: tier; font-size: 12px; color: var(--ink-muted); }
  .bd-position { grid-area: pos;  font-size: 12px; }
  .bd-head { display: none; }
}

/* ---------- Stances Memo ---------- */

.btn-lg { padding: 14px 28px; font-size: 16px; }

.memo-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin: 8px 0 24px;
}
.memo-option-group .menu-section-title { margin-top: 0; }

.memo-toggle {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px;
  gap: 4px;
}
.memo-toggle-btn {
  padding: 8px 16px;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-soft);
  border-radius: 4px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.memo-toggle-btn:hover { color: var(--navy); }
.memo-toggle-btn.is-active {
  background: var(--navy);
  color: var(--cream);
}

.memo-menu-lb {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  margin-top: 12px;
}

@media (max-width: 600px) {
  .memo-options { grid-template-columns: 1fr; gap: 18px; }
}

/* --- Game grid --- */

.memo-grid {
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
}
.memo-grid[data-tiles="8"]  { grid-template-columns: repeat(4, 1fr); }
.memo-grid[data-tiles="12"] { grid-template-columns: repeat(4, 1fr); }
.memo-grid[data-tiles="16"] { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 520px) {
  .memo-grid[data-tiles="8"],
  .memo-grid[data-tiles="12"],
  .memo-grid[data-tiles="16"] {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}

/* --- Tiles --- */

.memo-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  perspective: 800px;
  border-radius: 12px;
}
.memo-tile:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Two faces stacked, only one shown at a time. We toggle .is-flipped to swap. */
.memo-tile-back,
.memo-tile-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  backface-visibility: hidden;
  transition: transform 320ms ease;
  border: 1px solid var(--line);
  overflow: hidden;
}

.memo-tile-back {
  background: var(--navy) url('../img/logo-bg.png') center / cover no-repeat;
  border-color: var(--navy);
  transform: rotateY(0deg);
}

.memo-tile-face {
  background: #fff;
  transform: rotateY(180deg);
}
.memo-tile.is-flipped .memo-tile-back { transform: rotateY(-180deg); }
.memo-tile.is-flipped .memo-tile-face { transform: rotateY(0deg); }

.memo-tile.is-matched .memo-tile-face {
  background: #e7f6ea;
  border-color: #9ed3a8;
  box-shadow: inset 0 0 0 2px #9ed3a8;
}
.memo-tile.is-matched { cursor: default; }
.memo-tile.is-matched .memo-tile-back { display: none; }

/* Image face fills the tile; text face shows the stance name centred. */
.memo-face-img {
  padding: 4px;
}
.memo-face-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.memo-face-text {
  padding: 8px;
  background: var(--cream-soft);
}
.memo-face-text .memo-text {
  display: block;
  text-align: center;
  font-weight: 700;
  color: var(--navy);
  font-size: 15px;
  line-height: 1.2;
  word-break: break-word;
  hyphens: auto;
}
@media (min-width: 700px) {
  .memo-face-text .memo-text { font-size: 17px; }
}

/* Memo HUD reuses .game-hud — but the grid is 3 evenly-weighted columns
 * with the time stand-out in the middle. We keep the centred Time variant
 * via the .hud-score class (already styled bigger in the Numbers theme). */
.memo-actions {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

/* Result leaderboard for memo — adds time + moves columns */
.memo-lb .lb-entry {
  grid-template-columns: 32px 1fr auto auto;
  gap: 14px;
}
.memo-lb .lb-time  { color: var(--navy); font-weight: 700; }
.memo-lb .lb-moves { color: var(--ink-muted); font-size: 12px; }

@media (max-width: 480px) {
  .memo-lb .lb-entry {
    grid-template-columns: 24px 1fr auto;
    grid-template-areas:
      "rank name time"
      ".    name moves";
    column-gap: 10px;
    row-gap: 2px;
  }
  .memo-lb .lb-rank  { grid-area: rank; }
  .memo-lb .lb-name  { grid-area: name; }
  .memo-lb .lb-time  { grid-area: time; }
  .memo-lb .lb-moves { grid-area: moves; text-align: right; }
}

/* =====================================================================
 * MOBILE PASS — everything that needs adjusting at phone width.
 * Breakpoint 768px catches modern phones in landscape and tablets in portrait.
 * The hamburger nav lives here too so the markup is one block.
 * ===================================================================== */
@media (max-width: 768px) {
  /* --- Header / nav --- */
  .header-inner {
    position: relative;
    padding: 12px 16px;
    gap: 8px;
  }
  .nav-toggle { display: inline-flex; }

  /* Slide-down panel anchored under the header. Hidden until JS adds .is-open. */
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--navy);
    border-top: 1px solid var(--navy-line);
    padding: 8px 12px 12px;
    gap: 0;
    box-shadow: 0 8px 16px -10px rgba(0,0,0,0.4);
    z-index: 50;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a {
    padding: 14px 12px;
    border-radius: var(--radius);
    font-size: 16px;
    border-top: 1px solid var(--navy-line);
  }
  .site-nav a:first-child { border-top: 0; }

  /* Brand: keep logo + main name; subtitle is decorative, drop it on the smallest screens. */
  .brand-text strong { font-size: 14px; }
  .brand-text span   { font-size: 11px; }

  /* --- Typography --- */
  h1 { font-size: 28px; line-height: 1.2; }
  h2 { font-size: 19px; }
  .lead { font-size: 15px; }

  /* --- Containers --- */
  .container { padding: 0 16px; }

  /* --- Hero / card grid --- */
  .hero { padding: 28px 16px 8px; }
  .card-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 18px 0;
  }
  .big-card { padding: 18px 18px 16px; }

  /* --- Footer --- */
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  /* --- Grading --- */
  .grading-layout { padding: 20px 16px 0; gap: 18px; }

  /* --- Glossary --- */
  .glossary-main { padding: 20px 16px 0; }

  /* --- Game shared --- */
  .game-main { padding: 20px 16px 0; }
  .game-hud { padding: 12px 14px; gap: 8px; }
  .hud-value { font-size: 22px; }
  .hud-score .hud-value { font-size: 26px; }
  .hud-value-sm { font-size: 14px; }
  .hud-label { font-size: 10px; }

  /* --- Numbers Ninja stage --- */
  .stage { padding: 24px 16px 22px; }

  /* --- Japanese Master big term — JS sets exact size, but cap so super-long
         phrases still fit on a 320px screen. --- */
  .big-term { font-size: clamp(28px, 8vw, 56px) !important; margin-bottom: 18px; }
  .term-direction { margin-bottom: 4px; }

  /* --- Stances Memo --- */
  .memo-options { gap: 14px; margin-bottom: 18px; }
  .memo-toggle-btn { padding: 10px 14px; font-size: 13px; }
  .memo-grid { gap: 8px; margin: 12px 0 14px; }

  /* --- Result card --- */
  .result-card { padding: 22px 18px; }
  .big-score { font-size: 72px; }

  /* --- Fee Calc --- */
  .fee-main { padding: 20px 16px 0; }
  .fee-card { padding: 16px; }

  /* --- Admin --- */
  .admin-main { padding: 20px 16px 0; }
  .admin-bar { flex-wrap: wrap; gap: 8px; }

  /* --- About --- */
  .about-main { padding: 20px 16px 0; }
  .contact-section { padding: 18px; }

  /* --- Logo preview links etc — leave default --- */
}

/* ---------- Bootcamp 2026 ---------- */

.bootcamp-main { padding: 32px 24px 0; max-width: 880px; }

.bootcamp-hero {
  background: var(--navy);
  color: var(--cream);
  border-radius: var(--radius-lg);
  padding: 40px 28px 36px;
  text-align: center;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.bootcamp-eyebrow {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 700;
  color: var(--cream-soft);
  opacity: 0.85;
}
.bootcamp-hero h1 {
  color: var(--cream);
  font-size: 44px;
  margin: 6px 0 8px;
  letter-spacing: -0.5px;
}
.bootcamp-dates {
  margin: 0;
  font-size: 18px;
  color: var(--cream);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.bootcamp-sub {
  margin: 12px auto 0;
  color: var(--cream-soft);
  max-width: 56ch;
  font-size: 15px;
  line-height: 1.55;
}

/* Venue legend */
.venue-key {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 22px;
}
.venue-key-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
}
.venue-key-row strong {
  display: block;
  color: var(--navy);
  font-size: 13px;
}
.venue-key-sub {
  display: block;
  color: var(--ink-muted);
  font-size: 12px;
  margin-top: 1px;
}

.venue-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.venue-dot-primary { background: var(--navy); }
.venue-dot-accent  { background: var(--accent); }

/* Day cards */
.day-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 14px;
}
.day-card.is-special {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(200, 157, 44, 0.25) inset;
}

.day-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.day-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.day-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.3px;
}
.day-date {
  font-size: 16px;
  color: var(--ink-soft);
  font-weight: 600;
}
.day-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
}
.day-tag-accent {
  background: var(--cream);
  color: var(--navy);
}
.day-venue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 600;
}

/* Slots */
.slots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.slot {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  background: var(--paper);
  border-radius: var(--radius);
}
.slot.is-break {
  background: transparent;
  color: var(--ink-muted);
  font-style: italic;
}
.slot.is-headline {
  background: var(--cream-soft);
  border: 1px solid var(--cream);
  align-items: flex-start;
}
.slot-time {
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  letter-spacing: 0.3px;
}
.slot-event {
  color: var(--ink);
  line-height: 1.4;
}
.slot-event strong { color: var(--navy); }
.slot-note {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-muted);
  font-style: italic;
  line-height: 1.45;
}
.slot-grades {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--ink-muted);
  background: #fff;
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.slot.is-break .slot-grades { display: none; }
.slot-grades.is-high {
  color: #8a6810;
  background: var(--cream-soft);
  border-color: var(--cream);
}

/* Rest day (Bank Holiday) */
.day-card.is-rest {
  text-align: center;
  background: var(--cream-soft);
  border-style: dashed;
  border-color: var(--cream);
}
.day-card.is-rest .day-card-header {
  justify-content: center;
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}
.rest-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--accent);
  background: #fff;
  padding: 4px 12px;
  border-radius: 999px;
}
.rest-message {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

/* Fundraiser card */
.fundraiser-card {
  margin-top: 26px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 100%);
  color: var(--cream);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.fundraiser-card::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 4px;
  background: var(--accent);
}
.fundraiser-tag {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--accent);
}
.fundraiser-card h2 {
  color: var(--cream);
  margin: 0 0 6px;
  font-size: 26px;
}
.fundraiser-time {
  margin: 0 0 14px;
  color: var(--cream-soft);
  font-weight: 600;
  font-size: 15px;
}
.fundraiser-body {
  margin: 0 0 16px;
  color: var(--cream-soft);
  line-height: 1.6;
  font-size: 14px;
  max-width: 60ch;
}
.fundraiser-body strong { color: var(--cream); }
.fundraiser-venue {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(245, 232, 168, 0.3);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--cream-soft);
  margin-bottom: 18px;
}
.fundraiser-venue .venue-dot { width: 8px; height: 8px; }
.fundraiser-cta {
  background: var(--cream);
  color: var(--navy);
  border-color: var(--cream);
  font-weight: 700;
  padding: 12px 22px;
}
.fundraiser-cta:hover {
  background: var(--cream-soft);
  border-color: var(--cream-soft);
  color: var(--navy);
  text-decoration: none;
}

/* Mobile */
@media (max-width: 768px) {
  .bootcamp-main { padding: 20px 16px 0; }
  .bootcamp-hero { padding: 28px 18px; }
  .bootcamp-hero h1 { font-size: 32px; }
  .bootcamp-dates { font-size: 16px; }

  .venue-key { grid-template-columns: 1fr; gap: 8px; margin-bottom: 16px; }

  .day-card { padding: 16px 16px; }
  .day-name { font-size: 19px; }
  .day-date { font-size: 14px; }
  .day-card-header { gap: 6px; }

  .slot {
    grid-template-columns: 1fr auto;
    gap: 6px 12px;
    padding: 10px 12px;
  }
  .slot-time {
    grid-column: 1 / 3;
    font-size: 13px;
    color: var(--accent);
  }
  .slot-event { grid-column: 1 / 2; font-size: 14px; }
  .slot-grades { grid-column: 2 / 3; font-size: 10px; padding: 3px 8px; }
  .slot.is-headline { padding: 12px 14px; }

  .fundraiser-card { padding: 22px 18px; }
  .fundraiser-card h2 { font-size: 22px; }
}

/* ---------- News ---------- */

.news-main { padding: 32px 24px 0; max-width: 760px; }

.news-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.news-header h1 { margin: 6px 0 0; }

.news-empty {
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
}

.news-list {
  display: grid;
  gap: 18px;
  margin: 8px 0 32px;
}

.news-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px 22px;
}
.news-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.news-card-meta {
  font-size: 13px;
  color: var(--ink-muted);
  letter-spacing: 0.2px;
}
.news-card-meta time { font-weight: 600; color: var(--ink-soft); }
.news-card-meta span { color: var(--ink-soft); font-weight: 600; }

.news-expires-badge {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fde6e4;
  color: #b1271f;
  margin-left: 8px;
}

.news-actions {
  display: flex;
  gap: 6px;
}

.news-card-title {
  font-size: 22px;
  margin: 6px 0 10px;
  color: var(--navy);
  line-height: 1.25;
}
.news-card-body {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 14px;
}

/* Image gallery — fits the photo entirely (object-fit: contain) so portraits
 * don't get cropped. Background fills the empty area. Click to zoom. */
.news-images { margin-top: 6px; }

.news-images.images-1 .news-image {
  display: block;
  width: 100%;
  max-height: 520px;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  background: var(--paper);
  border-radius: var(--radius);
  cursor: zoom-in;
}

/* For multiple images, fixed-aspect square tiles with the image fitted in. */
.news-images.images-2,
.news-images.images-many {
  display: grid;
  gap: 8px;
}
.news-images.images-2 { grid-template-columns: 1fr 1fr; }
.news-images.images-many {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.news-images.images-2 .news-image,
.news-images.images-many .news-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--paper);
  border-radius: var(--radius);
  cursor: zoom-in;
}

/* ---------- Modal (Add/Edit news) ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 16px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 33, 61, 0.55);
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px -10px rgba(0,0,0,0.45);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-close {
  width: 32px; height: 32px;
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: var(--ink-muted);
  cursor: pointer;
}
.modal-close:hover { background: var(--paper); color: var(--ink); }

.modal-body {
  padding: 18px 22px 16px;
  overflow-y: auto;
  display: grid;
  gap: 14px;
}
.modal-body .form-row { gap: 6px; }
.modal-body input[type="text"],
.modal-body input[type="date"],
.modal-body input[type="email"],
.modal-body textarea {
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.modal-body textarea { min-height: 140px; resize: vertical; }
.modal-body input:focus, .modal-body textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(20,33,61,0.12);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.form-hint {
  font-size: 12px;
  color: var(--ink-muted);
}

/* image grid in modal */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  min-height: 12px;
}
.image-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.image-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.image-thumb-remove:hover { background: rgba(0,0,0,0.85); }
.image-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.modal-actions .contact-status { margin-right: auto; font-size: 13px; }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 100%;
  max-height: 92vh;
  object-fit: contain;
  display: block;
}
.lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

/* mobile tweaks for News */
@media (max-width: 768px) {
  .news-main { padding: 20px 16px 0; }
  .news-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .news-header h1 { font-size: 24px; }
  .news-card { padding: 16px 16px 18px; }
  .news-card-title { font-size: 18px; }
  .modal { padding: 0; align-items: stretch; }
  .modal-card { max-height: 100vh; border-radius: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-actions { padding-bottom: 22px; }
}

/* ---------- About page ---------- */

.about-main { padding: 32px 24px 0; max-width: 880px; }

.about-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
  margin: 16px 0 36px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.about-photo-wrap {
  width: 100%;
}

/* Rectangular portrait — corners just rounded, never cropped. */
.profile-photo {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.about-bio p {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.6;
}
.about-bio p:last-child { margin-bottom: 0; }

/* Contact form */

.contact-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px 24px;
  margin-bottom: 32px;
}
.contact-section h2 { margin-bottom: 4px; }
.contact-sub { margin: 0 0 18px; }

.contact-form {
  display: grid;
  gap: 14px;
}
.form-row {
  display: grid;
  gap: 6px;
}
.form-row label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-muted);
  font-weight: 700;
}
.form-row input,
.form-row textarea {
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
  width: 100%;
  box-sizing: border-box;
}
.form-row textarea {
  resize: vertical;
  min-height: 120px;
}
.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(20,33,61,0.12);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.contact-status {
  font-size: 14px;
  color: var(--ink-soft);
}
.contact-status.is-pending { color: var(--ink-muted); }
.contact-status.is-ok      { color: #1e6e2c; font-weight: 600; }
.contact-status.is-err     { color: #b1271f; font-weight: 600; }

/* Honeypot — hidden but not display:none (some bots skip those). */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

@media (max-width: 700px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px;
  }
  .about-photo-wrap {
    max-width: 240px;
    margin: 0 auto;
  }
}

/* Tighten further on the smallest phones (e.g. 320px iPhone SE). */
@media (max-width: 380px) {
  .brand-text span { display: none; }   /* hide "Karate Academy" subtitle */
  .brand-mark { width: 38px; height: 38px; }
  h1 { font-size: 24px; }
  .big-score { font-size: 60px; }
  .big-number { font-size: 92px; }
  #countdown-num { font-size: 64px; }

  /* memo: 3 cols already kicks in at 520px, but on 320px gap should shrink */
  .memo-grid { gap: 6px; }
  .memo-face-text .memo-text { font-size: 13px; }
}

/* ---------- Unofficial-fanpage notice (homepage) ---------- */

.unofficial-notice {
  background: var(--cream-soft);
  border: 1px solid var(--cream);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 18px 16px;
  margin: 18px 0 28px;
  max-width: 720px;
}
.unofficial-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  background: var(--navy);
  border: 1px solid var(--navy);
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.unofficial-notice p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}
.unofficial-notice p strong { color: var(--navy); }
.unofficial-notice .unofficial-disclaimer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--cream);
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-muted);
}

@media (max-width: 720px) {
  .unofficial-notice { padding: 12px 14px 14px; margin: 14px 0 22px; }
  .unofficial-notice p { font-size: 13px; }
}

/* ---------- Calendar ---------- */

.calendar-main { padding: 32px 24px 0; max-width: 880px; }

.calendar-hero {
  background: var(--navy);
  color: var(--cream);
  border-radius: var(--radius-lg);
  padding: 36px 28px 32px;
  text-align: center;
  margin-bottom: 22px;
}
.calendar-eyebrow {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 700;
  color: var(--cream-soft);
  opacity: 0.85;
}
.calendar-hero h1 {
  color: var(--cream);
  font-size: 40px;
  margin: 6px 0 8px;
  letter-spacing: -0.5px;
}
.calendar-sub {
  margin: 8px auto 0;
  color: var(--cream-soft);
  max-width: 56ch;
  font-size: 15px;
  line-height: 1.55;
}

.month-section { margin: 0 0 22px; }
.month-title {
  font-size: 22px;
  color: var(--navy);
  margin: 22px 0 10px;
  letter-spacing: -0.3px;
  font-weight: 800;
}

/* Single event row */
.event-row {
  display: grid;
  grid-template-columns: 160px 1fr 220px;
  gap: 14px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 8px;
}
.event-row.is-feature {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(200, 157, 44, 0.25) inset;
}
.event-when {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.event-date {
  font-weight: 800;
  color: var(--navy);
  font-size: 15px;
  letter-spacing: -0.2px;
}
.event-time {
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.event-what {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.event-what strong {
  color: var(--navy);
  font-size: 15px;
  line-height: 1.3;
}
.event-detail {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.45;
}
.event-where {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 600;
  text-align: right;
  justify-self: end;
  line-height: 1.35;
}
.event-where:empty { visibility: hidden; }

/* Closure / notice card */
.calendar-notice {
  background: var(--cream-soft);
  border: 1px dashed var(--cream);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 8px;
  text-align: center;
}
.calendar-notice strong:first-child {
  display: block;
  color: var(--accent);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
  font-weight: 700;
}
.calendar-notice p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}
.calendar-notice p strong { color: var(--navy); }

/* Empty state when every month has passed */
.calendar-empty {
  text-align: center;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  color: var(--ink-muted);
}
.calendar-empty p { margin: 0; font-size: 15px; }

/* Mobile */
@media (max-width: 720px) {
  .calendar-main { padding: 20px 16px 0; }
  .calendar-hero { padding: 26px 18px 24px; }
  .calendar-hero h1 { font-size: 30px; }

  .month-title { font-size: 18px; margin: 18px 0 8px; }

  .event-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 14px;
  }
  .event-when { flex-direction: row; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .event-date { font-size: 14px; }
  .event-where {
    justify-self: start;
    text-align: left;
    font-size: 11px;
  }
}
