/* Terminal look: pure black page, green Courier text. Same in light and dark mode. */
:root {
  color-scheme: dark;
  --page: #000000;
  --ink: #00ff00;
  --muted: #00b300;
  --bezel: #006600;
  --card: #000000;
  --screen: #000000;
  --accent: #00ff00;
  --accent-ink: #000000;
  --gold: #d4af37;        /* hidden games: card border, window accents */
  --gold-bright: #ffd84d;
  --bar-h: 5.5rem; /* height of the title bar at the top of every page */
}

/* Square corners everywhere, including browser-default buttons and inputs. */
* { box-sizing: border-box; border-radius: 0; }
/* "hidden" always hides, even on things a rule below gives display: grid/flex. */
[hidden] { display: none !important; }
html, body { margin: 0; }

/* Tiled star image drifting diagonally (down and to the right) behind the page.
   The layer is one tile bigger than the screen and moves exactly one tile
   (2000 x 1402, the size of background.jpg) per loop, so the loop is seamless.
   Change 90s to make it faster or slower. */
body::before {
  content: "";
  position: fixed;
  top: -1402px;
  left: -2000px;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: url("background.jpg") repeat;
  animation: star-drift 90s linear infinite;
  will-change: transform;
  pointer-events: none;
}
/* Black layer over the moving stars, under everything else, to tone them
   down. Raise --dim toward 1 for darker (1 hides the stars completely). */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #000;
  opacity: var(--dim, .5);
  pointer-events: none;
}
@keyframes star-drift {
  to { transform: translate(2000px, 1402px); }
}
/* Hold still for people who've asked their computer for less motion. */
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}
body {
  /* Black shows while the star image loads or if it's missing. */
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 "Courier New", Courier, monospace;
  text-align: center;
  /* 1px black outline around all text, so it reads over the star background.
     Every element inherits this. */
  text-shadow:
    -1px -1px 0 #000,  0 -1px 0 #000,  1px -1px 0 #000,
    -1px  0   0 #000,                  1px  0   0 #000,
    -1px  1px 0 #000,  0  1px 0 #000,  1px  1px 0 #000;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Room on top for the fixed title bar. */
  padding: calc(var(--bar-h) + 1.25rem) 1rem 3rem;
}

.wrap { width: 100%; max-width: 980px; }

header { margin-bottom: 1.5rem; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; letter-spacing: -0.01em; }
header p { margin: 0; color: var(--muted); }

