/* Old-homepage look: twinkling star background, boxes floating on top. */
:root {
  --sky: #000033;
  --star: #ffffff;
  --ink: #ffff00;
  --text: #ffffff;
  --link: #00ffff;
  --panel: #000080;
  --edge: #c0c0c0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--text);
  font: 16px/1.4 "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Times New Roman", serif;
  background-color: var(--sky);
  /* the starfield lives on a fixed layer behind everything (see body::before) */
}

/* Fixed star background: stays put while the page scrolls over it.
   A fixed layer works on phones too, where background-attachment: fixed often doesn't. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--sky) url("deco/stars.gif");
  image-rendering: pixelated;
}

main { max-width: 720px; margin: 0 auto; padding: 16px; }

.center { text-align: center; }
.small { font-size: 13px; }

.banner-head { text-align: center; }
.banner-head .small { margin: 0; color: var(--link); }
h1 {
  margin: 4px 0;
  font-family: "Times New Roman", Times, serif;
  font-size: 48px;
  color: var(--ink);
  text-shadow: 3px 3px 0 #ff00ff;
}
.subtitle { margin: 0; color: #ff99ff; font-weight: bold; }

h2 { margin: 0 0 8px; font-size: 18px; color: var(--ink); }

hr.rainbow {
  border: 0;
  height: 6px;
  margin: 16px 0;
  background: linear-gradient(90deg, #ff0000, #ff9900, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff);
}

.uc-bar { max-width: 100%; height: auto; image-rendering: pixelated; }

table.layout { width: 100%; border-spacing: 8px; }
table.layout td { vertical-align: top; width: 50%; }

.panel {
  background: var(--panel);
  border: 3px ridge var(--edge);
  padding: 10px;
  margin: 12px 0;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.6);
}
table.layout .panel { margin: 0; }

label { display: block; margin-bottom: 8px; }
input {
  width: 100%; margin-top: 4px; padding: 4px;
  font: 14px "Courier New", Courier, monospace;
  color: #000; background: #fff; border: 2px inset var(--edge);
}
button {
  font: bold 14px Arial, Helvetica, sans-serif;
  padding: 3px 10px; cursor: pointer;
  color: #000; background: var(--edge); border: 2px outset #fff;
}
button:active { border-style: inset; }

.code {
  font: bold 20px "Courier New", Courier, monospace; letter-spacing: 1px; text-align: center;
  word-break: break-all; color: #000; background: #ffffcc; padding: 8px; border: 2px dashed #ff00ff;
}
.save { border-color: #ff00ff; }

#codes { padding-left: 20px; }
#codes li { margin-bottom: 4px; }
#codes button { font-size: 12px; padding: 0 6px; margin-left: 6px; }

#msg { min-height: 1.4em; font-weight: bold; color: #ff6666; }

.counter-box { margin: 8px 0; }
.counter {
  display: inline-block; margin-top: 4px; padding: 2px 6px;
  font: bold 20px "Courier New", Courier, monospace; letter-spacing: 4px;
  color: #00ff00; background: #000; border: 2px inset var(--edge);
}

table.webring {
  width: 100%; margin: 12px 0; border: 3px ridge var(--edge);
  background: var(--panel); border-collapse: collapse;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.6);
}
table.webring td { padding: 6px; color: var(--link); }
table.webring td:last-child { text-align: right; }

/* ---------- logged-in views ---------- */

