/* Two designs in one file, on purpose. The portal is 2012: Verdana, table borders, gradients, a
   marquee, ads with dashed borders and a hit counter. The HUD, the overlays and the toast are from
   now: system font, flat, big tap targets. The joke only works if the second one is clearly newer. */

:root {
  --navy: #000080;
  --link: #0000ee;
  --seen: #551a8b;
  --rule: #8a8ab0;
  --paper: #fdfdf5;
}
* { box-sizing: border-box; }
/* The overlays, the HUD and the toast are all display:something in a class rule, which beats the
   browser's own [hidden] rule. Without this line, hidden means nothing on this page. */
[hidden] { display: none !important; }
html, body {
  margin: 0;
  background: #e9e9e0;
  color: #000;
  font: 12px/1.45 Verdana, Tahoma, Geneva, Arial, sans-serif; /* no web fonts: 2012 had what it had */
  -webkit-text-size-adjust: 100%;
}
body { -webkit-tap-highlight-color: transparent; }

/* --- the portal ------------------------------------------------------------------------------ */
#portal {
  max-width: 1024px; /* the whole internet was 1024x768 and the layout never forgot */
  margin: 0 auto;
  background: var(--paper);
  border-left: 1px solid #ccc;
  border-right: 1px solid #ccc;
  padding-bottom: 12px;
}
#portal:empty { min-height: 60vh; }

