/* Forgotten Words, official site. A 2008 game-studio site: a fixed glossy
   frame on a night backdrop, tabbed nav, title-bar panels, a sidebar of
   widgets, pill buttons with a highlight, a ticker and a starburst.
   One committed dark look (no light theme): gold, ember and night green.
   The display face is served from here (fonts/), never from Google: the game's
   Alegreya with its small caps as the lowercase (Alegreya SC), OFL. */
@font-face { font-family: "FW Display"; src: url("fonts/fw-display.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
:root {
  color-scheme: dark;
  --night: #0b120f;
  --night-2: #13201a;
  --panel: #18241e;
  --panel-2: #0f1814;
  --line: #3a4a3e;
  --gold: #e2bc6a;
  --gold-hi: #fff1c4;
  --gold-lo: #8a6a2c;
  --ember: #d9663f;
  --teal: #5cc2b0;
  --ink: #e9e5d6;
  --ink-dim: #a9a795;
  --ink-faint: #6e7366;
  --display: "FW Display", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --body: Verdana, Tahoma, "DejaVu Sans", Geneva, sans-serif;
  --ui: "Trebuchet MS", "Lucida Grande", "Segoe UI", Tahoma, sans-serif;
  --mono: "Courier New", Courier, monospace;
}

* { box-sizing: border-box; }
html { background: var(--night); }
body {
  margin: 0;
  background:
    radial-gradient(ellipse 900px 420px at 50% -60px, rgba(226, 188, 106, 0.22), transparent 70%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, #172a22 0, var(--night) 520px);
  background-color: var(--night);
  color: var(--ink);
  font: 13px/1.6 var(--body);
  padding-inline: 16px;
  padding-block: 18px 40px;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hi); text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }

/* ---- the frame ---- */
.frame {
  max-width: 980px;
  margin: 0 auto;
  border: 1px solid var(--gold-lo);
  border-radius: 9px;
  background: linear-gradient(180deg, var(--panel) 0, var(--panel-2) 100%);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.45), 0 14px 50px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

/* ---- the header ---- */
.masthead {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 26px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 55%),
    linear-gradient(90deg, #22140f 0, #2a1d12 40%, #13231c 100%);
  border-bottom: 1px solid #000;
}
.masthead::after {
  content: "";
  position: absolute; inset: auto 0 0 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.logo { min-width: 0; }
.wordmark { display: block; line-height: 0; }
.wordmark img { height: 120px; width: auto; max-width: 100%; filter: drop-shadow(0 0 14px rgba(226, 188, 106, 0.28)); }
.logo .tag {
  margin-top: 14px;
  font: italic 12px/1.3 var(--ui);
  color: var(--ink-dim);
  letter-spacing: 0.06em;
}
.badge-beta {
  margin-left: auto;
  align-self: flex-start;
  font: bold 11px var(--ui);
  color: #2a1505;
  background: linear-gradient(180deg, #ffe39a, #e8a63c);
  border: 1px solid #7a4a10;
  border-radius: 3px;
  padding: 2px 7px;
  transform: rotate(4deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

/* ---- tabs ---- */
.tabs {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 10px 14px 0;
  background: linear-gradient(180deg, #0c1410, #101b16);
  border-bottom: 3px solid var(--gold-lo);
}
.tabs a {
  position: relative;
  display: block;
  padding: 8px 18px 7px;
  font: bold 13px var(--ui);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  border: 1px solid #000;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, #3f5446 0%, #24342b 50%, #1a2620 51%, #22312a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  text-shadow: 0 1px 0 #000;
}
.tabs a:hover { text-decoration: none; color: var(--gold-hi); background: linear-gradient(180deg, #56705e 0%, #33473b 50%, #26362d 51%, #2f4237 100%); }
.tabs a[aria-current="page"] {
  color: #2b1806;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  background: linear-gradient(180deg, #fff0bf 0%, #e9c06b 50%, #d4a24a 51%, #e2b65d 100%);
}
.burst {
  position: absolute; top: -13px; right: -14px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font: bold 9px/1 var(--ui); color: #fff; text-shadow: 0 1px 0 #600;
  background: radial-gradient(circle, #ff8a3d 0, #d3271b 70%);
  clip-path: polygon(50% 0, 61% 18%, 82% 10%, 80% 31%, 100% 38%, 86% 53%, 98% 72%, 77% 74%, 72% 96%, 54% 84%, 36% 100%, 30% 79%, 8% 82%, 15% 61%, 0 47%, 18% 37%, 12% 15%, 34% 19%);
  transform: rotate(-12deg);
  animation: wobble 2.4s ease-in-out infinite;
}
@keyframes wobble { 50% { transform: rotate(8deg) scale(1.08); } }

/* ---- ticker ---- */
.ticker {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px;
  background: #050906;
  border-bottom: 1px solid var(--line);
  font: 12px var(--ui);
  overflow: hidden;
}
.ticker b { color: var(--ember); flex: none; text-transform: uppercase; letter-spacing: 0.08em; }
.ticker .track { min-width: 0; overflow: hidden; white-space: nowrap; flex: 1; }
.ticker .track span { display: inline-block; padding-left: 100%; animation: tick 34s linear infinite; color: var(--ink-dim); }
@keyframes tick { to { transform: translateX(-100%); } }

/* ---- the body grid ---- */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 18px; padding: 18px; }
.main, .side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.panel { border: 1px solid #000; border-radius: 6px; background: rgba(8, 14, 11, 0.55); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); overflow: hidden; }
.panel > h2, .panel > h3 {
  margin: 0;
  padding: 7px 12px;
  font: 700 17px/1.2 var(--display);
  letter-spacing: 0.03em;
  color: var(--gold);
  background: linear-gradient(180deg, #2c3c32 0%, #1c2922 50%, #142019 51%, #1a271f 100%);
  border-bottom: 1px solid #000;
  text-shadow: 0 1px 0 #000;
  text-wrap: balance;
}
.panel > h2::before, .panel > h3::before { content: "\25C6"; color: var(--ember); font-size: 11px; margin-right: 8px; vertical-align: 2px; }
.panel .in { padding: 12px 14px 14px; }
.panel p { margin: 0 0 10px; max-width: 65ch; }
.panel p:last-child { margin-bottom: 0; }

h1.page { margin: 0; font: 700 28px/1.15 var(--display); color: var(--gold); text-shadow: 0 2px 0 #000; text-wrap: balance; }
.lead { color: var(--ink-dim); max-width: 65ch; margin: 6px 0 0; }

/* ---- banner rotator ---- */
.banner { position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-bottom: 1px solid #000; overflow: hidden; background: #000; }
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: fade 36s infinite; }
.banner img:nth-child(1) { animation-delay: 0s; opacity: 1; }
.banner img:nth-child(2) { animation-delay: 6s; }
.banner img:nth-child(3) { animation-delay: 12s; }
.banner img:nth-child(4) { animation-delay: 18s; }
.banner img:nth-child(5) { animation-delay: 24s; }
.banner img:nth-child(6) { animation-delay: 30s; }
@keyframes fade { 0% { opacity: 0; } 3.3% { opacity: 1; } 16.7% { opacity: 1; } 20% { opacity: 0; } 100% { opacity: 0; } }
.banner .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.88) 40%);
}
.banner .cap .say { flex: 1 1 260px; min-width: 0; }
.banner .cap strong { display: block; font: 700 22px/1.2 var(--display); color: var(--gold-hi); text-shadow: 0 2px 4px #000; text-wrap: balance; }
.banner .cap span { color: var(--ink); font-size: 12px; }

/* ---- buttons ---- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 20px;
  font: bold 14px var(--ui);
  text-transform: uppercase; letter-spacing: 0.06em;
  color: #241404;
  border: 1px solid #6b4310;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff3c6 0%, #f0c96f 48%, #d99e36 52%, #f0bd57 100%);
  box-shadow: 0 2px 0 #3a2208, 0 6px 14px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  cursor: pointer;
}
.btn:hover { text-decoration: none; color: #000; filter: brightness(1.08); }
.btn.green { color: #062019; border-color: #0d4a3c; background: linear-gradient(180deg, #d4fff3 0%, #7fe0c8 48%, #3fb59a 52%, #61cdb2 100%); box-shadow: 0 2px 0 #072a22, 0 6px 14px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
.btn[aria-disabled="true"] { cursor: not-allowed; filter: grayscale(0.85) brightness(0.8); }
.arrow { font-size: 12px; }

/* ---- news ---- */
.news { display: flex; flex-direction: column; gap: 14px; }
.post { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.post:last-child { border-bottom: 0; padding-bottom: 0; }
.cal { text-align: center; border: 1px solid #000; border-radius: 4px; overflow: hidden; background: #f4ecd6; color: #2a1b0c; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); align-self: start; }
.cal .m { display: block; background: linear-gradient(180deg, #e2654a, #a8301e); color: #fff; font: bold 10px/1.7 var(--ui); text-transform: uppercase; letter-spacing: 0.1em; }
.cal .d { display: block; font: bold 21px/1.25 var(--ui); }
.cal .y { display: block; font: 9px/1.4 var(--ui); color: #6b5a40; }
.post h4 { margin: 0 0 4px; font: 700 16px/1.25 var(--display); color: var(--gold); text-wrap: balance; }
.post p { margin: 0; color: var(--ink); max-width: 65ch; }
.post .meta { font: 11px var(--ui); color: var(--ink-faint); margin-top: 6px; }

/* ---- sidebar widgets ---- */
.widget .in { display: flex; flex-direction: column; gap: 10px; }
.ver { font: 700 30px/1 var(--display); color: var(--gold-hi); text-shadow: 0 2px 0 #000; }
.small { font-size: 11px; color: var(--ink-dim); }
.thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.thumbs a { display: block; border: 2px solid #000; outline: 1px solid var(--line); }
.thumbs a:hover { outline-color: var(--gold); }
.notice { font-size: 11px; color: var(--ink-dim); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; }
.notice ul { margin: 4px 0 0; padding-left: 16px; }

/* ---- cards ---- */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.card img { border-radius: 6px; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.6); transition: transform 0.2s ease; }
.card:hover img { transform: translateY(-4px) rotate(-1deg); }
.card figcaption { font-size: 12px; color: var(--ink-dim); }
.card figcaption b { display: block; font: 700 15px/1.2 var(--display); color: var(--gold); }

.facts { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.facts th, .facts td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.facts th { color: var(--ink-dim); font-weight: normal; width: 55%; }
.facts td { color: var(--gold-hi); font-weight: bold; }
.facts tr:nth-child(odd) td, .facts tr:nth-child(odd) th { background: rgba(255, 255, 255, 0.025); }

.packs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.packs figure { margin: 0; text-align: center; }
.packs img { border: 1px solid #000; border-radius: 4px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6); }
.packs figcaption { margin-top: 6px; font: 700 12px/1.25 var(--display); color: var(--gold); }

.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mode { padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; background: rgba(0, 0, 0, 0.25); }
.mode b { display: block; font: 700 15px/1.2 var(--display); color: var(--gold); margin-bottom: 3px; }
.mode span { font-size: 12px; color: var(--ink-dim); }

/* ---- dev diary ---- */
.diary { list-style: none; margin: 0; padding: 0; position: relative; }
.diary::before { content: ""; position: absolute; left: 106px; top: 6px; bottom: 6px; width: 3px; background: linear-gradient(180deg, var(--teal), var(--gold-lo) 8%, var(--gold-lo) 92%, var(--teal)); border-radius: 2px; }
.diary li { position: relative; display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 34px; padding: 6px 0 12px; }
.diary .when { text-align: right; font: bold 11px/1.9 var(--ui); color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.diary .dot { position: absolute; left: 100px; top: 10px; width: 15px; height: 15px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px #0b130f, 0 0 10px rgba(226, 188, 106, 0.5); }
.diary li.ms .dot { background: #b092e2; }
.diary li.rel .dot { background: var(--ember); }
.diary li.start .dot, .diary li.next .dot { background: var(--teal); }
.diary li.next .dot { background: transparent; border: 3px solid var(--teal); }
.diary h4 { margin: 0; font: 700 16px/1.25 var(--display); color: var(--gold); text-wrap: balance; }
.diary li.rel h4 { color: #f0906a; }
.diary li.ms h4 { color: #c9b2f0; }
.diary li.start h4, .diary li.next h4 { color: var(--teal); }
.diary p { margin: 2px 0 0; font-size: 12px; color: var(--ink); max-width: 65ch; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font: 11px var(--ui); color: var(--ink-dim); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* ---- download ---- */
.dlbox { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 18px; align-items: center; padding: 16px; border: 2px solid var(--gold-lo); border-radius: 8px; background: radial-gradient(ellipse at 20% 0, rgba(226, 188, 106, 0.16), transparent 70%), rgba(0, 0, 0, 0.35); }
.dlbox .icon { border-radius: 8px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6); }
.dl-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 6px; max-width: 65ch; }
code { font: 12px var(--mono); color: var(--gold-hi); background: rgba(0, 0, 0, 0.4); padding: 1px 5px; border-radius: 3px; }

/* ---- footer ---- */
.foot { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: space-between; align-items: center; padding: 14px 18px; background: #050806; border-top: 1px solid var(--line); font: 11px var(--ui); color: var(--ink-faint); }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.foot nav a { color: var(--ink-dim); }
.foot .sep { color: var(--line); }
.hush { color: var(--ink-faint); opacity: 0.35; letter-spacing: 0.3em; }
.hush:hover { opacity: 1; color: var(--ember); text-decoration: none; }

/* ---- narrow screens ---- */
@media (max-width: 820px) {
  .cols { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .packs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  body { font-size: 14px; }
  .masthead { flex-wrap: wrap; padding: 16px; }
  .wordmark img { height: auto; }
  .badge-beta { margin-left: 0; }
  .tabs { padding: 8px 8px 0; }
  .tabs a { padding: 7px 10px 6px; font-size: 12px; letter-spacing: 0.04em; }
  .gallery, .modes { grid-template-columns: minmax(0, 1fr); }
  .packs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dlbox { grid-template-columns: minmax(0, 1fr); }
  .dlbox .icon { max-width: 160px; }
  .diary::before { left: 6px; }
  .diary li { grid-template-columns: minmax(0, 1fr); gap: 2px; padding-left: 26px; }
  .diary .when { text-align: left; }
  .diary .dot { left: 0; top: 4px; }
  .banner .cap strong { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .burst, .ticker .track span, .banner img { animation: none; }
  .ticker .track span { padding-left: 0; }
  .banner img { opacity: 0; }
  .banner img:nth-child(1) { opacity: 1; }
  .card img { transition: none; }
}
