/* Orðheimar daily games (word grid, crossword): shared parts made by daily.js. Scoped under .og.
   Each game adds its own stylesheet for the play area. The page supplies the Geograph font and page.css. */

.og {
  --og-navy: #003449;
  --og-teal: #58d6dc;
  --og-yellow: #ffc452;
  --og-coral: #ff734d;
  width: min(1020px, 100%);
  margin: 0 auto;
  color: #fff;
  font-family: "Geograph", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.og *, .og *::before, .og *::after { box-sizing: border-box; }
.og [hidden] { display: none !important; }
.og input { -webkit-user-select: text; user-select: text; }
.og button { font-family: inherit; }
.og button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- Top bar ---------- */
/* Top bar, same as the memory game's: stats on the left (label + value), sound and the main action on the right */
.og-bar { display: flex; align-items: center; gap: 12px 48px; flex-wrap: wrap; margin-bottom: 32px; }
.og-stat { display: inline-flex; align-items: baseline; gap: 10px; color: rgba(255,255,255,.72); font-size: .82rem; font-weight: 500; letter-spacing: .12em; }
.og-stat b { color: #fff; font-size: .95rem; font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.og-penalty { margin-left: -4px; color: var(--og-yellow); font-size: .82rem; font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.og-penalty[hidden] { display: none; }
.og-sound { margin-left: auto; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; background: none; color: var(--og-teal); cursor: pointer; }
.og-sound svg { width: 22px; height: 22px; fill: currentColor; }
.og-sound:hover { opacity: .75; }
.og-sound[aria-pressed="true"] .og-sound-off, .og-sound[aria-pressed="false"] .og-sound-on { display: none; }
.og-action { margin-left: -32px; height: 33px; display: inline-flex; align-items: center; gap: 10px; padding: 0 14px 0 16px; border: 0; background: var(--og-teal); color: var(--og-navy); font: inherit; font-size: .875rem; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background-color .2s; }
.og-action svg { width: 14px; height: 14px; flex: none; fill: currentColor; transition: transform .2s ease; }
.og-action:hover { background: #7ce1e6; }
.og-action:hover svg { transform: translateX(2px); }
.og-action:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (max-width: 640px) {
  .og-bar { gap: 10px 22px; margin-bottom: 24px; }
  .og-stat { gap: 6px; font-size: .72rem; letter-spacing: .08em; }
  .og-action { margin-left: 0; }
}

/* ---------- Messages, help buttons, "solved" panel ---------- */
.og-msg { min-height: 1.5em; margin: 8px 0 14px; color: rgba(255,255,255,.75); font-size: 15px; line-height: 1.4; }
.og-msg.is-trail { color: var(--og-yellow); font-size: 20px; font-weight: 700; letter-spacing: .14em; line-height: 1.1; }
.og-msg.is-good { color: #fff; }
.og-msg.is-bad { color: #ffa58d; }
.og-msg.is-hint { color: var(--og-yellow); }

.og-hints { margin-top: 32px; display: flex; gap: 10px; flex-wrap: wrap; }
.og-hint { height: 38px; padding: 0 14px; border: 0; background: var(--og-teal); color: var(--og-navy); font-size: .875rem; font-weight: 700; cursor: pointer; transition: background-color .2s; }
.og-hint span { margin-left: 4px; font-weight: 500; opacity: .7; }
.og-hint:hover { background: #7ce1e6; }
.og-hint:disabled { background: rgba(255,255,255,.12); color: rgba(255,255,255,.45); cursor: default; }

.og-done { margin-top: 22px; padding: 16px 18px; background: rgba(255,255,255,.07); }
.og-done p { margin: 0 0 8px; font-size: 15px; line-height: 1.4; }
.og-done-btns { display: flex; gap: 24px; flex-wrap: wrap; }
.og-link { padding: 0; border: 0; background: none; color: var(--og-teal); font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Dialogs (win, archive) ---------- */
.og-overlay { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(0,30,42,.72); overflow-y: auto; }
.og-overlay.show { display: flex; }
.og-dialog { position: relative; width: min(480px, 100%); padding: 40px 36px 32px; background: #fff; color: var(--og-navy); }
.og-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; background: none; color: var(--og-navy); cursor: pointer; }
.og-close:hover { background: #f2f2f2; }
.og-close svg { width: 20px; height: 20px; }
.og-dialog button:focus-visible { outline: 2px solid var(--og-teal); outline-offset: 2px; }
.og-eyebrow { margin: 0 0 6px; color: #2a8f95; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.og-dialog h2 { margin: 0 0 12px; font-size: 2.25rem; line-height: 1.1; font-weight: 700; letter-spacing: -0.01em; }
.og-dialog p { margin: 6px 0; font-size: 1.05rem; font-weight: 300; line-height: 1.5; }
.og-dialog p b { font-weight: 700; }
.og-dialog .og-share-label { margin: 24px 0 12px; font-size: .75rem; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; }
.og-share { display: flex; flex-wrap: nowrap; gap: 8px; } /* always one row */
.og-btn { height: 44px; padding: 0 16px; border: 0; background: #fff; color: var(--og-navy); box-shadow: inset 0 0 0 1px rgba(0,52,73,.3); font-size: .875rem; font-weight: 500; cursor: pointer; }
.og-btn:hover { background: #f2fbfb; box-shadow: inset 0 0 0 1px var(--og-navy); }
.og-btn-primary { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; background: var(--og-navy); color: #fff; box-shadow: none; }
.og-btn-primary:hover { background: #0a4a63; }
.og-btn.og-icon-btn { width: 52px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.og-icon-btn svg { width: 20px; height: 20px; }
.og-dialog .og-copied { min-height: 1.2em; margin: 8px 0 0; font-size: 13px; color: #2a8f95; }
.og-again { margin-top: 18px; display: inline-flex; align-items: center; gap: 10px; padding: 4px 0; border: 0; background: none; color: var(--og-navy); font-size: .9rem; font-weight: 500; cursor: pointer; }
.og-again svg { width: 14px; height: 14px; flex: none; transition: transform .2s ease; }
.og-again:hover svg { transform: translateX(3px); }

/* Win dialog: share card preview on the left, text and sharing on the right (same as Orð á móti orði) */
.og-dialog.og-win { width: min(780px, 100%); padding: 48px; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 48px; align-items: center; box-shadow: 0 5px 34px rgba(0,0,0,.15); }
.og-preview { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.og-preview-frame { width: 280px; height: 400px; display: flex; align-items: center; justify-content: center; background: #f6f6f6; }
.og-preview-frame img { max-width: 220px; max-height: 384px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.og-preview-frame[data-format="square"] img { max-width: 260px; }
.og-preview-msg { padding: 24px; font-size: .85rem; line-height: 1.5; text-align: center; }
.og-format { display: flex; gap: 20px; }
.og-format button { padding: 2px 0; border: 0; border-bottom: 1px solid transparent; background: none; color: #5a5a5a; font: inherit; font-size: .8rem; font-weight: 500; cursor: pointer; }
.og-format button[aria-pressed="true"] { color: var(--og-navy); border-bottom-color: var(--og-teal); }
.og-btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.og-btn-primary svg { width: 18px; height: 18px; }
@media (max-width: 760px) {
  .og-dialog.og-win { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 28px 22px; text-align: center; }
  .og-win > * { min-width: 0; }
  .og-win p, .og-win h2 { overflow-wrap: anywhere; }
  .og-format { flex-wrap: wrap; justify-content: center; row-gap: 6px; }
  .og-win .og-preview-frame { width: 100%; height: 300px; }
  .og-win .og-preview-frame img { max-width: 165px; max-height: 284px; }
  .og-win .og-preview-frame[data-format="square"] img { max-width: 240px; max-height: 240px; }
  .og-win .og-share-label, .og-win .og-share { text-align: left; }
}

.og-archive .og-archive-note { font-size: .92rem; color: #4a5a62; }
.og-archive-list { list-style: none; margin: 18px 0 0; padding: 0; max-height: min(52vh, 460px); overflow-y: auto; border-top: 1px solid #e6e9ea; }
.og-archive-item { width: 100%; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 6px; border: 0; border-bottom: 1px solid #e6e9ea; background: none; color: var(--og-navy); text-align: left; cursor: pointer; }
.og-archive-item:hover { background: #f2fbfb; }
.og-archive-item.is-current { background: #fff1d7; }
.og-a-no { font-size: 13px; font-weight: 700; }
.og-a-clue { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.og-a-status { font-size: 13px; font-weight: 700; color: #2a8f95; font-variant-numeric: tabular-nums; }
.og-a-status { display: inline-flex; align-items: center; gap: 4px; }
.og-a-status svg { width: 15px; height: 15px; flex: none; }
@media (max-width: 640px) {
  .og-overlay { align-items: flex-start; padding: 16px; }
  .og-dialog { padding: 32px 22px 26px; }
  .og-dialog h2 { font-size: 1.9rem; }
}

/* ---------- XL screens: same sidebar layout as the memory game (see page.css) ---------- */
@media (min-width: 1536px) {
  .game-band .og { grid-column: 2; grid-row: 1 / 3; align-self: start; width: auto; margin: 56px 0 0; }
}

/* ---------- Tutorial icons (the .steps list in the intro): cells light up when the step plays ---------- */
.steps .gc { transition: fill .18s ease; }
.steps li.play .gc { fill: var(--to); transition-delay: var(--d, 0ms); }
@media (prefers-reduced-motion: reduce) { .steps .gc { fill: var(--to); } }

/* the share card is square now: a shorter frame */
.og-preview-frame[data-format="square"] { height: 300px; }
