/* Scout Communication Centre — styles */
:root {
  --navy: #0f2742;
  --navy-2: #1d3d63;
  --red: #d62828;
  --yellow: #f4c430;
  --khaki: #f1e9d6;
  --sand: #e6d9b8;
  --paper: #fffbf2;
  --ink: #1b2230;
  --muted: #5d6878;
  --line: #e1d5b8;
  --green: #23874f;
  --green-bg: #e3f4e8;
  --amber: #b86e00;
  --amber-bg: #fff2d6;
  --err: #b42318;
  --err-bg: #fde8e6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 39, 66, .06), 0 6px 22px rgba(15, 39, 66, .08);
  --head: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.55; color: var(--ink);
  background: var(--khaki);
  background-image: radial-gradient(rgba(15, 39, 66, .045) 1px, transparent 1px);
  background-size: 18px 18px;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; padding: 1.4rem 0 2.5rem; }
a { color: var(--navy-2); }
a:hover { color: var(--red); }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; color: var(--navy); margin: 0 0 .6rem; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; }
h2 { font-size: 1.45rem; font-weight: 700; margin-top: 1.2rem; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 .8rem; }
img { max-width: 100%; }
code { background: #f3ecdc; padding: .1em .35em; border-radius: 5px; font-size: .92em; word-break: break-all; }
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 680px; }
.container.mid { max-width: 900px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 99; background: #fff; padding: .5rem 1rem; }

/* Header */
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 40; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.site-header::after { content: ''; display: block; height: 4px; background: linear-gradient(90deg, var(--red) 0 50%, var(--yellow) 50% 100%); }
.header-row { display: flex; align-items: center; gap: 1rem; min-height: 62px; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; margin-right: auto; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-family: var(--head); font-size: 1.18rem; font-weight: 700; letter-spacing: .2px; }
.brand small { color: #b9c8db; font-size: .74rem; letter-spacing: .6px; text-transform: uppercase; }
.brand:hover { color: var(--yellow); }
.main-nav { display: flex; align-items: center; gap: .15rem; flex-wrap: wrap; }
.main-nav > a, .main-nav summary { color: #e8eef6; text-decoration: none; padding: .45rem .6rem; border-radius: 8px; font-weight: 600; font-size: .95rem; cursor: pointer; }
.main-nav > a:hover, .main-nav summary:hover { background: rgba(255,255,255,.1); color: #fff; }
.main-nav > a.on { background: rgba(244,196,48,.18); color: var(--yellow); }
.main-nav .soon { font-style: normal; font-size: .62rem; text-transform: uppercase; background: rgba(255,255,255,.14); padding: .05rem .3rem; border-radius: 4px; vertical-align: 2px; }
.nav-sep { width: 1px; height: 22px; background: rgba(255,255,255,.2); margin: 0 .35rem; }
.main-nav .lang { border: 1px solid rgba(255,255,255,.35); font-size: .8rem; padding: .25rem .5rem; margin-left: .2rem; }
.me-chip { background: rgba(255,255,255,.08); }
.menu { position: relative; }
.menu summary { list-style: none; display: flex; align-items: center; gap: .4rem; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary img { width: 24px; height: 24px; border-radius: 50%; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; color: var(--ink); border-radius: 12px; box-shadow: var(--shadow); min-width: 230px; padding: .5rem; display: flex; flex-direction: column; z-index: 50; }
.menu-pop small { color: var(--muted); padding: .3rem .6rem .5rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; word-break: break-all; }
.menu-pop a { padding: .45rem .6rem; border-radius: 8px; text-decoration: none; color: var(--ink); }
.menu-pop a:hover { background: var(--khaki); }
.nav-toggle { display: none; background: none; border: 0; padding: .5rem; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 3px; background: #fff; margin: 4px 0; border-radius: 2px; }
@media (max-width: 1060px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 66px; background: var(--navy); flex-direction: column; align-items: stretch; padding: .5rem 16px 1rem; }
  .main-nav.open { display: flex; }
  .nav-sep { display: none; }
  .menu-pop { position: static; box-shadow: none; margin-top: .3rem; }
  .brand small { display: none; }
}

/* Cards, buttons, forms */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); margin-bottom: 1.2rem; }
.card.center { text-align: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; background: var(--navy); color: #fff; border: 0; border-radius: 10px; padding: .6rem 1.1rem; font: 700 1rem var(--body); text-decoration: none; cursor: pointer; transition: transform .08s, background .15s; }
.btn:hover { background: var(--navy-2); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-red { background: var(--red); }
.btn-red:hover { background: #b51f1f; }
.btn-yellow { background: var(--yellow); color: var(--navy); }
.btn-yellow:hover { background: #e7b51f; color: var(--navy); }
.btn-light { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn-light:hover { background: var(--khaki); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--navy); border: 1px dashed var(--muted); }
.btn-ghost:hover { background: #fff; color: var(--navy); }
.btn-google { background: #fff; color: #1f1f1f; border: 1px solid #c9c9c9; }
.btn-google:hover { background: #f5f5f5; color: #1f1f1f; }
.btn-sm { padding: .32rem .7rem; font-size: .88rem; border-radius: 8px; }
.btn-big { padding: .8rem 1.5rem; font-size: 1.08rem; }
.btn-danger { background: var(--err); }
.site-header .btn-light, .main-nav > a.btn-light { padding: .35rem .8rem; color: var(--navy); }
.main-nav > a.btn-light:hover { color: var(--navy); background: var(--yellow); }
.form label { display: block; font-weight: 700; margin-bottom: .9rem; color: var(--navy); }
.form input[type=text], .form input:not([type]), .form input[type=email], .form input[type=password], .form input[type=number], .form input[type=url], .form select, .form textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .62rem .75rem; border: 1px solid #cdbf9e; border-radius: 10px; background: #fff; font: 400 1rem var(--body); color: var(--ink);
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 3px solid rgba(244,196,48,.55); border-color: var(--navy-2); }
.form .hint { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; margin-top: .25rem; }
.form .check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 600; }
.form .check input { margin-top: .3rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
@media (max-width: 600px) { .row2, .row3 { grid-template-columns: 1fr; } }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.inline-form label { margin-bottom: 0; }
.alert { border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; }
.alert-ok { background: var(--green-bg); border-color: #b5e0c3; color: #14532d; }
.alert-warn { background: var(--amber-bg); border-color: #f2d48f; color: #6b4100; }
.alert-error { background: var(--err-bg); border-color: #f5b5ae; color: #7a1a12; }
.alert-info { background: #e8f0fb; border-color: #c4d6f1; color: #183a66; }
.divider { display: flex; align-items: center; gap: .8rem; color: var(--muted); margin: 1.4rem 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.checklist { list-style: none; padding: 0; }
.checklist li { padding: .2rem 0; }
.checklist .ok { color: var(--green); } .checklist .bad { color: var(--err); } .checklist .warn { color: var(--amber); }
.steps li { margin-bottom: .5rem; }
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #e9e1cd; color: var(--navy); }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: var(--err-bg); color: var(--err); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.navy { background: var(--navy); color: #fff; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .94rem; }
table.data th, table.data td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); background: #f8f1e1; }
table.data tr:hover td { background: #fffdf7; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Hero / hub */
.hero { background: var(--navy); color: #fff; border-radius: 22px; padding: clamp(1.4rem, 4vw, 2.6rem); position: relative; overflow: hidden; margin-bottom: 1.6rem; box-shadow: var(--shadow); }
.hero h1 { color: #fff; font-size: clamp(1.9rem, 5vw, 3rem); max-width: 16ch; }
.hero p { color: #d4deea; max-width: 46ch; font-size: 1.07rem; }
.hero .eyebrow { color: var(--yellow); font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; font-size: .8rem; margin-bottom: .4rem; }
.hero-figs { position: absolute; right: clamp(0px, 2vw, 30px); bottom: 14px; display: flex; gap: 0; }
.hero-figs .sem-fig { width: clamp(70px, 8vw, 118px); height: auto; }
.hero-figs .sem-fig .sf-body { fill: #d8c08a; } .hero-figs .sem-fig .sf-head, .hero-figs .sem-fig .sf-neck, .hero-figs .sem-fig .sf-hand { fill: #f2c9a0; }
.hero-figs .sem-fig .sf-arm { stroke: #d8c08a; } .hero-figs .sem-fig .sf-leg { stroke: #a8915e; }
.hero-figs .sem-fig .sf-pole { stroke: #e6d9b8; }
.hero-figs .sem-fig .sf-cap { fill: var(--yellow); }
.hero .cta { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.2rem; position: relative; z-index: 2; }
.hero-inner { position: relative; z-index: 2; max-width: 600px; }
@media (max-width: 1100px) { .hero-figs { position: static; justify-content: center; margin-top: 1rem; } .hero-figs .sem-fig { width: 19%; } }
.modules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; margin-bottom: 1.6rem; }
@media (max-width: 860px) { .modules { grid-template-columns: 1fr; } }
.module { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 1.3rem; box-shadow: var(--shadow); display: flex; flex-direction: column; text-decoration: none; color: var(--ink); position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
a.module:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(15,39,66,.15); color: var(--ink); }
.module .m-art { height: 120px; display: flex; align-items: center; justify-content: center; background: #f6efdf; border-radius: 12px; margin-bottom: 1rem; }
.module h3 { font-size: 1.4rem; margin-bottom: .2rem; }
.module p { color: var(--muted); flex: 1; }
.module .status { position: absolute; top: 14px; right: 14px; }
.module .go { font-weight: 800; color: var(--red); }
.module.soon { opacity: .9; }
.module.soon .go { color: var(--muted); }
.feature-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1rem; }
.feature b { display: block; font-family: var(--head); color: var(--navy); font-size: 1.08rem; }
.morse-strip { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 3px; color: var(--navy); font-size: 1.6rem; }
.interco-mini { display: flex; gap: 6px; }
.interco-mini span { width: 34px; height: 34px; border-radius: 3px; border: 1px solid rgba(0,0,0,.15); }

/* Semaphore figures */
.sem-fig { display: block; overflow: visible; }
.sem-fig .sf-head { fill: #e9b98c; }
.sem-fig .sf-neck { fill: #e9b98c; }
.sem-fig .sf-body { fill: #6b7a4b; }
.sem-fig .sf-scarf { fill: none; stroke: var(--red); stroke-width: 5; stroke-linejoin: round; }
.sem-fig .sf-leg { stroke: #3b4a2b; stroke-width: 7; stroke-linecap: round; }
.sem-fig .sf-arm { stroke: #6b7a4b; stroke-width: 7; stroke-linecap: round; }
.sem-fig .sf-hand { fill: #e9b98c; }
.sem-fig .sf-pole { stroke: #5b4a33; stroke-width: 2.4; stroke-linecap: round; }
.sem-fig .sf-red { fill: var(--red); }
.sem-fig .sf-yellow { fill: var(--yellow); }
.sem-fig .sf-cap { font: 800 22px var(--head); fill: var(--navy); }

.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .6rem; }
.chart-cell { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .4rem .3rem .2rem; text-align: center; cursor: pointer; transition: border-color .15s, transform .1s; }
.chart-cell:hover { border-color: var(--navy-2); transform: translateY(-2px); }
.chart-cell .sem-fig { margin: 0 auto; width: 100%; height: auto; max-width: 120px; }
.chart-cell .tip { font-size: .72rem; color: var(--muted); margin-top: -2px; min-height: 1.2em; }
.chart-cell.special { background: #f6efdf; }
.mastery-dot { position: absolute; }

.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1rem 0 1.5rem; }
.mode { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 1.1rem; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: .3rem; transition: border-color .15s, transform .12s; }
.mode:hover { border-color: var(--navy); transform: translateY(-2px); color: var(--ink); }
.mode .ic { font-size: 1.9rem; line-height: 1; }
.mode b { font-family: var(--head); font-size: 1.2rem; color: var(--navy); }
.mode span { color: var(--muted); font-size: .92rem; }
.mode .tag { align-self: flex-start; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; padding: .1rem .45rem; border-radius: 5px; background: var(--navy); color: #fff; }
.mode .tag.nocam { background: var(--green); }
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.view-toggle button { border: 0; background: transparent; padding: .4rem .8rem; font: 700 .88rem var(--body); cursor: pointer; color: var(--muted); }
.view-toggle button.on, .view-toggle a.on { background: var(--navy); color: #fff; }
.view-toggle a { padding: .4rem .8rem; font: 700 .88rem var(--body); color: var(--muted); text-decoration: none; }
.toolbar { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin-bottom: .8rem; }
.toolbar .grow { flex: 1; }

/* Practice (camera) */
body.practice-page { background: #0b1b2e; background-image: none; }
body.practice-page main { padding-top: 1rem; }
.practice { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 1rem; }
@media (max-width: 900px) { .practice { grid-template-columns: 1fr; } }
.stage { position: relative; background: #000; border-radius: 18px; overflow: hidden; aspect-ratio: 4 / 3; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.stage video, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage.mirror video, .stage.mirror canvas { transform: scaleX(-1); }
.stage .overlay-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #fff; padding: 1.5rem; background: rgba(11,27,46,.82); gap: .8rem; z-index: 3; }
.stage .overlay-msg[hidden] { display: none; }
.stage .reading { position: absolute; left: 12px; top: 12px; z-index: 2; display: flex; align-items: center; gap: .6rem; }
.stage .big-letter { font: 800 3.6rem/1 var(--head); color: #fff; background: rgba(15,39,66,.75); border-radius: 14px; min-width: 84px; text-align: center; padding: .35rem .6rem .1rem; position: relative; overflow: hidden; }
.stage .big-letter .ring { position: absolute; left: 0; bottom: 0; height: 6px; background: var(--yellow); width: 0; transition: width .08s linear; }
.stage .big-letter.good { box-shadow: 0 0 0 3px #3ccf7a inset; }
.stage .big-letter.fair { box-shadow: 0 0 0 3px var(--yellow) inset; }
.stage .hint-chip { background: rgba(0,0,0,.6); color: #fff; padding: .3rem .6rem; border-radius: 8px; font-size: .9rem; max-width: 260px; }
.stage .feedback { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) scale(.6); font: 800 4.5rem var(--head); color: #fff; opacity: 0; pointer-events: none; z-index: 4; text-shadow: 0 4px 20px rgba(0,0,0,.5); transition: opacity .2s, transform .25s; }
.stage .feedback.show { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.stage .feedback.ok { color: #4be38c; } .stage .feedback.no { color: #ff6b6b; }
.stage .cam-controls { position: absolute; right: 10px; bottom: 10px; display: flex; gap: .4rem; z-index: 2; }
.stage .cam-controls button { background: rgba(0,0,0,.55); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 9px; padding: .35rem .6rem; font: 700 .82rem var(--body); cursor: pointer; }
.panel { background: var(--paper); border-radius: 18px; padding: 1.1rem; display: flex; flex-direction: column; gap: .8rem; }
.panel h1 { font-size: 1.5rem; margin: 0; }
.target-box { display: flex; align-items: center; gap: 1rem; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: .7rem; }
.target-box .t-letter { font: 800 4rem/1 var(--head); color: var(--red); min-width: 70px; text-align: center; }
.target-box .sem-fig { flex: 0 0 auto; }
.word-line { font: 800 2rem var(--head); letter-spacing: 6px; color: var(--muted); word-break: break-all; }
.word-line .done { color: var(--green); }
.word-line .cur { color: var(--red); text-decoration: underline; text-underline-offset: 6px; }
.scorebar { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.scorebar div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .45rem; text-align: center; }
.scorebar b { display: block; font: 800 1.6rem/1.1 var(--head); color: var(--navy); }
.scorebar small { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .4px; }
.timer.low b { color: var(--red); }
.decoded { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: .7rem; min-height: 4.2rem; font: 800 1.8rem/1.3 var(--head); color: var(--navy); letter-spacing: 3px; word-break: break-all; }
.decoded .caret { display: inline-block; width: 3px; height: 1.4rem; background: var(--red); animation: blink 1s steps(1) infinite; vertical-align: -2px; }
@keyframes blink { 50% { opacity: 0; } }
.results { text-align: center; }
.results .big { font: 800 3rem var(--head); color: var(--navy); }
.new-badges { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin: .8rem 0; }
.practice-page .site-footer { background: #08131f; }
.settings-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; font-size: .9rem; }
.settings-row label { display: flex; gap: .3rem; align-items: center; }
.tips { font-size: .9rem; color: var(--muted); padding-left: 1.1rem; margin: 0; }

/* Quiz */
.quiz-q { display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.quiz-figs { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; }
.options { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; width: 100%; max-width: 460px; }
.options button { font: 800 1.6rem var(--head); padding: .55rem; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; }
.options button:hover { border-color: var(--navy); }
.options button.right { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.options button.wrong { background: var(--err-bg); border-color: var(--err); color: var(--err); }
.progress { height: 8px; background: #eadfc6; border-radius: 99px; overflow: hidden; width: 100%; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--yellow)); width: 0; transition: width .3s; }

/* Achievements */
.profile-head { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.rank-icon { font-size: 3rem; width: 84px; height: 84px; border-radius: 50%; background: var(--navy); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 5px var(--yellow); }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: .7rem; margin: 1rem 0; }
.stat-tiles div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .7rem; }
.stat-tiles b { display: block; font: 800 1.7rem/1.1 var(--head); color: var(--navy); }
.stat-tiles small { color: var(--muted); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.badge-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .8rem; text-align: center; }
.badge-card .bi { font-size: 2.2rem; line-height: 1.1; }
.badge-card b { display: block; font-family: var(--head); color: var(--navy); }
.badge-card small { color: var(--muted); display: block; font-size: .8rem; line-height: 1.3; }
.badge-card.locked { opacity: .45; filter: grayscale(1); }
.badge-card .when { color: var(--green); font-weight: 700; margin-top: .3rem; }
.letter-grid { display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px; }
@media (max-width: 600px) { .letter-grid { grid-template-columns: repeat(7, 1fr); } }
.letter-grid div { aspect-ratio: 1; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font: 800 1.05rem/1 var(--head); background: #eee6d4; color: #9a8f78; }
.letter-grid div small { font: 600 .6rem var(--body); }
.letter-grid .l1 { background: #fdeccd; color: #8a5a00; }
.letter-grid .l2 { background: #d8f0df; color: #1d6b3d; }
.letter-grid .l3 { background: var(--green); color: #fff; }
.legend { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: .5rem; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 3px; }

/* Stats */
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg .axis { stroke: #d6c9a8; }
.chart-svg text { font: 11px var(--body); fill: var(--muted); }
.bars .bar-row { display: grid; grid-template-columns: 140px 1fr 56px; gap: .6rem; align-items: center; margin-bottom: .4rem; font-size: .92rem; }
.bars .bar-row .track { background: #efe6d1; border-radius: 6px; height: 16px; overflow: hidden; }
.bars .bar-row .fill { background: var(--navy-2); height: 100%; border-radius: 6px; }
.bars .bar-row:nth-child(2n) .fill { background: var(--red); }
.bars .bar-row:nth-child(3n) .fill { background: #c8a21e; }
@media (max-width: 520px) { .bars .bar-row { grid-template-columns: 100px 1fr 44px; } }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

/* Admin / manage */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1.2rem; }
@media (max-width: 860px) { .admin-layout { grid-template-columns: 1fr; } }
.side-nav { background: var(--navy); border-radius: 16px; padding: .8rem; display: flex; flex-direction: column; gap: .15rem; align-self: start; }
.side-nav b { color: var(--yellow); font-family: var(--head); padding: .3rem .6rem; font-size: 1.05rem; }
.side-nav a { color: #dbe5f1; text-decoration: none; padding: .45rem .6rem; border-radius: 8px; font-weight: 600; font-size: .94rem; }
.side-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-nav a.on { background: rgba(244,196,48,.18); color: var(--yellow); }
@media (max-width: 860px) { .side-nav { flex-direction: row; flex-wrap: wrap; } .side-nav b { width: 100%; } }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters label { font-weight: 700; font-size: .85rem; color: var(--navy); }
.filters select, .filters input { display: block; margin-top: .2rem; padding: .45rem .6rem; border-radius: 8px; border: 1px solid #cdbf9e; font: 400 .95rem var(--body); background: #fff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.kpis div { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: .9rem; box-shadow: var(--shadow); }
.kpis b { display: block; font: 800 1.9rem/1.1 var(--head); color: var(--navy); }
.kpis small { color: var(--muted); }
.pill-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.pill-list form { display: inline; }
.leader-row-me td { background: #fff4cf !important; }
.medal { font-size: 1.2rem; }

/* Footer */
.site-footer { background: var(--navy); color: #c6d3e3; padding: 1.8rem 0 1rem; margin-top: auto; font-size: .92rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--yellow); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 1.5rem; align-items: start; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; } }
.foot-brand { display: flex; align-items: center; gap: .5rem; font-family: var(--head); color: #fff; font-size: 1.1rem; margin-bottom: .4rem; }
.site-footer .muted { color: #9fb1c7; }
.foot-links { display: flex; flex-direction: column; gap: .2rem; }
.foot-links strong { color: var(--yellow); font-family: var(--head); }
.foot-links a { text-decoration: none; }
.foot-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; text-decoration: none; }
.foot-stats span { background: rgba(255,255,255,.06); border-radius: 10px; padding: .45rem .6rem; color: #b9c8db; font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; }
.foot-stats b { display: block; color: #fff; font: 800 1.35rem/1.1 var(--head); letter-spacing: 0; }
.foot-stats .online b::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3ccf7a; margin-right: 6px; vertical-align: 3px; box-shadow: 0 0 0 3px rgba(60,207,122,.25); }
.credit { border-top: 1px solid rgba(255,255,255,.12); margin-top: 1.3rem; padding-top: .9rem; text-align: center; font-size: .86rem; color: #9fb1c7; }

.dialog { border: 0; border-radius: 18px; padding: 0; max-width: 520px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.dialog::backdrop { background: rgba(11,27,46,.6); }
.dialog .dlg-body { padding: 1.3rem; background: var(--paper); }
.dialog .dlg-fig { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

@media print { .site-header, .site-footer, .no-print { display: none !important; } body { background: #fff; } .card { box-shadow: none; } }