a { color: var(--accent); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- Homepage grid ---------- */
.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* 10 games per row, fewer on smaller screens. */
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: .5rem;
}
@media (max-width: 900px) { .grid { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Square cards: the name area fills whatever the rating line leaves. */
.card {
  display: flex;
  flex-direction: column;
  aspect-ratio: 1 / 1;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  box-shadow: inset 0 0 0 2px var(--bezel);
  overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 2px var(--accent); }
.thumb {
  flex: 1;
  min-height: 0;
  background: transparent; /* let the card's green outline show around it */
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumb .ph {
  font-size: .65rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: .02em;
  text-align: center;
  overflow-wrap: anywhere;
  padding: .25rem;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card .info { padding: .2rem .35rem .35rem; }
.card .info:empty { display: none; } /* no title, blurb or rating to show */
.card h2 { font-size: 1.05rem; margin: 0; }
.card p { margin: .15rem 0 0; font-size: .9rem; color: var(--muted); }

.empty { color: var(--muted); }

/* ---------- Player page ---------- */
/* The game window, styled like Windows 95: grey raised frame, navy title bar
   with the game's name, and square bevelled buttons (mute, restart, full
   screen) where Windows had minimize, maximize and close.
   --ar is the game's width / height. play.html sets it from the game file
   once it loads. The window is as wide as the page allows, but never so tall
   that it runs off the bottom of the screen. The game area's height is the
   screen minus the title bar (--bar-h), the game page's top and bottom
   padding (1.25rem + 1rem) and the window frame (46px: title bar 30, gap 4,
   frame padding 8, game border 4); 12px is the frame's left and right
   edges. Square and tall games are limited by height, so this matters
   most for them. */
.bezel {
  --ar: 4 / 3;
  --ar-num: 1.3333;
  --w95-face: #c0c0c0;
  --w95-light: #ffffff;
  --w95-shadow: #808080;
  --w95-dark: #000000;
  margin-inline: auto;
  width: max(320px, (100vh - var(--bar-h) - 2.25rem - 46px) * var(--ar-num) + 12px);
  max-width: 100%;
  transition: width .2s ease;
}
.win95 {
  background: var(--w95-face);
  padding: 4px;
  text-align: left;
  text-shadow: none;
  /* Two-tone raised edge: white/light grey top-left, black/dark grey bottom-right. */
  box-shadow:
    inset -1px -1px 0 var(--w95-dark),
    inset 1px 1px 0 #dfdfdf,
    inset -2px -2px 0 var(--w95-shadow),
    inset 2px 2px 0 var(--w95-light),
    6px 6px 0 rgba(0, 0, 0, .5);
  font-family: "MS Sans Serif", "Microsoft Sans Serif", Tahoma, Geneva, Verdana, sans-serif;
}
.win95-titlebar {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #02421c;
  color: #ffffff;
  padding: 3px 3px 3px 6px;
  margin-bottom: 4px;
  min-height: 30px;
}
.win95-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.win95-buttons { display: flex; gap: 2px; flex-shrink: 0; }
/* The Restart button gets a little gap before it, like Windows' Close button. */
.win95-buttons #reload { margin-right: 2px; }
.win95-btn {
  width: 26px;
  height: 22px;
  padding: 0;
  border: 0;
  background: var(--w95-face);
  color: var(--w95-dark);
  text-shadow: none;
  display: grid;
  place-items: center;
  box-shadow:
    inset -1px -1px 0 var(--w95-dark),
    inset 1px 1px 0 var(--w95-light),
    inset -2px -2px 0 var(--w95-shadow),
    inset 2px 2px 0 #dfdfdf;
}
/* Pressed (and Mute while on): the bevel flips so the button looks pushed in. */
.win95-btn:active,
.win95-btn[aria-pressed="true"] {
  box-shadow:
    inset -1px -1px 0 var(--w95-light),
    inset 1px 1px 0 var(--w95-dark),
    inset -2px -2px 0 #dfdfdf,
    inset 2px 2px 0 var(--w95-shadow);
}
.win95-btn:active svg,
.win95-btn[aria-pressed="true"] svg { transform: translate(1px, 1px); }
.win95-btn:focus-visible { outline: 1px dotted var(--w95-dark); outline-offset: -5px; }
.win95-btn svg { width: 14px; height: 12px; fill: currentColor; }
.win95-btn svg .stroke { fill: none; stroke: currentColor; stroke-width: 1.4; }
.win95-btn .icon-muted,
.win95-btn[aria-pressed="true"] .icon-sound { display: none; }
.win95-btn[aria-pressed="true"] .icon-muted { display: block; }

/* Hidden games: gold title bar, a gold ring and glow around the window, and a
   gold edge around the game. */
.win95.hidden-game {
  box-shadow:
    inset -1px -1px 0 var(--w95-dark),
    inset 1px 1px 0 #dfdfdf,
    inset -2px -2px 0 var(--w95-shadow),
    inset 2px 2px 0 var(--w95-light),
    0 0 0 2px var(--gold),
    0 0 18px rgba(212, 175, 55, .45),
    6px 6px 0 rgba(0, 0, 0, .5);
}
.win95.hidden-game .win95-titlebar {
  background: linear-gradient(90deg, #5c4500, #a67c00 55%, var(--gold));
  text-shadow: 0 1px 0 rgba(0, 0, 0, .6);
}
.win95.hidden-game #stage { border-color: #8a6d1f var(--gold-bright) var(--gold-bright) #8a6d1f; }

#stage {
  width: 100%;
  aspect-ratio: var(--ar);
  background: var(--screen);
  /* Sunken edge around the game, the reverse of the window's raised one. */
  border: 2px solid;
  border-color: var(--w95-shadow) var(--w95-light) var(--w95-light) var(--w95-shadow);
  /* Square corners: rounding here would clip the edges of the game. */
  overflow: hidden;
  position: relative;
  font-family: "Courier New", Courier, monospace;
}
#stage ruffle-player { width: 100%; height: 100%; display: block; }
#message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  color: var(--ink);
}
#message[hidden] { display: none; }

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
  align-items: center;
  margin-top: 1rem;
}
button {
  font: inherit;
  text-shadow: none; /* filled buttons (Restart): black text, no outline */
  font-weight: 600;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  padding: .6rem 1rem;
  cursor: pointer;
}
button.quiet {
  background: transparent;
  color: var(--ink);
  text-shadow: inherit; /* green text on the stars keeps its outline */
  box-shadow: inset 0 0 0 2px var(--bezel);
}

/* ---------- Restart confirmation pop-up ---------- */
dialog {
  background: var(--page);
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 1.25rem 1.5rem;
  max-width: min(90vw, 26rem);
  font: inherit;
  text-shadow: inherit;
  text-align: center;
}
dialog p { margin: 0; }
dialog::backdrop { background: rgba(0, 0, 0, .7); }
/* "Wait... a hidden game?" pop-up: gold, like hidden games' windows. */
dialog.hidden-found { border-color: var(--gold); box-shadow: 0 0 28px rgba(212, 175, 55, .55); }
.hidden-found-title { font-size: 1.4rem; font-weight: 700; color: var(--gold-bright); }
.hidden-found button { background: var(--gold); color: #000; }

/* ---------- Player page layout ---------- */
/* Game window on the left, comments column on the right. The window keeps
   the size it wants (as big as the screen height allows) and only shrinks if
   the comments would get narrower than 15rem; comments get the rest. On
   narrow screens they stack: game first, comments below. */
.wrap.wide { max-width: 1500px; }
body.play { padding-bottom: 1rem; } /* game page: room for a bigger game */
.play-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  justify-content: center;
}
.play-layout .bezel { flex: 0 1 auto; min-width: 280px; margin-inline: 0; }
.play-side {
  flex: 1 1 15rem;
  min-width: 15rem;
  max-width: 640px;
}
.play-side .community { margin: 0; }
/* Big green "Another Game?" button above the rating: back to the homepage. */
.another-game {
  display: block;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  text-shadow: none;
  text-align: center;
  transition: transform .12s ease, filter .12s ease;
}
.another-game:hover { filter: brightness(.85); }
.another-game:active { transform: translateY(2px); }
.play-side .community h2:first-child { margin-top: 0; }
/* Wide screens: the page itself doesn't scroll. The right-hand column is
   at most the screen's height (below the title bar, inside the page's top
   and bottom padding); "Another Game?" stays at its top and the rating and
   comments scroll under it. Narrow screens stack and scroll normally. */
@media (min-width: 801px) {
  .play-side {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--bar-h) - 2.25rem);
  }
  .play-side .another-game { flex-shrink: 0; }
  .play-side .community {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain; /* reaching the end doesn't scroll the page */
    padding-right: .5rem;         /* room for the scrollbar */
    scrollbar-color: var(--bezel) transparent;
  }
}