.masthead { background: linear-gradient(#0a0a8c, #000060); color: #fff; padding: 8px 10px 6px; border-bottom: 4px solid #ffd54f; }
.logo-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.logo {
  font: bold 24px/1.1 Georgia, "Times New Roman", serif;
  color: #ffd54f;
  text-shadow: 2px 2px 0 #000;
  letter-spacing: .5px;
  padding: 2px 4px;
}
.logo.mirror { transform: scaleX(-1); display: inline-block; } /* origin stays centre: about the left edge the logo flips clean off the screen */
.mast-right { text-align: right; font-size: 11px; color: #cfd8ff; }
.clock, .online { padding: 4px 4px; white-space: nowrap; }
.tagline { font-size: 11px; color: #e8e8ff; margin-top: 4px; }
.kicker { font-size: 10px; color: #ffd54f; letter-spacing: .5px; margin-top: 2px; }

.nav { background: linear-gradient(#f2f2f2, #d6d6d6); border-bottom: 1px solid #999; padding: 4px 6px; display: flex; flex-wrap: wrap; gap: 2px; }
.nav .lnk { padding: 8px 8px; border-right: 1px solid #bbb; font-weight: bold; font-size: 11px; min-height: 34px; display: inline-flex; align-items: center; }
.nav .login { margin-left: auto; border: 2px outset #ccc; background: #ececec; border-right-width: 2px; }

.ticker { background: #111; color: #ffd54f; overflow: hidden; white-space: nowrap; padding: 7px 0; font-size: 11px; border-bottom: 2px solid #ffd54f; }
.tape { display: inline-block; padding-left: 100%; animation: tape 26s linear infinite; }
.tape.rev { animation-direction: reverse; }
@keyframes tape { from { transform: translateX(0); } to { transform: translateX(-100%); } }

.portal { display: flex; flex-direction: column; gap: 10px; padding: 10px 8px; }
.col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.col-main { order: -1; } /* one column on a phone: the news goes first, not the weather */

.box { border: 1px solid var(--rule); background: #fff; }
.box-h {
  margin: 0;
  font: bold 12px/1.4 Verdana, Tahoma, sans-serif;
  color: #fff;
  background: linear-gradient(#3a5fcd, #1c3faa);
  padding: 6px 8px;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 1px solid #001f6b;
}
.box-b { padding: 4px 6px; }

.lnk { color: var(--link); text-decoration: underline; cursor: pointer; }
.lnk.alt { color: #008000; } /* the wrong colour, when an anomaly asks for it */
a { color: var(--link); }
a:visited { color: var(--seen); }
.flinks .lnk:nth-child(2), .flinks .lnk:nth-child(5) { color: var(--seen); } /* some of us clicked Feedback in 2004 */

/* Tap targets: one item, one tap, never smaller than a thumb. */
[data-item] { position: relative; min-height: 40px; padding: 8px 6px; border-bottom: 1px dotted #ccc; }
[data-item]:last-child { border-bottom: 0; }
[data-item]:active { background: #fffbcc; }
[data-item]:focus-visible { outline: 3px solid #ff6f00; outline-offset: -3px; }
.box[data-item], .ad[data-item] { padding: 0; border-bottom: 1px solid var(--rule); }

.hl-row .dl { font-weight: bold; color: #444; font-size: 11px; }
.cap { color: #555; font-size: 10px; font-style: italic; margin-top: 3px; }

.score-status { color: #c62828; font-weight: bold; font-size: 11px; }
.score-match { font-weight: bold; margin-top: 2px; }
.score-runs { font: bold 22px/1.2 Georgia, serif; color: var(--navy); margin: 2px 0; }
.score-note { color: #444; }

.wx { border-collapse: collapse; width: 100%; font-size: 11px; }
.wx th { background: #dfe6ff; border: 1px solid var(--rule); padding: 5px 4px; text-align: left; }
.wx td { border: 1px solid #d4d4d4; padding: 10px 4px; }
.wx tr[data-item] { padding: 0; }

.ho-row .ho-s, .cl-row .cl-t { color: #b8860b; }
.cl-row .cl-t { color: #c62828; }
.mt-row { font-size: 11px; }

.pnr-train { font-weight: bold; }
.pnr-no { font-family: "Courier New", monospace; color: #333; }
.pnr-st { color: #006400; font-weight: bold; }
.shayari { font: italic 13px/1.7 Georgia, serif; color: #4a148c; text-align: center; }
.sh-by { font: 10px/1.4 Verdana, sans-serif; color: #777; margin-top: 4px; }

.poll-q { font-weight: bold; margin-bottom: 6px; }
.poll-row { display: flex; align-items: center; gap: 6px; margin: 4px 0; font-size: 11px; }
.poll-l { flex: 0 0 38%; }
.bar { flex: 1; height: 14px; background: #eee; border: 1px solid #999; }
.bar > i { display: block; height: 100%; background: linear-gradient(#ff9800, #e65100); }
.bar-pct { flex: 0 0 34px; text-align: right; }
.votes { color: #666; font-size: 10px; margin-top: 6px; }

.ad { border: 2px dashed #e65100; background: #ffffe0; padding: 8px; text-align: center; display: block; text-decoration: none; color: #000; }
.ad-t { font: bold 13px/1.2 Verdana, sans-serif; color: #c62828; text-transform: uppercase; }
.ad-b { font-size: 11px; color: #333; margin: 4px 0; }
.ad-c { font-weight: bold; }
.ad-u { font-size: 10px; color: #666; margin-top: 4px; word-break: break-all; }
.ad.house { border-color: #1c3faa; background: #eef3ff; }
.ad.house .ad-t { color: var(--navy); }
.restless { will-change: transform; }

.foot { border-top: 3px double var(--rule); margin-top: 10px; padding: 10px; text-align: center; font-size: 11px; background: #f3f3ea; }
.flinks { padding: 6px 0; color: #999; }
.hits { display: inline-block; margin: 6px auto; }
.odo { font: bold 14px/1 "Courier New", monospace; background: #111; color: #7cfc00; padding: 3px 6px; letter-spacing: 3px; border: 2px inset #888; }
.copy { color: #333; }
.fnote { color: #777; font-size: 10px; margin-top: 4px; }
.exit { font-weight: bold; }
.signoff { display: inline-block; margin-top: 8px; font-size: 11px; }

/* The find stamp: the only modern thing allowed to touch the portal. */
.stamp {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%) rotate(-11deg);
  font: bold 15px/1 system-ui, sans-serif;
  color: #c62828;
  border: 3px solid #c62828;
  border-radius: 4px;
  padding: 4px 8px;
  background: #fff8f8;
  letter-spacing: 1px;
  pointer-events: none;
  animation: pop .22s ease-out;
  z-index: 2;
}
@keyframes pop { from { transform: translateY(-50%) rotate(-11deg) scale(1.7); opacity: 0; } }
.found-item { background: #fff2f2 !important; box-shadow: inset 0 0 0 2px #c62828; }
/* What you did not find, once you stopped looking. Same stamp, drained of the colour you earn. */
.stamp.missed { color: #6b6b6b; border-color: #6b6b6b; background: #f3f3f1; }
.missed-item { background: #f6f6f4 !important; box-shadow: inset 0 0 0 2px #9a9a9a; }

/* The hint ladder, three rungs. Tier one lights the column, tier two outlines the box, tier three
   will not stop blinking until the thing is tapped. Every rung is a class the ladder takes back. */
.hint-col { background: #fffdf0; box-shadow: inset 0 0 0 3px #ffd54f; transition: background .25s ease, box-shadow .25s ease; }
.hint-box { animation: hint-pulse .62s ease-in-out 4; }
@keyframes hint-pulse { 50% { box-shadow: 0 0 0 4px #ff6f0055, inset 0 0 0 2px #ff6f00; } }
.hint-reveal { animation: hint-flash .9s ease-in-out infinite; }
@keyframes hint-flash { 50% { background: #fff3c4; box-shadow: inset 0 0 0 3px #ff6f00; } }

#portal.shudder { animation: shudder .42s ease-in-out; }
@keyframes shudder {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 1px) skewX(.6deg); }
  45% { transform: translate(4px, -2px) skewX(-.8deg); }
  70% { transform: translate(-2px, 2px); }
}

/* --- the parts from this decade -------------------------------------------------------------- */
#hud {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px;
  background: #101014;
  color: #fff;
  font: 600 13px/1 system-ui, -apple-system, sans-serif;
  flex-wrap: wrap; /* on a 375px phone the HUD is two rows: the Hint button may never scroll away */
  row-gap: 6px;
}
.hud-b { background: #26262e; border: 0; color: #fff; font: inherit; padding: 8px 10px; border-radius: 999px; white-space: nowrap; }
#mute { margin-left: auto; cursor: pointer; min-width: 40px; min-height: 36px; }
#hfound { background: #1b5e20; }
#hfalse.hot { background: #b71c1c; }
#hint { background: #0d47a1; cursor: pointer; min-height: 36px; }
#hint.nudge { animation: nudge .5s ease-in-out 2; } /* asked once, after a long silence, then quiet */
@keyframes nudge { 50% { transform: scale(1.14); background: #e65100; } }
#giveup { background: none; color: #ff9e91; text-decoration: underline; padding: 8px 4px; cursor: pointer; min-height: 36px; }

.confirm {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 11;
  width: min(92vw, 380px);
  background: #101014;
  color: #fff;
  font: 600 14px/1.35 system-ui, sans-serif;
  padding: 14px 16px;
  border-radius: 12px;
  box-shadow: 0 8px 30px #0006;
}
.confirm p { margin: 0 0 10px; }
.confirm-row { display: flex; gap: 8px; }
.cbtn { flex: 1; padding: 12px; border: 0; border-radius: 9px; font: 600 14px/1 system-ui, sans-serif; background: #33333d; color: #fff; cursor: pointer; }
.cbtn.yes { background: #c62828; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 9;
  max-width: 92vw;
  background: #101014;
  color: #fff;
  font: 600 14px/1.3 system-ui, sans-serif;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 8px 30px #0006;
  animation: rise .18s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }

.overlay { position: fixed; inset: 0; z-index: 10; background: #10101ce6; display: grid; place-items: center; padding: 16px; overflow: auto; }
.sheet {
  width: min(92vw, 420px);
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  font: 15px/1.5 system-ui, -apple-system, sans-serif;
  box-shadow: 0 20px 60px #0007;
}
.sheet h1 { font-size: 26px; margin: 0 0 2px; }
.sheet h2 { font-size: 22px; margin: 0 0 6px; }
.day { font-weight: 700; color: #e65100; margin: 0 0 12px; }
.muted { color: #555; }
.small { font-size: 13px; }
/* The studio line closes both sheets, in the sheets' own now-voice rather than the portal's. The
   links carry their tap target in padding so the text can stay small and quiet. */
.by { margin: 6px 0 -8px; }
.by a { display: inline-block; padding: 12px 0; }
.stats { font-weight: 700; margin: 0 0 8px; }
.verdict { font-size: 17px; font-weight: 600; margin: 0 0 6px; }
/* The hero holds the card's shape (1080x1350) before the image lands, so the buttons under it never
   jump. The height cap keeps Share card above the fold on a 360x640 phone and a 1280x720 laptop; the
   width follows from the ratio, which is why the box is centred rather than full width. */
.hero {
  --cap: 48vh;
  width: min(100%, calc(var(--cap) * 4 / 5));
  aspect-ratio: 4 / 5;
  margin: 2px auto 12px;
  background: #f2f2ee;
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
}
#card { display: block; width: 100%; height: 100%; }
.primary {
  display: block;
  width: 100%;
  padding: 13px;
  font: 600 16px/1 system-ui, sans-serif;
  border: 0;
  border-radius: 10px;
  background: #101014;
  color: #fff;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.primary.ghost { background: #fff; color: #101014; border: 2px solid #101014; }
.row { display: flex; gap: 8px; margin: 12px 0 8px; }
.row > * { flex: 1; }
.wide { margin-top: 8px; }
#endcallouts:empty, #endnote:empty, #endbest:empty, #introbest:empty { display: none; }

/* --- three columns once there is room --------------------------------------------------------- */
@media (min-width: 900px) {
  .portal { flex-direction: row; align-items: flex-start; }
  .col-left { flex: 0 0 23%; order: 1; }
  .col-main { flex: 1 1 auto; order: 2; }
  .col-right { flex: 0 0 25%; order: 3; }
  .logo { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .tape { animation: none; padding-left: 0; }
  #portal.shudder { animation: none; }
  .stamp { animation: none; }
  #toast { animation: none; }
  /* The ladder still has to be visible, so the animations become the state they were animating. */
  #hint.nudge { animation: none; background: #e65100; }
  .hint-col { transition: none; }
  .hint-box { animation: none; box-shadow: 0 0 0 3px #ff6f00; }
  .hint-reveal { animation: none; background: #fff3c4; box-shadow: inset 0 0 0 3px #ff6f00; }
}
