/* THE FUTURE ARCADE - a plain, simple website with a late-90s skin.
   98.css gives the gray beveled boxes. Everything else is ours. */

@font-face { font-family: "Pixelify Sans"; src: url(../fonts/pixelify-sans-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pixelify Sans"; src: url(../fonts/pixelify-sans-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Press Start 2P"; src: url(../fonts/press-start-2p-400.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "VT323"; src: url(../fonts/vt323-400.woff2) format("woff2"); font-display: swap; }

:root {
  --ui: "Pixelify Sans", "Trebuchet MS", Verdana, sans-serif;
  --arcade: "Press Start 2P", "Courier New", monospace;
  --term: "VT323", "Courier New", monospace;
  --gray: #c0c0c0;
  --navy: #000080;
  --pink: #ff5fc8;
  --yellow: #ffd83d;
  --cyan: #29e0e0;
  --violet: #8b5cf6;
  --green: #5dff5d;
  --page-pad: 16px;
  --side-width: 320px;
  /* Height taken by everything except the game on the home page. The game shrinks to
     leave this much, so the first row of thumbnails peeks in at the bottom of the screen. */
  --around-game: 270px;
}

* { box-sizing: border-box; }
html {
  background-color: #0f8a8a;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128' shape-rendering='crispEdges'%3E%3Cg fill='%23ffd83d' opacity='.55'%3E%3Crect x='20' y='14' width='4' height='12'/%3E%3Crect x='16' y='18' width='12' height='4'/%3E%3C/g%3E%3Cg fill='%23ff5fc8' opacity='.5'%3E%3Crect x='84' y='40' width='12' height='4'/%3E%3Crect x='84' y='48' width='12' height='4'/%3E%3Crect x='84' y='40' width='4' height='12'/%3E%3Crect x='92' y='40' width='4' height='12'/%3E%3C/g%3E%3Cg fill='%2329e0e0' opacity='.6'%3E%3Crect x='44' y='84' width='4' height='4'/%3E%3Crect x='52' y='92' width='4' height='4'/%3E%3Crect x='60' y='84' width='4' height='4'/%3E%3C/g%3E%3Cg fill='%23ffffff' opacity='.35'%3E%3Crect x='108' y='104' width='4' height='4'/%3E%3Crect x='8' y='70' width='4' height='4'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(155deg, #13a8a2 0%, #0f7d92 45%, #5b4fd1 100%);
  background-attachment: fixed;
  overflow-y: scroll; /* keeps the layout from jumping when a page gets long */
}
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-family: var(--ui); font-size: 16px; color: #111; }
[hidden] { display: none !important; }

/* 98.css is built for an 11px font. Ours is bigger and easier to read. */
.title-bar, .window, button, input, label, legend, option, select, table, textarea {
  font-family: var(--ui);
  font-size: 15px;
  -webkit-font-smoothing: auto;
}
button:not(:disabled) { color: #111; text-shadow: none; }
button { min-height: 28px; cursor: pointer; }
input[type=text], textarea { height: auto; padding: 5px 7px; line-height: 1.3; }
p { margin: 0 0 10px; line-height: 1.45; }
a { color: var(--navy); }
.pix-icon { display: inline-flex; flex: none; line-height: 0; }
.pix-icon svg { display: block; }
.note { font-size: 13px; color: #444; }
.sunken { box-shadow: inset -1px -1px #fff, inset 1px 1px grey, inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a; background: #fff; padding: 9px 11px; }
h2.arc { font-family: var(--arcade); font-size: 13px; line-height: 1.6; margin: 0 0 10px; }
h3.arc { font-family: var(--arcade); font-size: 10px; line-height: 1.6; margin: 18px 0 6px; color: var(--navy); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

/* Links that look like the gray buttons */
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  background: silver;
  color: #111;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px grey, inset 2px 2px #dfdfdf;
}
.btn:active, .btn.on { box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a, inset -2px -2px #dfdfdf, inset 2px 2px grey; }
.btn:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }

/* ---------- top of every page ---------- */
.top { flex: none; display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; padding: 7px var(--page-pad); background: var(--gray); box-shadow: inset 0 2px #fff, inset 0 -2px grey; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--arcade); font-size: 16px; color: var(--navy); text-decoration: none; white-space: nowrap; }
.logo img { display: block; image-rendering: pixelated; }
.top nav { margin-left: auto; display: flex; gap: 6px; }
.top nav .btn { font-weight: 700; }

#marquee { flex: none; height: 24px; overflow: hidden; white-space: nowrap; background: #12003a; border-bottom: 2px solid #000; color: var(--yellow); font-family: var(--term); font-size: 22px; line-height: 23px; user-select: none; }
#marquee .track { display: inline-block; padding-left: 100%; animation: marquee 70s linear infinite; animation-delay: -9s; }
#marquee .sep { color: var(--pink); padding: 0 18px; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- page body ---------- */
.wrap { flex: 1; width: 100%; margin: 0 auto; padding: 10px var(--page-pad) 28px; display: flex; flex-direction: column; gap: 12px; }
.wrap.narrow { max-width: 860px; }
.window { --tb1: #000080; --tb2: #1084d0; }
.window > .title-bar { background: linear-gradient(90deg, var(--tb1), var(--tb2)); height: 26px; }
.title-bar-text { display: flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 15px; }
.title-bar-text .t { overflow: hidden; text-overflow: ellipsis; }
.window-body { margin: 8px; }
.doc { user-select: text; }

/* ---------- home: the game, with a few boxes beside it ---------- */
/* Two columns: the game with all the thumbnails right under it, and the side boxes next to them. */
.home {
  --ar: 1.7778; /* the game's shape; the page script sets the real one */
  /* free width = screen, minus page padding, scrollbar, box edges and the side column */
  --free: calc(100vw - var(--page-pad) * 2 - 18px - 18px - var(--side-width) - 12px);
  --game-w: clamp(320px, min(var(--free), calc((100vh - var(--around-game)) * var(--ar))), 1280px);
  display: grid;
  grid-template-columns: auto var(--side-width);
  justify-content: center;
  align-items: start;
  gap: 12px;
}
.player { grid-column: 1; --tb1: #4b1fa8; --tb2: #ff5fc8; }
.player > .window-body { margin: 6px; width: var(--game-w); }
.stage { position: relative; width: var(--game-w); aspect-ratio: var(--ar); background: #000; overflow: hidden; }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #000; }
.stage:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; }
.empty-state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; text-align: center; color: #fff; font-family: var(--term); font-size: 24px; background: radial-gradient(circle at 50% 38%, #3a2399, #0a0320 78%); }
.game-foot { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; padding-top: 6px; min-height: 34px; }
.game-foot .tools { margin-left: auto; }
.tools { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 14px; }
.chip { display: inline-block; padding: 1px 7px; background: #fff; border: 1px solid #111; box-shadow: 1px 1px 0 #111; font-size: 13px; white-space: nowrap; }
.badge { display: inline-block; flex: none; font-family: var(--arcade); font-size: 9px; line-height: 1; padding: 7px 8px; background: #15102b; color: var(--yellow); border: 2px solid var(--yellow); box-shadow: 2px 2px 0 #000; white-space: nowrap; text-decoration: none; }
a.badge:hover { color: #fff; border-color: #fff; }
.new-badge { flex: none; font-family: var(--arcade); font-size: 8px; color: #fff; background: #ff2d55; padding: 4px 5px; animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

.side { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; gap: 12px; }
.countdown { text-align: center; }
.countdown .digits { display: inline-block; margin: 2px 0 4px; padding: 4px 12px; background: #000; color: var(--green); font-family: var(--term); font-size: 44px; line-height: 1; letter-spacing: 2px; box-shadow: inset 1px 1px grey, inset -1px -1px #fff; }
.realtalk { --tb1: #a1123f; --tb2: #ff5f7a; }
.realtalk p:last-child { margin-bottom: 0; }
.scores-box { --tb1: #6a3d00; --tb2: #e08a00; }
table.scores { width: 100%; border-collapse: collapse; font-family: var(--term); font-size: 22px; line-height: 1.1; background: #0a0320; color: var(--green); }
table.scores td { padding: 2px 10px; }
table.scores td:first-child { width: 2em; color: var(--yellow); }
table.scores td:last-child { text-align: right; }
table.scores tr.me td { color: var(--pink); }
.score-entry { margin-bottom: 8px; padding: 8px; text-align: center; background: #fffbd1; border: 2px solid #111; }
.score-entry b { font-family: var(--arcade); font-size: 12px; color: #c2185b; }
.initials { font-family: var(--arcade) !important; font-size: 18px !important; width: 5em; text-align: center; text-transform: uppercase; letter-spacing: 5px; }

/* ---------- the grid of all games ---------- */
.library { grid-column: 1; --tb1: #0a5c7a; --tb2: #29b6e0; width: 0; min-width: 100%; } /* as wide as the game above it, never wider */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px 12px; padding: 4px; }
.card { display: block; min-width: 0; color: #111; text-decoration: none; }
.thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #0a0320; border: 2px solid #111; box-shadow: 3px 3px 0 #111; }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb-fallback { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 6px; text-align: center; color: #fff; font-family: var(--arcade); font-size: 9px; line-height: 1.5; background: linear-gradient(135deg, hsl(var(--hue) 70% 38%), hsl(calc(var(--hue) + 60) 75% 55%)); }
a.card:hover .thumb, a.card:focus-visible .thumb { border-color: var(--pink); box-shadow: 3px 3px 0 var(--pink); transform: translate(-1px, -1px); }
.card.playing .thumb { border-color: var(--violet); box-shadow: 3px 3px 0 var(--violet); }
.ribbon { position: absolute; left: 0; top: 0; padding: 4px 6px; background: #ff2d55; color: #fff; font-family: var(--arcade); font-size: 8px; }
.now { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 0; text-align: center; background: var(--violet); color: #fff; font-family: var(--arcade); font-size: 8px; }
.card-title { margin-top: 7px; font-weight: 700; font-size: 16px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { font-size: 13px; color: #444; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.mystery .thumb { display: grid; place-items: center; background: repeating-linear-gradient(-45deg, #2a2360 0 10px, #1d1848 10px 20px); border-style: dashed; box-shadow: none; }
.card.mystery .q { font-family: var(--arcade); font-size: 30px; color: var(--yellow); animation: blink 1.4s steps(2, start) infinite; }

/* ---------- how it was made ---------- */
.how { --tb1: #0b6b3a; --tb2: #37d67a; }
.made-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.made-head h2 { flex: 1; }
pre.prompt { margin: 0 0 6px; white-space: pre-wrap; word-break: break-word; font-family: var(--term); font-size: 20px; line-height: 1.15; max-height: 360px; overflow: auto; user-select: text; }
.made-list { margin: 0; padding-left: 22px; line-height: 1.45; }
.made-list li { margin-bottom: 4px; }

/* ---------- vote ---------- */
.vote { --tb1: #b3125e; --tb2: #ff9a1f; }
.vote-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.vote-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: #fff; box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #dfdfdf, inset -2px -2px grey, inset 2px 2px #fff; }
.vote-card h3 { margin: 0; font-family: var(--arcade); font-size: 11px; line-height: 1.6; color: var(--navy); }
.vote-card p { flex: 1; margin: 0; }
.vote-card.picked { background: #fffbd1; outline: 3px solid var(--pink); }
.vote-card .stamp { position: absolute; right: 6px; top: 6px; font-family: var(--arcade); font-size: 8px; color: #fff; background: var(--pink); padding: 4px 5px; transform: rotate(8deg); }

/* ---------- guestbook ---------- */
.guest { --tb1: #0a5c7a; --tb2: #29b6e0; }
.guest-list { max-height: 420px; overflow: auto; margin-bottom: 12px; user-select: text; }
.guest-entry { padding: 7px 0; border-bottom: 1px dashed #999; }
.guest-entry:last-child { border-bottom: 0; }
.guest-entry .who { font-weight: 700; color: var(--navy); }
.guest-entry .when { font-size: 12px; color: #666; margin-left: 6px; }
.guest-entry .msg { margin-top: 2px; line-height: 1.35; word-break: break-word; }
.form-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.form-row label { width: 76px; flex: none; padding-top: 6px; }
.form-row input, .form-row textarea { flex: 1; min-width: 0; resize: vertical; }

/* ---------- about ---------- */
.about { --tb1: #3a3a8c; --tb2: #8b5cf6; }

/* ---------- small retro touches ---------- */
.construction { display: flex; align-items: center; gap: 10px; padding: 6px 10px; font-family: var(--arcade); font-size: 9px; line-height: 1.6; color: #111; background: repeating-linear-gradient(-45deg, #ffd83d 0 14px, #111 14px 28px); }
.construction .inner { flex: 1; background: #ffd83d; padding: 5px 8px; border: 2px solid #111; }
.webring { display: flex; gap: 6px; flex-wrap: wrap; }
.b88 { width: 88px; height: 31px; display: flex; align-items: center; justify-content: center; text-align: center; font-family: var(--arcade); font-size: 6px; line-height: 1.5; color: #fff; border: 2px outset #ddd; user-select: none; }
.b88.a { background: linear-gradient(90deg, #5b4fd1, #ff5fc8); }
.b88.b { background: #111; color: var(--green); }
.b88.c { background: repeating-linear-gradient(-45deg, #ffd83d 0 6px, #111 6px 12px); }
.b88.c span { background: #ffd83d; color: #111; padding: 1px 3px; }
.ad { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; background: repeating-linear-gradient(90deg, #fff 0 8px, #f1f1f1 8px 16px); border: 2px dashed #777; color: #555; font-family: var(--term); font-size: 18px; line-height: 1.05; }
.ad b { font-family: var(--arcade); font-size: 9px; font-weight: 400; color: #333; }
.ad.box { height: 100px; }
.ad.banner { width: 468px; max-width: 100%; height: 60px; margin: 0 auto; }
.glitch { animation: glitch 9s steps(1) infinite; }
@keyframes glitch {
  0%, 96%, 100% { text-shadow: none; transform: none; }
  97% { text-shadow: 2px 0 var(--cyan), -2px 0 var(--pink); transform: translateX(1px); }
  98% { text-shadow: -2px 0 var(--cyan), 2px 0 var(--pink); transform: translateX(-2px) skewX(-6deg); }
  99% { text-shadow: 1px 0 var(--cyan), -1px 0 var(--pink); transform: none; }
}

/* ---------- bottom of every page ---------- */
#footer { flex: none; background: var(--gray); box-shadow: inset 0 2px #fff; }
.foot-row { display: flex; align-items: center; justify-content: center; gap: 12px 28px; flex-wrap: wrap; padding: 12px var(--page-pad) 6px; }
.counter { display: flex; align-items: center; gap: 8px; font-family: var(--term); font-size: 19px; line-height: 1; }
.counter b { padding: 3px 8px; background: #000; color: var(--green); font-weight: 400; font-size: 24px; letter-spacing: 3px; }
.dl { display: flex; align-items: center; gap: 8px; font-family: var(--term); font-size: 19px; line-height: 1; }
.dl .bar { width: 120px; height: 14px; padding: 2px; background: #fff; box-shadow: inset 1px 1px grey, inset -1px -1px #dfdfdf; }
.dl .bar i { display: block; height: 100%; background: var(--violet); transition: width .6s; }
.fine { margin: 0; padding: 4px var(--page-pad) 14px; text-align: center; font-size: 14px; color: #333; }

/* Narrow windows: the side boxes drop under the game. (Phones aren't supported yet.) */
@media (max-width: 980px) {
  .home { grid-template-columns: auto; --free: calc(100vw - var(--page-pad) * 2 - 18px - 18px); }
  .side { grid-column: 1; grid-row: auto; }
  .vote-cards { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  #marquee .track { animation: none; padding-left: 12px; }
  .new-badge, .card.mystery .q, .glitch { animation: none; }
}
