/* World Wisdom: game controls in the uvo.dk design (paper, ink, red only as an accent). Builds on ../style.css. */
.ww-crumb { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; max-width: var(--maxw); margin: 0 auto; padding: clamp(0.9rem, 2.5vh, 2rem) var(--pad) 0; font-size: clamp(0.85rem, 1.3vw, 1.05rem); font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; }
.ww-crumb a { color: inherit; text-decoration: none; border-bottom: 2px solid #330000; }
.ww-crumb a:focus-visible { background: #330000; color: #EDEAE3; }
@media (hover: hover) { .ww-crumb a:hover { background: #330000; color: #EDEAE3; } }
.ww-crumb [aria-current] { opacity: 0.6; }
.label { margin: 0 0 1rem; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; }
.ww-note, .ww-credit { margin: 1.2rem 0 0; font-size: 0.85rem; font-weight: 700; color: rgba(51, 0, 0, 0.7); }
.ww-credit { padding: 0 var(--pad) 3rem; max-width: var(--maxw); margin-inline: auto; }
.ww-credit a { color: inherit; }
.ww [hidden] { display: none !important; }

/* level picker: rows like the other lists on the site, but buttons */
.games__list button.level {
  display: flex; align-items: baseline; gap: 1rem; width: 100%; padding: 0.9rem 0; text-align: left;
  font: inherit; color: inherit; background: none; border: 0; border-bottom: 1px solid rgba(51, 0, 0, 0.3); cursor: pointer;
  transition: padding-left 0.25s ease;
}
.games__list button.level:focus-visible { padding-left: 1rem; }
@media (hover: hover) { .games__list button.level:hover { padding-left: 1rem; } }
.games__list li.has-btn { padding: 0; border: 0; display: block; }

/* playing */
.ww-bar { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid #330000; padding-bottom: 0.6rem; margin-bottom: 1.5rem; }
.ww-bar .label { margin: 0; }
.ww-stage { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 900px) { .ww-stage { grid-template-columns: minmax(0, 520px) minmax(0, 560px); gap: 2.5rem; } }
.ww-playing .masthead { display: none; }
.ww-flagbox { width: 100%; aspect-ratio: 4 / 3; background: #fff; border: 2px solid #330000; display: grid; place-items: center; margin-bottom: 0; overflow: hidden; }
.ww-flagbox img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ww-answers { display: grid; grid-template-columns: 1fr; gap: 0.6rem; }
@media (min-width: 640px) and (max-width: 899px) { .ww-answers { grid-template-columns: 1fr 1fr; } }
.ww-answers button {
  display: flex; align-items: baseline; gap: 0.7rem; min-height: 3.2rem; padding: 0.55rem 0.9rem; text-align: left;
  font: 800 1.05rem/1.15 "Archivo", "Helvetica Neue", Arial, sans-serif; letter-spacing: -0.02em; color: #330000;
  background: transparent; border: 2px solid #330000; border-radius: 0; cursor: pointer;
}
.ww-answers button .key { flex: none; font-size: 0.75rem; opacity: 0.6; font-variant-numeric: tabular-nums; }
.ww-answers button .mark { margin-left: auto; flex: none; }
.ww-answers button:focus-visible { background: #330000; color: #EDEAE3; }
@media (hover: hover) { .ww-answers button:hover:not(:disabled) { background: #330000; color: #EDEAE3; } }
.ww-answers button:disabled { cursor: default; }
.ww-answers button.is-correct { background: #330000; color: #EDEAE3; }
.ww-answers button.is-wrong { background: #E72604; border-color: #E72604; color: #330000; }
.ww-answers button.is-dim { opacity: 0.45; }
.ww-feedback { min-height: 1.6rem; margin: 1rem 0 0; font-size: 1.1rem; font-weight: 800; }
.ww-actions { display: flex; align-items: center; gap: 1.5rem; margin-top: 1rem; min-height: 3rem; }
.ww-btn {
  padding: 0.7rem 1.4rem; font: 900 0.95rem "Archivo", Arial, sans-serif; text-transform: uppercase; letter-spacing: 0.02em;
  color: #EDEAE3; background: #330000; border: 2px solid #330000; border-radius: 0; cursor: pointer;
}
.ww-btn:focus-visible { background: #E72604; border-color: #E72604; color: #330000; }
@media (hover: hover) { .ww-btn:hover { background: #E72604; border-color: #E72604; color: #330000; } }
.ww-link { padding: 0; font: 800 0.85rem "Archivo", Arial, sans-serif; text-transform: uppercase; letter-spacing: 0.02em; color: inherit; background: none; border: 0; border-bottom: 2px solid #330000; cursor: pointer; }
.ww :focus-visible { outline: 3px solid #330000; outline-offset: 3px; }

/* end of round */
.ww-result { margin: 0; font-family: "Saira Condensed", "Arial Narrow", Impact, sans-serif; font-weight: 800; font-size: clamp(4rem, 14vw, 10rem); line-height: 0.85; letter-spacing: -0.04em; }
.ww-verdict { margin: 1rem 0 0; font-size: clamp(1rem, 1.9vw, 1.5rem); font-weight: 700; }
#missed { margin-top: 2.5rem; }
#missed h2 { margin: 0 0 0.8rem; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; }
@media (prefers-reduced-motion: reduce) { .games__list button.level { transition: none; } }

/* ready screen, clock, name entry and high score lists */
.ww-ready-text { margin: 0 0 1.5rem; max-width: 40ch; font-size: clamp(1rem, 1.9vw, 1.4rem); font-weight: 700; line-height: 1.25; }
.ww-btn--big { padding: 1.1rem 3rem; font-size: 1.5rem; }
#play-time { font-variant-numeric: tabular-nums; min-width: 5ch; text-align: right; }
.ww-time { margin: 0.4rem 0 0; font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.ww-hs { margin-top: 2.5rem; max-width: 560px; }
.ww-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.8rem; }
.ww-tabs button { padding: 0.35rem 0.8rem; font: 800 0.8rem "Archivo", Arial, sans-serif; text-transform: uppercase; letter-spacing: 0.02em; color: #330000; background: transparent; border: 2px solid #330000; border-radius: 0; cursor: pointer; }
.ww-tabs button[aria-pressed="true"] { background: #330000; color: #EDEAE3; }
.ww-board { margin: 0; padding: 0; list-style: none; border-top: 2px solid #330000; }
.ww-board li { display: grid; grid-template-columns: 2.2rem 1fr auto 5.5rem; gap: 0.6rem; align-items: baseline; padding: 0.5rem 0; border-bottom: 1px solid rgba(51, 0, 0, 0.3); font-weight: 700; }
.ww-board .rank { font-weight: 900; font-variant-numeric: tabular-nums; }
.ww-board .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ww-board .pts, .ww-board .tm { font-variant-numeric: tabular-nums; text-align: right; }
.ww-board li.is-you { background: #330000; color: #EDEAE3; margin-inline: -0.6rem; padding-inline: 0.6rem; }

.ww-entry { margin: 1.5rem 0 0; max-width: 560px; padding: 1rem; border: 2px solid #E72604; }
.ww-entry .label { display: block; margin-bottom: 0.6rem; }
.ww-entry__row { display: flex; gap: 0.6rem; }
.ww-entry input { flex: 1; min-width: 0; padding: 0.6rem 0.8rem; font: 800 1.1rem "Archivo", Arial, sans-serif; color: #330000; background: #fff; border: 2px solid #330000; border-radius: 0; }
.ww-entry__msg { min-height: 1.2rem; margin: 0.5rem 0 0; font-size: 0.85rem; font-weight: 800; }
.ww-entry .ww-btn:disabled { opacity: 0.5; cursor: default; }

.ww-crumb + .masthead { padding-top: 1.6rem; }

/* mode 2: country name on the left, four flags to choose from on the right */
.ww-stage--find { gap: 1.2rem; }
@media (min-width: 900px) { .ww-stage--find { grid-template-columns: minmax(0, 340px) minmax(0, 640px); } }
.ww-promptbox { padding: 1rem 0; border-top: 2px solid #330000; border-bottom: 2px solid #330000; }
.ww-promptbox .label { margin-bottom: 0.5rem; }
.ww-prompt { margin: 0; font-family: "Saira Condensed", "Arial Narrow", Impact, sans-serif; font-weight: 800; text-transform: uppercase; letter-spacing: -0.03em; line-height: 0.95; font-size: clamp(2.4rem, 7vw, 4.6rem); overflow-wrap: anywhere; }
.ww-flaggrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.ww-flaggrid button.flagbtn { display: flex; flex-direction: column; gap: 0.4rem; padding: 6px; min-height: 0; text-align: left; font: 800 0.95rem/1.15 "Archivo", Arial, sans-serif; color: #330000; background: transparent; border: 2px solid #330000; border-radius: 0; cursor: pointer; }
.ww-flaggrid button.flagbtn img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; border: 1px solid rgba(51, 0, 0, 0.35); display: block; }
.ww-flaggrid button.flagbtn .cap { display: flex; align-items: baseline; gap: 0.5rem; min-height: 1.3rem; padding: 0 0.2rem 0.1rem; }
.ww-flaggrid button.flagbtn .key { flex: none; font-size: 0.75rem; opacity: 0.6; }
.ww-flaggrid button.flagbtn .txt { visibility: hidden; min-width: 0; }
.ww-flaggrid.is-answered button.flagbtn .txt { visibility: visible; }
.ww-flaggrid button.flagbtn .mark { margin-left: auto; flex: none; }
.ww-flaggrid button.flagbtn:focus-visible { background: #330000; color: #EDEAE3; }
@media (hover: hover) { .ww-flaggrid button.flagbtn:hover:not(:disabled) { background: #330000; color: #EDEAE3; } }
.ww-flaggrid button.flagbtn:disabled { cursor: default; }
.ww-flaggrid button.flagbtn.is-correct { background: #330000; color: #EDEAE3; }
.ww-flaggrid button.flagbtn.is-wrong { background: #E72604; border-color: #E72604; color: #330000; }
.ww-flaggrid button.flagbtn.is-dim { opacity: 0.45; }

/* phones: everything on one screen, with as little empty space as possible */
@media (max-width: 640px) {
  .ww-crumb { padding-top: 0.55rem; font-size: 0.78rem; gap: 0.35rem; }
  .ww-crumb + .masthead { padding-top: 0.4rem; }
  .ww-bar { margin-bottom: 0.6rem; padding-bottom: 0.3rem; gap: 0.5rem; }
  .ww-bar .label { font-size: 0.7rem; }
  .ww-stage { gap: 0.5rem; }
  .ww-flagbox { width: min(100%, calc(27vh * 4 / 3)); justify-self: center; }
  .ww-answers { grid-template-columns: 1fr 1fr; gap: 0.4rem; }
  .ww-answers button { min-height: 2.5rem; padding: 0.35rem 0.55rem; font-size: 0.9rem; gap: 0.35rem; }
  .ww-feedback { min-height: 1.2rem; margin-top: 0.45rem; font-size: 0.95rem; }
  .ww-actions { margin-top: 0.4rem; min-height: 0; }
  .ww-playing .ww-credit { display: none; }
  .ww-ready-text { margin-bottom: 0.9rem; font-size: 1rem; }
  .ww-btn--big { padding: 0.8rem 2.2rem; font-size: 1.25rem; }
  .ww-hs { margin-top: 1.1rem; }
  .ww-result { font-size: clamp(3rem, 16vw, 4.5rem); }
  .ww-verdict { margin-top: 0.5rem; }
  .ww-entry { margin-top: 0.8rem; padding: 0.7rem; }
  #missed { margin-top: 1.2rem; }
  .games__list button.level { flex-wrap: wrap; row-gap: 0.1rem; padding-block: 0.5rem; }
  .games__list button.level .games__meta { flex-basis: 100%; margin-left: 0; text-align: left; }
  /* find the flag: name above, four small flags */
  .ww-stage--find { gap: 0.5rem; }
  .ww-promptbox { padding: 0.45rem 0; }
  .ww-promptbox .label { margin-bottom: 0.2rem; }
  .ww-prompt { font-size: clamp(1.7rem, 8.5vw, 2.3rem); }
  .ww-flaggrid { gap: 0.4rem; }
  .ww-flaggrid button.flagbtn { padding: 4px; gap: 0.25rem; font-size: 0.8rem; }
  .ww-flaggrid button.flagbtn .cap { min-height: 1.05rem; padding: 0 0.1rem; }
}

/* answer boxes: the name is centred in the box (both ways), the number and the right/wrong mark sit at the edges */
.ww-answers button { position: relative; align-items: center; justify-content: center; text-align: center; padding-inline: 2rem; }
.ww-answers button .key, .ww-answers button .mark { position: absolute; top: 50%; transform: translateY(-50%); margin: 0; line-height: 1; }
.ww-answers button .key { left: 0.65rem; }
.ww-answers button .mark { right: 0.65rem; }
.ww-flaggrid button.flagbtn .cap { position: relative; align-items: center; justify-content: center; text-align: center; padding-inline: 1.3rem; }
.ww-flaggrid button.flagbtn .key, .ww-flaggrid button.flagbtn .mark { position: absolute; top: 50%; transform: translateY(-50%); margin: 0; line-height: 1; }
.ww-flaggrid button.flagbtn .key { left: 0.2rem; }
.ww-flaggrid button.flagbtn .mark { right: 0.2rem; }

/* the list of answers on the result screen: one compact line per row, flag + mark + your answer -> the right answer */
.ww-review { margin: 0; padding: 0; list-style: none; border-top: 2px solid #330000; }
.ww-review li { display: flex; align-items: center; gap: 0.55rem; padding: 0.35rem 0; border-bottom: 1px solid rgba(51, 0, 0, 0.3); font-size: 0.92rem; font-weight: 700; line-height: 1.15; }
.ww-review .n { flex: none; min-width: 1.35rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.ww-review img { flex: none; width: 36px; height: 27px; object-fit: contain; border: 1px solid rgba(51, 0, 0, 0.4); background: #fff; }
.ww-review .mk { flex: none; width: 1.1rem; text-align: center; font-weight: 900; }
.ww-review li.is-wrong .mk { color: #E72604; }
.ww-review .tx { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.4rem; }
.ww-review strong { font-weight: 900; }
.ww-review .said { text-decoration: line-through; text-decoration-thickness: 1.5px; opacity: 0.65; }
.ww-review .said.none { text-decoration: none; font-style: italic; }
.ww-review .arr { opacity: 0.6; }

/* always one line: a long answer of yours is cut with "..." before the right answer would wrap */
.ww-review .tx { flex: 1 1 auto; flex-wrap: nowrap; align-items: baseline; }
.ww-review .said { flex: 0 5 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ww-review .arr { flex: none; }
.ww-review strong { flex: 0 1 auto; min-width: 0; }
.ww-review .said { padding-right: 0.15em; }
