/* Shared by all WhichTagAmI games: colours, top bar, buttons, chips, infobox parts. */

:root {
  --bg: #f6f6f6;
  --surface: #ffffff;
  --box: #f8f9fa;
  --box-head: #eaecf0;
  --border: #c8ccd1;
  --border-strong: #a2a9b1;
  --text: #202122;
  --muted: #54595d;
  --link: #0645ad;
  --link-hover: #0b0080;
  --primary: #3366cc;
  --primary-soft: #eaf3ff;
  --good: #14866d;
  --bad: #b32424;
  --mono: Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text); font: 15px/1.4 var(--sans);
}

a { color: var(--link); }

a:hover { color: var(--link-hover); }

button { font: inherit; cursor: pointer; }

code, .mono { font-family: var(--mono); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* top bar */

.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 10px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; min-height: 58px;
}

.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }

.progress { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 600; }

.spacer { flex: 1 1 0; }

.score { font-weight: 600; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.tally { font-variant-numeric: tabular-nums; }

.mode-switch { font-weight: 400; font-size: 14px; }

/* layout */

.app {
  width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px;
  display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; align-content: flex-start; flex: 1 0 auto;
}

.col-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.panel { background: var(--surface); border: 1px solid var(--border); padding: 20px; display: flex; flex-direction: column; gap: 14px; }

h1 { margin: 0; font-size: 20px; }

/* answer row */

.label { font-size: 13px; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.btn {
  min-height: 44px; padding: 0 18px; border-radius: 2px; font-size: 16px;
  background: var(--box); color: var(--text); border: 1px solid var(--border-strong);
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
}

.btn:hover { background: var(--box-head); color: var(--text); }

.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; padding: 0 22px; }

.btn.primary:hover { background: #2a4b8d; border-color: #2a4b8d; }

.btn:focus-visible, .hint-btn:focus-visible, a:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* infobox */

.infobox { flex: 1 1 320px; max-width: 380px; min-width: 0; background: var(--box); border: 1px solid var(--border-strong); font-size: 14px; }

.infobox-title {
  padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--box-head);
  text-align: center; font: 18px var(--mono); word-break: break-all;
}

.infobox-title .hidden { color: var(--muted); }

.ib-sec { padding: 12px 14px 0; display: flex; flex-direction: column; gap: 8px; }

.ib-sec:last-child { padding-bottom: 14px; }

.ib-head { font-weight: 700; }

.elements { display: flex; gap: 6px; }

.status { display: flex; align-items: center; gap: 8px; }

.chip { padding: 2px 8px; border-radius: 2px; background: var(--box-head); }

.chip.approved, .chip.de-facto { background: #ccf5cc; color: #14532d; }

.chip.in-use { background: #dde8fb; color: #1d3d7a; }

.chip.proposed { background: #fff3c4; color: #6b4e00; }

.tagchip {
  display: inline-block; margin: 0 4px 4px 0; padding: 2px 6px; font-family: var(--mono);
  background: var(--surface); border: 1px solid var(--border); border-radius: 2px; word-break: break-all;
}

.desc { margin: 0; line-height: 1.45; }

/* end screen */

.end { flex: 1 1 100%; max-width: 640px; margin: 24px auto; text-align: center; align-items: center; }

.end .big { font: 700 44px Georgia, "Linux Libertine", "Times New Roman", serif; margin: 0; color: var(--text); }

.end p { margin: 0; color: var(--muted); font-size: 17px; }

.footer {
  border-top: 1px solid var(--border); background: var(--surface); padding: 12px 24px;
  font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between;
}

@media (max-width: 640px) {
  .topbar { padding: 8px 12px; gap: 6px 14px;}
  .app { padding: 12px; gap: 12px;}
  .panel { padding: 14px;}
  .infobox { max-width: none;}
}

/* curation sidebar (only with ?curate) */

.linkbtn { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; font-size: inherit; }

.chip.lvl-easy { background: #ccf5cc; color: #14532d; }

.chip.lvl-intermediate { background: #fff3c4; color: #6b4e00; }

.chip.lvl-hard { background: #fde2e1; color: #8a1c1c; }

/* letter slots: the boxes are the input (hangman mode) */

.warn { color: var(--bad); margin: 0; }

.masked { font-family: var(--mono); background: var(--box-head); padding: 0 3px; border-radius: 2px; letter-spacing: 0.05em; white-space: nowrap; }

kbd { font: 12px var(--mono); padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 3px; background: var(--surface); color: var(--text); }

/* switch between the games */
.games { display: flex; gap: 4px; font-size: 14px; }
.games a { padding: 6px 10px; border-radius: 2px; text-decoration: none; }
.games a:hover { background: var(--box-head); }
.games a[aria-current="page"] { background: var(--box-head); color: var(--text); font-weight: 700; }

/* copyright notice in the bottom-left corner, like the attribution control on Leaflet / MapLibre maps */
.attribution {
  position: fixed; left: 0; bottom: 0; z-index: 10; padding: 1px 6px;
  background: rgba(255, 255, 255, 0.8); color: #333; font: 12px/1.5 var(--sans);
}
.attribution a { color: #0078a8; text-decoration: none; }
.attribution a:hover { text-decoration: underline; }
.footer { justify-content: flex-end; }
@media (max-width: 640px) { .footer { padding-bottom: 28px; } } /* keep the footer text clear of the notice */