@media (max-width: 800px) {
  .play-layout { flex-direction: column; align-items: center; }
  .play-layout .bezel { min-width: 0; }
  .play-side { width: 100%; min-width: 0; margin-top: 1rem; }
}

/* ---------- Ratings, comments and log-in (comments.js) ---------- */
.community {
  max-width: 640px;
  margin: 2rem auto 0;
}
.community h2 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
.muted { color: var(--muted); }
.community p { margin: .25rem 0; }

.stars { display: flex; justify-content: center; gap: .1rem; }
.stars button {
  background: transparent;
  color: var(--bezel);
  font-size: 2rem;
  line-height: 1;
  padding: .1rem .2rem;
  text-shadow: inherit;
}
.stars button.on, .stars button:hover { color: var(--ink); }

input[type="text"], input[type="password"], textarea, select {
  font: inherit;
  color: var(--ink);
  background: #000;
  border: 2px solid var(--bezel);
  padding: .55rem .75rem;
}
input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}
::placeholder { color: var(--muted); opacity: 1; }

.auth-note { margin: .5rem 0 0; }
.login { max-width: 420px; margin: 0 auto; }

/* ---------- PIN log-in (login.html) ---------- */
.pin-login {
  display: grid;
  gap: .5rem;
  max-width: 18rem;
  margin: 0 auto;
}
.pin-login label { font-weight: 600; text-align: left; }
.pin-login input { width: 100%; }
.pin-login label[for="pin"] { margin-top: .5rem; }
.pin-input {
  font-size: 2rem;
  letter-spacing: .4em;
  text-align: center;
  padding-left: .8em; /* balance the letter-spacing after the last dot */
}
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  margin-top: .5rem;
}
.keypad button {
  font-size: 1.6rem;
  padding: .7rem 0;
  touch-action: manipulation; /* no double-tap zoom on fast taps */
  transition: transform .06s ease;
}
.keypad button[data-key="clear"] { font-size: 1rem; }
.keypad button:active, .keypad button.pressed { transform: scale(.92); filter: brightness(.8); }
.keypad button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.pin-login.busy .keypad { opacity: .5; }
.pin-login.shake { animation: shake .35s; }
@keyframes shake {
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
@media (prefers-reduced-motion: reduce) {
  .pin-login.shake { animation: none; }
}
/* ---------- Account box, top-right of every logged-in page (account.js) ---------- */
/* Title bar fixed across the top of every page, with a line under it:
   site name on the left, account box (name · Log out) on the right. */
.site-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 .75rem;
  background: rgba(0, 0, 0, .85);
  border-bottom: 3px solid var(--ink);
}
.site-name,
.corner-account { white-space: nowrap; }
.site-name {
  flex-shrink: 0;
  padding: .6rem 1.6rem;
  color: var(--ink);
  font-size: 2.2rem;
  line-height: 1.2;
  font-weight: 700;
  text-decoration: none;
}
.site-name:hover { text-decoration: underline; }
.corner-account {
  min-width: 0;
  padding: .8rem 1.6rem;
  font-size: 1.8rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}