a { color: var(--link); }
a:visited { color: #ff99ff; }

.nav { text-align: center; }
.visit { margin-top: 8px; }
.player-list { margin-top: 6px; max-height: 96px; overflow-y: auto; font-size: 14px; line-height: 1.6; padding: 4px 6px; background: #000033; border: 2px inset var(--edge); }
.visit input { display: inline-block; width: 140px; }

textarea, select {
  width: 100%; margin-top: 4px; padding: 4px;
  font: 14px "Courier New", Courier, monospace;
  color: #000; background: #fff; border: 2px inset var(--edge);
}

img.banner { display: block; image-rendering: pixelated; border: 2px solid transparent; }
img.rarity-uncommon { border-color: #00ffff; }
img.rarity-rare { border-color: #ffff00; }
img.rarity-ultra { border-color: #ff00ff; outline: 1px solid #ffffff; }
.card.rarity-ultra b, .variant { color: #ff99ff; font-weight: bold; }

.grid { display: flex; flex-wrap: wrap; gap: 8px; }
.tile { display: flex; flex-direction: column; align-items: center; text-decoration: none; }

.pull-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 8px 0; }
.card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 196px; padding: 8px; text-align: center;
  background: #000033; border: 3px ridge var(--edge);
}
.card.back {
  height: 120px; justify-content: center;
  font: bold 48px "Times New Roman", serif; color: var(--ink);
  background: repeating-linear-gradient(45deg, #000080 0 8px, #000060 8px 16px);
}
.card.pickable { cursor: pointer; }
.card.chosen {
  border: 4px solid #ffff00;
  background: #000066;
  box-shadow: 0 0 0 3px #ff00ff, 0 0 18px 6px #ffff00;
  animation: glow 0.8s ease-in-out infinite alternate;
}
.card.chosen::before {
  content: "\2605 KEEPING THIS 1 \2605";
  font: bold 13px Arial, Helvetica, sans-serif;
  color: #000; background: #ffff00; padding: 1px 6px; margin-top: -2px;
}
@keyframes glow {
  to { box-shadow: 0 0 0 3px #00ffff, 0 0 28px 10px #ff00ff; }
}
.radio { padding: 3px 6px; border: 2px solid transparent; }
.radio:has(input:checked) { border: 2px dashed #ffff00; background: #000066; }
.card.rarity-rare b { color: var(--ink); }
.bonus-card { justify-content: center; min-height: 120px; background: repeating-linear-gradient(45deg, #330066 0 8px, #220044 8px 16px); border-color: #ff00ff; }
.bonus-card b { color: #ffff00; }
.bonus-star { font-size: 32px; line-height: 1; }
.bonus-head b { color: #ffff00; }
.pull-form { max-width: 420px; margin: 8px auto 0; }
.gift-choices { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.radio { display: flex; align-items: center; gap: 6px; margin: 0; cursor: pointer; }
.radio input { width: auto; margin: 0; }
.radio img.banner { display: inline-block; }

.sign-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.gift-chosen { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0; padding: 4px 6px; border: 2px dashed #ffff00; background: #000066; }
.gift-chosen img.banner { display: inline-block; }
button.mini { font-size: 12px; padding: 0 6px; }
.gift-picker { margin: 8px 0; background: #000033; }
.pick-tile { background: transparent; border: 2px solid transparent; padding: 2px; color: var(--text); cursor: pointer; }
.pick-tile:hover, .pick-tile:focus { border-color: #ffff00; }
h3 { margin: 10px 0 6px; font-size: 15px; color: var(--link); }
.pick-tile.picked { border-color: #ffff00; background: #000066; box-shadow: 0 0 6px #ffff00; }
.pick-tile.busy { opacity: 0.6; cursor: not-allowed; }
.trade-note { border-top-style: solid; }
.trade-note > p:first-child { color: #ffff00; font-weight: bold; }
.tr-item { display: inline-flex; align-items: center; gap: 4px; margin: 2px 4px 2px 0; vertical-align: middle; }
.tr-item img.banner { display: inline-block; }
#nav-trades.has-offers { color: #ffff00; font-weight: bold; }
.entry { border-top: 2px dashed var(--edge); padding-top: 6px; margin-top: 8px; }
.entry p { margin: 4px 0; }
.stamp { display: flex; align-items: center; gap: 6px; }
.log { padding-left: 24px; }
.ledger-list { font-size: 14px; padding-left: 32px; }
.ledger-list li { margin-bottom: 6px; overflow-wrap: anywhere; }
.led-meta { font: 12px "Courier New", Courier, monospace; color: #aaaaff; }
.led-meta .hash { font-size: 12px; }
.led-what { line-height: 1.3; }
.hide-bots .from-bot { display: none; }
.bot-toggle { margin: 8px 0 0; }
.bot-toggle label { display: inline; }
.bot-toggle input { width: auto; display: inline; margin: 0 4px 0 0; }
.bot-badge, .bot-note { color: #00ff00; font-family: "Courier New", Courier, monospace; }
.credit { margin: 4px 0; }
.credits { list-style: none; padding: 0; }
.credits li { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.credits .credit { display: inline; }
.hash { font-family: "Courier New", Courier, monospace; word-break: break-all; color: #00ff00; }
#ledger-ok.ok, .ok-text { color: #00ff00; }
#ledger-ok.bad, .bad-text { color: #ff6666; }
.danger-head { margin-top: 20px; color: #ff6666; }
#delete-account { color: #fff; background: #990000; border-color: #ff6666; }

/* ---------- in-game dialog window ---------- */
.dialog-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.dialog-window {
  width: 100%; max-width: 340px;
  background: #c0c0c0; color: #000; border: 3px outset #ffffff;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.6);
  font-family: Arial, Helvetica, sans-serif;
}
.dialog-title { background: #000080; color: #fff; font-weight: bold; padding: 3px 6px; font-size: 14px; }
.dialog-body { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; text-align: center; }
.dialog-body p { margin: 0; }
.dialog-pic img.banner { display: block; }
#dialog-input { width: 100%; }
.dialog-buttons { display: flex; justify-content: center; gap: 10px; margin: 0 0 12px; }

/* ---------- moving bits ---------- */

.marquee {
  overflow: hidden; white-space: nowrap;
  margin: 12px 0 0; padding: 2px 0;
  color: #00ff00; background: #000; border: 2px inset var(--edge);
  font: bold 14px "Courier New", Courier, monospace;
}
.marquee span { display: inline-block; padding-left: 100%; animation: scroll-left 18s linear infinite; }
@keyframes scroll-left { to { transform: translateX(-100%); } }

.button-strip { overflow: hidden; border: 3px ridge var(--edge); background: #000; padding: 4px 0; }
.strip-track { display: flex; gap: 6px; width: max-content; animation: strip 30s linear infinite; }
.strip-track img { display: block; image-rendering: pixelated; }
/* 10 buttons x (88px + 6px gap) = one full set */
@keyframes strip { to { transform: translateX(-940px); } }

/* people who ask their system for less motion get a still page */
@media (prefers-reduced-motion: reduce) {
  .marquee span, .strip-track, .card.chosen { animation: none; }
  body::before { background-image: none; }
  .marquee span { padding-left: 0; }
}

/* phones: stack the two boxes */
@media (max-width: 560px) {
  table.layout, table.layout tr, table.layout td { display: block; width: 100%; }
  table.layout { border-spacing: 0; }
  table.layout td { margin-bottom: 12px; }
  h1 { font-size: 36px; }
}
