/* Cara o Sello: shared styles. Layout: coin stage + session tally on the home page; single readable column on information pages.
   Palette: navy #090446, khaki #786F52, amber #FEB95F (light and dark variants derived from these). */
:root {
  --bg: #ffffff;
  --surface: #fff6e4;
  --fg: #090446;
  --muted: #5d563f;
  --line: #e6dac0;
  --btn: #090446;
  --btn-fg: #feb95f;
  --link: #090446;
  --focus: #090446;
  /* Fills (dots, bars, chips) and text variants with enough contrast on the background */
  --cara: #feb95f;
  --on-cara: #090446;
  --cara-text: #8a5200;
  --sello: #786f52;
  --on-sello: #ffffff;
  --sello-text: #6a6148;
  /* Coin metal */
  --coin-hi: #ffe9bd;
  --coin-mid: #feb95f;
  --coin-lo: #b87a18;
  --coin-ink: #090446;
  --display: "Young Serif", Georgia, "Times New Roman", serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090446;
    --surface: #130a62;
    --fg: #f8f0df;
    --muted: #cbc09c;
    --line: #2f2a85;
    --btn: #feb95f;
    --btn-fg: #090446;
    --link: #feb95f;
    --focus: #feb95f;
    --cara: #feb95f;
    --on-cara: #090446;
    --cara-text: #feb95f;
    --sello: #9a8f69;
    --on-sello: #090446;
    --sello-text: #cdc196;
    --coin-hi: #ffe3ac;
    --coin-mid: #f7b256;
    --coin-lo: #a96f14;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #090446;
  --surface: #130a62;
  --fg: #f8f0df;
  --muted: #cbc09c;
  --line: #2f2a85;
  --btn: #feb95f;
  --btn-fg: #090446;
  --link: #feb95f;
  --focus: #feb95f;
  --cara: #feb95f;
  --on-cara: #090446;
  --cara-text: #feb95f;
  --sello: #9a8f69;
  --on-sello: #090446;
  --sello-text: #cdc196;
  --coin-hi: #ffe3ac;
  --coin-mid: #f7b256;
  --coin-lo: #a96f14;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  padding-block: 28px 40px;
  padding-inline: 16px;
  border-top: 6px solid var(--cara);
}
a { color: var(--link); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible, .stage:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.wrap { max-width: 960px; margin-inline: auto; display: grid; gap: 28px; }
header { display: grid; gap: 6px; }
h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}
header p { margin: 0; color: var(--muted); max-width: 52ch; }

/* Site navigation */
.site-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-size: .95rem; }
.site-nav a { color: var(--fg); text-decoration: none; font-weight: 500; padding-block: 4px; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--sello); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--cara); }
.brand { font-family: var(--display); font-size: 1.25rem; margin-inline-end: auto; }
.brand a { color: var(--fg); text-decoration: none; border: 0; }

.main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 720px) { .main { grid-template-columns: minmax(0, 1fr); gap: 24px; } }

/* Coin */
.play { display: grid; gap: 18px; justify-items: center; }
.stage {
  perspective: 900px;
  width: 100%;
  height: 300px;
  display: grid;
  place-items: center;
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: 16px;
}
.toss { width: 210px; height: 210px; transform-style: preserve-3d; position: relative; z-index: 1; }
.toss.go { animation: arc var(--dur, 1.7s) cubic-bezier(.3, .1, .3, 1); }
@keyframes arc {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-80px) scale(1.14); }
  100% { transform: translateY(0) scale(1); }
}
.coin {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform var(--dur, 1.7s) cubic-bezier(.2, .75, .25, 1);
}
.coin.still { transition: none; }
.face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  color: var(--coin-ink);
  background:
    radial-gradient(circle at 30% 24%, var(--coin-hi) 0%, var(--coin-mid) 46%, var(--coin-lo) 100%);
  box-shadow:
    inset 0 0 0 3px var(--coin-lo),
    inset 0 0 0 5px var(--coin-hi),
    inset 0 0 0 7px var(--coin-mid),
    inset 0 -10px 18px rgba(80, 40, 0, .28),
    0 12px 24px rgba(9, 4, 70, .30);
}
.face.back { transform: rotateX(180deg); }
.face svg { width: 100%; height: 100%; display: block; }
.shade {
  position: absolute;
  bottom: 14px;
  left: 50%;
  width: 150px;
  height: 18px;
  margin-left: -75px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(9, 4, 70, .38), rgba(9, 4, 70, 0) 70%);
}
.shade.go { animation: shade var(--dur, 1.7s) cubic-bezier(.3, .1, .3, 1); }
@keyframes shade {
  0% { transform: scale(1); opacity: 1; }
  40% { transform: scale(.55); opacity: .45; }
  100% { transform: scale(1); opacity: 1; }
}