.corner-account strong { color: var(--ink); }
.corner-account a { color: var(--ink); }
/* Narrow screens: both boxes at their old size so they fit side by side. */
@media (max-width: 760px) {
  :root { --bar-h: 3.5rem; }
  .site-name { font-size: 1.1rem; padding: .3rem .8rem; }
  .corner-account { font-size: .9rem; padding: .4rem .8rem; }
}

.comment-form textarea { width: 100%; resize: vertical; display: block; }
.comment-form .controls { margin-top: .5rem; justify-content: space-between; }

button.link {
  background: none;
  color: var(--ink);
  padding: 0;
  font-weight: inherit;
  text-decoration: underline;
  text-shadow: inherit;
}
button:disabled { opacity: .5; cursor: progress; }

.comments {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: .75rem;
}
.comments li {
  background: rgba(0, 0, 0, .85);
  border: 2px solid var(--bezel);
  padding: .6rem .9rem;
}
.comments li.empty { color: var(--muted); }
.comments .meta { color: var(--muted); font-size: .9rem; }
.comments .meta strong { color: var(--ink); }
.comments .flagged { color: #ff6666; font-weight: 600; }
.comments .actions { margin: .4rem 0 0; }

/* ---------- Admin tools (admin.html) ---------- */
/* Admin page: "Student Actions" sidebar on the left, the chosen tool on the
   right. Narrow screens: sidebar on top. */
.admin-layout {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  text-align: left;
}
.admin-sidebar {
  position: sticky;
  top: calc(var(--bar-h) + 1.25rem);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, .85);
  border: 2px solid var(--bezel);
}
.admin-sidebar h2 { font-size: 1.2rem; margin: 0 0 .5rem; }
.side-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  padding: .6rem .75rem;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--bezel);
}
.side-item:hover { border-color: var(--accent); }
.side-item[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  text-shadow: none;
}
.side-count {
  min-width: 1.6rem;
  padding: 0 .35rem;
  background: var(--accent-ink);
  color: var(--ink);
  text-align: center;
  font-size: .85rem;
}
@media (max-width: 760px) {
  .admin-layout { grid-template-columns: 1fr; gap: 1rem; }
  .admin-sidebar { position: static; }
}
.admin { min-width: 0; }
.admin #status:empty { display: none; }
.admin-panel h2:first-child { margin-top: 0; }
.admin .timeout-form { justify-content: flex-start; }
.admin-sidebar .side-group { margin-top: 1rem; }
.admin-log li { padding: .45rem .8rem; }
/* Play time tables: name, then Today / 7 days / All time and an extra column. */
.pt-table { margin: .5rem 0 1.5rem; border: 2px solid var(--bezel); background: rgba(0, 0, 0, .85); }
.pt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, 6rem) 7rem;
  gap: .5rem;
  align-items: center;
  padding: .4rem .75rem;
  border-top: 1px solid rgba(0, 102, 0, .6);
}
.pt-head { border-top: 0; color: var(--muted); font-size: .85rem; }
.pt-num { text-align: right; font-variant-numeric: tabular-nums; }
.pt-extra { color: var(--muted); font-size: .85rem; }
.pt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-student summary { cursor: pointer; list-style: none; }
.pt-student summary::-webkit-details-marker { display: none; }
.pt-student summary .pt-name::before { content: "▸ "; color: var(--muted); }
.pt-student[open] summary .pt-name::before { content: "▾ "; }
.pt-student[open] summary { font-weight: 700; }
.pt-sub { color: var(--muted); padding-left: 2rem; font-size: .9rem; }
.pt-table > .empty { margin: 0; padding: .6rem .75rem; }
@media (max-width: 760px) {
  .pt-row { grid-template-columns: minmax(0, 1fr) repeat(3, 4.2rem); font-size: .85rem; }
  .pt-extra { display: none; }
}
.game-settings { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .35rem; }
.game-settings li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 9.5rem 9.5rem;
  gap: .75rem;
  align-items: center;
  padding: .35rem .6rem;
  border: 2px solid var(--bezel);
  background: rgba(0, 0, 0, .85);
}
.game-settings li.disabled { border-style: dashed; }
.game-settings li.disabled .gs-name { color: var(--muted); text-decoration: line-through; }
.gs-tag { font-size: .75rem; padding: 0 .3rem; border: 1px solid var(--bezel); color: var(--muted); }
.gs-toggle { padding: .35rem .5rem; font-size: .9rem; }
.game-settings li.disabled .gs-toggle { background: var(--accent); color: var(--accent-ink); text-shadow: none; }
@media (max-width: 760px) {
  .game-settings li { grid-template-columns: 1fr 1fr; }
  .gs-name { grid-column: 1 / -1; }
}
.admin h2 { font-size: 1.2rem; margin: 0 0 .5rem; }
.admin h3 { font-size: 1rem; margin: 1.25rem 0 .25rem; }
.admin .comments { margin-top: .5rem; }
.timeout-form {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  justify-content: center;
}
.timeout-form select { min-width: 9rem; }

