/* ApologyGrader — shared styles for the Wall, the Dictionary and the admin page.
   (The grader page keeps its own styles inline.) */
:root {
  --bg: #f7f5f0; --card: #ffffff; --ink: #15141a; --muted: #66646e; --line: #e4e0d7; --soft: #efece5;
  --accent: #f0412c; --hi: #ffe14d; --hi-ink: #15141a; --good: #198a5c; --bad: #d23a28;
  --stage: #15141a; --stage-ink: #f7f5f0; --stage-muted: #a6a3ad; --scorecard: #fffdf6;
  --shadow: 0 1px 2px rgba(21,20,26,.06), 0 8px 24px rgba(21,20,26,.06);
  --display: "Arial Black", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111016; --card: #1a1921; --ink: #f3f1ea; --muted: #a3a1ad; --line: #2d2b36; --soft: #22212b;
    --accent: #ff5a43; --hi: #ffd84a; --good: #3cc489; --bad: #ff6a55; --stage: #08080b;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body); }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* Top nav */
.topnav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 900 1rem/1 var(--display); text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; background: var(--ink); color: var(--bg); border-radius: 8px; font: 900 1.05rem/1 var(--display); transform: rotate(-6deg); }
.navlinks { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.navlinks a { text-decoration: none; font-weight: 700; font-size: .92rem; padding: 7px 12px; border-radius: 999px; color: var(--muted); }
.navlinks a:hover { color: var(--ink); background: var(--soft); }
.navlinks a[aria-current="page"] { color: var(--ink); background: var(--card); box-shadow: var(--shadow); }

/* Headings */
.page-head { padding: 22px 0 8px; }
.eyebrow { font: 900 .78rem/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
h1 { font: 900 clamp(2rem, 6vw, 3.2rem)/1.04 var(--display); letter-spacing: -.02em; margin: 0 0 12px; }
.lede { color: var(--muted); font-size: 1.08rem; margin: 0; max-width: 640px; }
h2.sec { font: 900 .82rem/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 34px 0 14px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 11px; padding: 12px 18px; cursor: pointer;
  background: var(--accent); color: #fff; font: 900 1rem/1 var(--display); text-decoration: none;
}
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); font: 700 .92rem/1 var(--body); padding: 9px 14px; }
.btn.small { font: 700 .88rem/1 var(--body); padding: 8px 12px; }
.btn:focus-visible, .chip:focus-visible, .navlinks a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 13px; font-size: .9rem; font-weight: 600; text-decoration: none; }
.chip[aria-current="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Grade tiles */
.tile {
  flex: none; width: 64px; height: 72px; border-radius: 10px; background: var(--stage); color: var(--stage-ink);
  display: grid; place-items: center; text-align: center; transform: rotate(-3deg);
}
.tile .g { font: 900 1.9rem/1 var(--display); letter-spacing: -.03em; }
.tile .s { font-size: .62rem; color: var(--stage-muted); font-weight: 700; margin-top: 2px; }
.tile.big { width: 120px; height: 136px; border-radius: 14px; }
.tile.big .g { font-size: 4rem; }
.tile.big .s { font-size: .78rem; margin-top: -6px; }
.tier-a .g { color: #5fe3a1; } .tier-b .g { color: #ffe14d; } .tier-c .g { color: #ffb347; }
.tier-d .g, .tier-f .g { color: #ff6a55; }

/* Wall */
.potd { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; background: var(--stage); color: var(--stage-ink); border-radius: var(--radius); padding: 24px; text-decoration: none; box-shadow: var(--shadow); }
.potd .tile { background: var(--scorecard); }
.potd .tile .s { color: #66646e; }
.potd .tier-a .g { color: #198a5c; } .potd .tier-b .g { color: #b38600; } .potd .tier-c .g { color: #d9822b; }
.potd .tier-d .g, .potd .tier-f .g { color: #d23a28; }
.potd .kick { font: 900 .78rem/1 var(--display); letter-spacing: .14em; color: var(--hi); text-transform: uppercase; }
.potd .who { font: 900 1.5rem/1.15 var(--display); margin: 8px 0 6px; }
.potd .v { color: #d6d3dc; font-size: 1.05rem; margin: 0; }
.potd:hover .who { text-decoration: underline; text-underline-offset: 4px; }
.controls { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin: 28px 0 14px; }
.wall-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.entry { display: flex; gap: 16px; align-items: center; text-decoration: none; padding: 16px; }
.entry:hover { border-color: var(--ink); }
.entry .who { font: 900 1.02rem/1.2 var(--display); margin: 0; }
.entry .meta { font-size: .8rem; color: var(--muted); font-weight: 600; margin: 3px 0 4px; }
.entry .v { font-size: .92rem; margin: 0; line-height: 1.4; }
.pager { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
.empty { text-align: center; padding: 40px 22px; }
.empty p { color: var(--muted); }

/* Dictionary */
.dict-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dict-card { display: block; text-decoration: none; padding: 18px; }
.dict-card:hover { border-color: var(--ink); }
.dict-card .ph { font: 900 1.08rem/1.25 var(--display); margin: 0 0 6px; }
.dict-card .tr { margin: 0; color: var(--muted); font-size: .94rem; }
.phrase-big {
  font: 900 clamp(1.9rem, 5.6vw, 3rem)/1.1 var(--display); letter-spacing: -.02em; margin: 0 0 18px;
}
.phrase-big mark { background: var(--hi); color: var(--hi-ink); border-radius: 6px; padding: 0 .12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.translation { background: var(--stage); color: var(--stage-ink); border-radius: var(--radius); padding: 20px 22px; }
.translation .lbl { font: 900 .75rem/1 var(--display); letter-spacing: .14em; color: var(--hi); text-transform: uppercase; }
.translation p { font: 900 clamp(1.25rem, 3.6vw, 1.6rem)/1.25 var(--display); margin: 8px 0 0; }
.prose p { margin: 0 0 14px; }
.prose p:last-child { margin-bottom: 0; }
.instead { border-left: 5px solid var(--good); }
.instead blockquote { margin: 0; font-size: 1.05rem; font-weight: 600; }
.badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.badge { font-size: .78rem; font-weight: 800; border-radius: 999px; padding: 4px 10px; background: var(--soft); color: var(--muted); text-decoration: none; }
.badge.bingo { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

/* Admin */
.adm-item { display: grid; gap: 10px; }
.adm-item + .adm-item { margin-top: 12px; }
.adm-head { display: flex; gap: 14px; align-items: center; }
.adm-text { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: .93rem; max-height: 220px; overflow: auto; }
.adm-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.adm-actions form { margin: 0; }
.btn.ok { background: var(--good); } .btn.no { background: var(--bad); }
.flash { background: var(--soft); border-radius: 10px; padding: 10px 14px; font-weight: 600; }
input.field { width: 100%; border: 1.5px solid var(--line); background: var(--bg); border-radius: 10px; padding: 11px 13px; }

/* Footer + tip */
.tip-jar { text-align: center; margin: 40px auto 0; max-width: 520px; }
.tip-text { color: var(--muted); font-style: italic; margin: 0 0 12px; }
.tip-button { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; background: #ffdd00; color: #000; font-weight: 700; border-radius: 8px; text-decoration: none; box-shadow: 0 4px 6px rgba(0,0,0,.08); }
.tip-button:hover { background: #ffe633; }
footer { margin: 48px 0 0; padding: 26px 0 40px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .88rem; }
footer nav { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }

@media (max-width: 680px) {
  .card { padding: 18px; }
  .wall-list, .dict-grid { grid-template-columns: 1fr; }
  .potd { grid-template-columns: 1fr; justify-items: start; }
  .brand-text { display: none; }
  .navlinks a { padding: 7px 10px; font-size: .88rem; }
}