.verdict { text-align: center; min-height: 4.2rem; display: grid; gap: 2px; align-content: start; }
.verdict .word { font-family: var(--display); font-size: 2rem; line-height: 1.1; }
.verdict .word.c { color: var(--cara-text); }
.verdict .word.s { color: var(--sello-text); }
.verdict .sub { color: var(--muted); font-size: .95rem; }

.go-btn {
  font: inherit;
  font-weight: 600;
  font-size: 1.05rem;
  background: var(--btn);
  color: var(--btn-fg);
  border: 0;
  border-radius: 10px;
  padding: 14px 32px;
  min-width: 220px;
  cursor: pointer;
}
.go-btn:disabled { opacity: .6; cursor: progress; }

/* Tally */
.tally { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: grid; gap: 20px; }
.tally h2 { margin: 0; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.counts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.count { display: grid; gap: 0; min-width: 0; }
.count .label { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.c { background: var(--cara); }
.dot.s { background: var(--sello); }
.count .num { font-family: var(--display); font-size: 3rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.count .pct { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); gap: 2px; }
.bar span { display: block; min-width: 0; transition: flex-grow .5s ease; }
.bar .bc { background: var(--cara); flex-grow: 0; }
.bar .bs { background: var(--sello); flex-grow: 0; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-top: 1px solid var(--line); padding-top: 16px; margin: 0; }
.fact { min-width: 0; }
.fact dt { color: var(--muted); font-size: .9rem; }
.fact dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.recent { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 10px; }
.recent h3 { margin: 0; font-size: .9rem; font-weight: 500; color: var(--muted); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: .85rem;
}
.chip.c { background: var(--cara); color: var(--on-cara); }
.chip.s { background: var(--sello); color: var(--on-sello); }
.empty { color: var(--muted); margin: 0; font-size: .95rem; }
.reset {
  font: inherit; font-size: .95rem; font-weight: 500;
  justify-self: start;
  background: transparent; color: var(--fg);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 14px; cursor: pointer;
}
.reset[data-armed="true"] { border-color: var(--cara-text); color: var(--cara-text); }

/* Articles and information pages */
.prose { max-width: 68ch; display: grid; gap: 14px; min-width: 0; }
.prose h2 { font-family: var(--display); font-weight: 400; font-size: clamp(1.5rem, 4vw, 1.95rem); line-height: 1.15; margin: 14px 0 0; text-wrap: balance; }
.prose h3 { font-size: 1.05rem; margin: 8px 0 0; }
.prose p, .prose ul, .prose ol { margin: 0; }
.prose ul, .prose ol { padding-inline-start: 1.3rem; display: grid; gap: 6px; }
.prose .meta { color: var(--muted); font-size: .92rem; }
.prose a { overflow-wrap: anywhere; }
.articles { display: grid; gap: 36px; border-top: 1px solid var(--line); padding-top: 32px; }
.articles .prose { max-width: 68ch; }
.table-scroll { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }

.faq { display: grid; gap: 0; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding-block: 12px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; color: var(--muted); }

.mail-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: grid; gap: 12px; max-width: 68ch; }
.mail-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mail-addr { font-weight: 600; overflow-wrap: anywhere; user-select: all; min-width: 0; }
.pending { color: var(--cara-text); }

/* Ad slots: hidden until an AdSense publisher ID is configured in site.js */
.ad { max-width: 100%; overflow: hidden; display: grid; gap: 4px; justify-items: center; }
.ad[hidden] { display: none; }
.ad small { color: var(--muted); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.ad ins { display: block; width: 100%; min-height: 90px; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding-top: 20px; display: grid; gap: 12px; font-size: .92rem; color: var(--muted); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-foot p { margin: 0; max-width: 68ch; }
.linkish { font: inherit; background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; justify-self: start; }

/* Consent banner */
.consent {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 50;
  background: var(--surface); color: var(--fg);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(9, 4, 70, .16);
  padding-block: 16px calc(16px + env(safe-area-inset-bottom, 0px));
  padding-inline: 16px;
}
.consent-inner { max-width: 960px; margin-inline: auto; display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; }
.consent p { margin: 0; flex: 1 1 360px; min-width: 0; font-size: .95rem; }
.consent .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.consent button { font: inherit; font-weight: 600; font-size: .95rem; border-radius: 10px; padding: 10px 18px; cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--fg); }
.consent button.primary { background: var(--btn); color: var(--btn-fg); border-color: var(--btn); }

@media (prefers-reduced-motion: reduce) {
  .toss.go, .shade.go { animation: none; }
  .coin { transition-duration: .01s; }
  .bar span { transition: none; }
}