/* ---------- Join with an invite code (join.html) ---------- */
.code-input { font-size: 1.6rem; text-align: center; letter-spacing: .15em; text-transform: uppercase; }
.pin-login .hint { margin: 0; font-size: .9rem; }
.pin-login .hint strong { color: var(--ink); }
.pin-login > button { margin-top: .25rem; }
.comments .body { margin-top: .3rem; white-space: pre-wrap; overflow-wrap: anywhere; }

.card .rating { color: var(--ink); font-size: .65rem; margin-top: 0; }

/* ---------- Locked games (index.html, play.html) ---------- */
/* A game this person hasn't played yet: a "?" in place of its picture. */
.card.locked { box-shadow: inset 0 0 0 2px var(--bezel); border: 2px dashed var(--bezel); }
.card.locked:hover { border-color: var(--accent); }
.card.locked h2 { letter-spacing: .2em; }
/* Hidden games: gold border (dashed while still locked). */
.card.hidden-game { box-shadow: inset 0 0 0 2px var(--gold); }
.card.hidden-game:hover { box-shadow: inset 0 0 0 2px var(--gold-bright), 0 0 12px rgba(212, 175, 55, .5); }
.card.locked.hidden-game { border-color: var(--gold); }
.card.locked.hidden-game:hover { border-color: var(--gold-bright); }
.thumb .mystery {
  font-size: 2.25rem;
  color: var(--ink);
  text-shadow: 0 0 12px var(--ink), -2px -2px 0 #000, 2px 2px 0 #000;
  animation: mystery-pulse 2.4s ease-in-out infinite;
}
@keyframes mystery-pulse {
  50% { opacity: .55; transform: scale(.94); }
}
/* Unlocked since the last visit: flips over to show the game. */
.card.just-unlocked { animation: reveal .8s ease-out both; }
@keyframes reveal {
  0% { transform: perspective(600px) rotateY(90deg); box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 var(--ink); }
  60% { transform: perspective(600px) rotateY(-8deg); box-shadow: inset 0 0 0 2px var(--accent), 0 0 24px var(--ink); }
  100% { transform: none; }
}
.unlock-count { margin: 1.5rem 0 0; color: var(--muted); }

/* "What is this place?" link, pinned to the bottom right of the homepage
   (the body is a full-height column, so margin-top: auto pushes it down). */
.page-foot { margin-top: auto; width: 100%; padding-top: 2rem; text-align: right; }
.page-foot a { font-size: .9rem; color: var(--muted); }
.page-foot a:hover { color: var(--ink); }

/* ---------- About this Project (about.html) ---------- */
.about { max-width: 42rem; margin: 0 auto; text-align: left; }
.about h1 { text-align: center; margin-bottom: 1.5rem; }
.about h2 { font-size: 1.15rem; margin: 2rem 0 .5rem; }
.about p { margin: 0 0 1rem; line-height: 1.7; }
.about .signoff { margin-top: 2rem; text-align: right; color: var(--muted); }
.about .back-home { display: inline-block; margin-top: 2rem; }
@media (prefers-reduced-motion: reduce) {
  .thumb .mystery, .card.just-unlocked { animation: none; }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
