/* Oraculum: the Book of Fate, 1822. Dark blue and gold, the answers on
   parchment, the hieroglyphs and the table from the scan of the book.
   The shell (fonts, header, footer) is in base.css; here its colors are
   switched to blue. */

.o-oraculum {
  --bg: #0a1022;
  --ink: #e8e3d3;
  --muted: #aeb3c4;
  --faint: #7d849a;
  --gold: #d2ae5e;
  --gold-hi: #f6dd9c;
  --line: rgba(210, 174, 94, 0.32);
  --paper: #f1e6c8;
  --paper-ink: #2b2116;
  --paper-muted: #6e5a3c;
  background:
    radial-gradient(130% 60% at 50% -12%, #22315a 0%, #121b36 48%, rgba(10, 16, 34, 0) 78%),
    var(--bg);
}

.o-oraculum .lang option {
  background: #18223f;
}

.oc {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 14px var(--gutter) 0;
}

/* ---------- title ---------- */

.oc-top {
  text-align: center;
}

.oc-caption {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.oc-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(38px, 11vw, 58px);
  line-height: 1.1;
  letter-spacing: 0.05em;
  color: var(--gold-hi);
  background: linear-gradient(180deg, #fff3cf 0%, #e9c77c 52%, #a77f3c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.55));
}

.oc-subtitle {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--muted);
  text-wrap: balance;
}

.oc-h {
  margin: 30px 0 12px;
  text-align: center;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--gold-hi);
}

.oc-note {
  max-width: 620px;
  margin: -4px auto 14px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  text-wrap: balance;
}

/* ---------- the 32 questions ---------- */

.oc-questions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 820px) {
  .oc-questions {
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
  }
}

.oc-q {
  display: flex;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  height: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(240, 225, 190, 0.04);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.35;
  text-align: start;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.oc-q:hover {
  border-color: rgba(210, 174, 94, 0.7);
  background: rgba(240, 225, 190, 0.08);
}

.oc-q:disabled {
  cursor: default;
}

.oc-n {
  flex: none;
  min-width: 1.6em;
  font-family: var(--serif);
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: lining-nums tabular-nums;
}

/* ---------- the chosen question and the lines ---------- */

.oc-ask {
  max-width: 640px;
  margin: 26px auto 0;
  scroll-margin-top: 12px;
}

.oc-chosen {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid rgba(210, 174, 94, 0.55);
  border-radius: 12px;
  background: rgba(240, 225, 190, 0.06);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.35;
}

.oc-rule {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-inline-start: 2px solid var(--gold);
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--muted);
}

.oc-lines {
  display: grid;
  gap: 4px;
  margin: 18px 0 0;
}

.oc-lines:empty {
  display: none;
}

.oc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 2px 10px;
  border-radius: 8px;
  background: rgba(240, 225, 190, 0.05);
}

.oc-marks {
  flex: 1;
  min-width: 0;
  height: 32px;
  overflow: visible;
}

.oc-mark {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
  animation: oc-pen 0.12s ease-out both;
}

@keyframes oc-pen {
  from {
    opacity: 0;
  }
}

.oc-row-stars {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  width: 44px;
  color: var(--gold-hi);
}

.oc-star {
  width: 18px;
  height: 18px;
}

.oc-row.done .oc-star {
  animation: oc-star 0.35s ease-out both;
}

@keyframes oc-star {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
}

.oc-sign {
  margin: 14px 0 0;
  text-align: center;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-hi);
}

.oc-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.oc-btn {
  min-width: min(100%, 300px);
  min-height: 52px;
  padding: 14px 32px;
  border: 1px solid #f0d58c;
  border-radius: 999px;
  color: #1b1405;
  background: linear-gradient(180deg, #f6dd9c 0%, #d9b260 55%, #b48a3c 100%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.12s, filter 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.oc-btn:hover {
  filter: brightness(1.06);
}

.oc-btn:active {
  transform: translateY(1px);
}

.oc-btn:disabled {
  filter: saturate(0.4) brightness(0.8);
  cursor: default;
  transform: none;
}

.oc-link {
  padding: 6px 10px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.oc-link:hover {
  color: var(--ink);
}

.oc-hint {
  margin: 12px auto 0;
  max-width: 460px;
  text-align: center;
  font-size: 14px;
  color: var(--faint);
  text-wrap: balance;
}

/* ---------- the folio with the answer ---------- */

.oc-result {
  margin: 26px auto 0;
  scroll-margin-top: 12px;
}

.oc-folio {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  padding: 26px 22px 24px;
  border-radius: 6px;
  color: var(--paper-ink);
  background:
    radial-gradient(120% 90% at 50% 40%, rgba(255, 250, 235, 0.55), rgba(255, 250, 235, 0) 70%),
    linear-gradient(180deg, #f3e9cf 0%, var(--paper) 60%, #e5d4ad 100%);
  box-shadow:
    0 0 0 1px #c7ad74,
    0 0 0 5px var(--paper),
    0 0 0 6px #b8975a,
    0 18px 40px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.oc-glyph {
  display: block;
  width: 128px;
  height: 128px;
  margin: 0 auto;
  box-shadow: 0 2px 6px rgba(60, 40, 10, 0.35);
}

.oc-folio-n {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--paper-muted);
}

.oc-glyph-name {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--paper-muted);
}

.oc-entry {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(110, 90, 60, 0.45);
  text-align: start;
}

.oc-stars {
  display: grid;
  grid-template-columns: repeat(2, 14px);
  grid-auto-rows: 14px;
  gap: 2px 3px;
  flex: none;
  padding-inline-end: 12px;
  border-inline-end: 1px solid rgba(110, 90, 60, 0.6);
  color: var(--paper-ink);
}

.oc-stars .oc-star {
  width: 14px;
  height: 14px;
}

.oc-answer {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.45;
}

.oc-meet {
  max-width: 640px;
  margin: 18px auto 0;
  text-align: center;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--muted);
  text-wrap: balance;
}

.oc-meet-glyph {
  font-style: italic;
  color: var(--ink);
}

/* ---------- the table ---------- */

.oc-table {
  max-width: 900px;
  margin: 16px auto 0;
}

.oc-table-link {
  position: relative;
  display: block;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 12px 30px rgba(0, 0, 0, 0.5);
}

.oc-table-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3146 / 2455;
  background: #d8d2c4;
}

.oc-table-marks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.oc-band {
  fill: rgba(210, 160, 40, 0.2);
}

.oc-cell {
  fill: rgba(210, 160, 40, 0.28);
  stroke: #9a6a10;
  stroke-width: 3;
  animation: oc-cell 1.2s ease-in-out 3 alternate;
}

@keyframes oc-cell {
  to {
    fill: rgba(210, 160, 40, 0.5);
  }
}

.oc-table figcaption {
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  color: var(--faint);
}

/* ---------- how it works ---------- */

.oc-how {
  max-width: 640px;
  margin: 40px auto 0;
}

.oc-how p {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.o-oraculum .noscript {
  text-align: center;
  color: var(--muted);
}

/* no italics in these scripts (see base.css) */
:is(:lang(ar), :lang(he), :lang(ka), :lang(hy)) :is(.oc-subtitle, .oc-rule, .oc-glyph-name, .oc-meet-glyph) {
  font-style: normal;
}

/* Georgian has no capitals, Arabic no letter-spacing */
:is(:lang(ka), :lang(ar)) :is(.oc-caption, .oc-folio-n) {
  text-transform: none;
  letter-spacing: 0;
}
