* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Comic Sans MS", "Chalkboard SE", "Comic Sans", cursive;
  color: #ffff00;
  background: #000080 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ctext y='28' font-size='24'%3E✦%3C/text%3E%3C/svg%3E")
    repeat;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Ctext y='14'%3E⭐%3C/text%3E%3C/svg%3E"),
    auto;
}

a {
  color: #00ffff;
  text-decoration: underline wavy #ff00ff;
}

a:hover {
  color: #ff00ff;
  background: #ffff00;
}

.blink {
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.rainbow {
  animation: rainbow 2s linear infinite;
  font-weight: bold;
}

@keyframes rainbow {
  0% {
    color: #ff0000;
  }
  17% {
    color: #ff8800;
  }
  33% {
    color: #ffff00;
  }
  50% {
    color: #00ff00;
  }
  67% {
    color: #00ffff;
  }
  83% {
    color: #ff00ff;
  }
  100% {
    color: #ff0000;
  }
}

.site-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px;
}

.header-box {
  border: 6px ridge #c0c0c0;
  background: linear-gradient(180deg, #0000aa 0%, #000040 100%);
  padding: 16px;
  text-align: center;
  box-shadow: 8px 8px 0 #000;
}

h1 {
  font-family: "Papyrus", "Impact", fantasy;
  font-size: clamp(2rem, 8vw, 4.5rem);
  margin: 0;
  text-shadow: 4px 4px #ff00ff, -2px -2px #00ffff;
  letter-spacing: 2px;
}

.marquee-wrap {
  background: #000;
  border: 3px inset #808080;
  margin: 12px 0;
  overflow: hidden;
}

.marquee-wrap marquee {
  font-size: 1.1rem;
  color: #0f0;
  font-family: "Courier New", monospace;
}

.counter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  font-size: 0.95rem;
  margin: 10px 0;
}

.counter-bar span {
  background: #000;
  border: 2px inset #c0c0c0;
  padding: 4px 10px;
  font-family: "Courier New", monospace;
  color: #0f0;
}

#game-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 16px 0;
}

.game-tab {
  font-family: "Tahoma", "Arial", sans-serif;
  font-size: 1rem;
  font-weight: bold;
  padding: 10px 16px;
  border: 4px outset #dfdfdf;
  background: linear-gradient(180deg, #ece9d8, #d4d0c8);
  color: #000080;
  cursor: pointer;
}

.game-tab:hover {
  background: #ffff99;
}

.game-tab.active {
  border-style: inset;
  background: #ffcccc;
  color: #800000;
}

.toolbar {
  text-align: center;
  margin-bottom: 12px;
}

.btn-retro {
  font-family: "Tahoma", sans-serif;
  font-size: 1rem;
  padding: 8px 20px;
  border: 4px outset #dfdfdf;
  background: #ece9d8;
  cursor: pointer;
}

.btn-retro:active {
  border-style: inset;
}

#load-status {
  text-align: center;
  font-family: "Courier New", monospace;
  margin: 8px 0;
  padding: 6px;
  background: #000;
  border: 2px dashed #0f0;
}

.status-error {
  color: #ff6666;
}

.status-ok {
  color: #66ff66;
}

.panel {
  border: 5px ridge #ff00ff;
  background: rgba(0, 0, 64, 0.92);
  margin: 16px 0;
  padding: 14px;
  box-shadow: 6px 6px 0 #000;
}

.panel.inset {
  border-style: inset;
  margin: 8px 0;
  background: rgba(0, 0, 32, 0.95);
}

.panel h2,
.panel h3 {
  font-family: "Times New Roman", serif;
  color: #00ffff;
  margin-top: 0;
  text-decoration: underline;
}

.hero-panel .big-stat {
  font-size: 1.2rem;
}

.tagline {
  font-style: italic;
  color: #ff99ff;
}

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 700px) {
  .columns {
    grid-template-columns: 1fr;
  }
}

.retro-table {
  width: 100%;
  border-collapse: separate;
  background: #000;
  color: #fff;
  font-size: 0.95rem;
}

.retro-table th {
  background: #800080;
  color: #ffff00;
  font-family: "Arial Black", sans-serif;
}

.retro-table td {
  background: #000040;
  vertical-align: top;
}

.retro-table tr:nth-child(even) td {
  background: #000060;
}

.winner-name {
  color: #0f0;
  font-size: 1.1em;
}

.obs-cell {
  max-width: 280px;
  font-size: 0.85rem;
  white-space: pre-wrap;
  color: #ffccff;
}

.tally-list {
  margin: 0;
  padding-left: 1.4rem;
}

.empty {
  color: #aaa;
  font-style: italic;
}

.construction {
  text-align: center;
  font-size: 2rem;
  animation: wiggle 0.3s ease-in-out infinite alternate;
}

@keyframes wiggle {
  from {
    transform: rotate(-3deg);
  }
  to {
    transform: rotate(3deg);
  }
}

.footer {
  text-align: center;
  margin-top: 24px;
  padding: 16px;
  border-top: 4px double #ff00ff;
  font-size: 0.85rem;
  color: #ccc;
}

.webring {
  margin: 12px 0;
  font-size: 0.9rem;
}

.webring a {
  margin: 0 6px;
}

hr {
  border: none;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    #f00,
    #ff0 20px,
    #0f0 40px,
    #0ff 60px,
    #00f 80px,
    #f0f 100px
  );
}

.manifest-section {
  border-color: #ffd700;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 0, 255, 0.15), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(0, 255, 255, 0.12), transparent 35%),
    linear-gradient(135deg, #4a3728 0%, #6b4f3a 35%, #5c4033 70%, #3d2914 100%);
  position: relative;
  overflow: hidden;
}

.manifest-section::before {
  content: "✦ ✧ ★ ✧ ✦";
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 1.2rem;
  color: #ffd700;
  opacity: 0.7;
  animation: blink 1.2s step-end infinite;
  pointer-events: none;
}

.manifest-title {
  font-family: "Papyrus", fantasy;
  color: #ffd700;
  text-align: center;
  margin: 0 0 8px;
  text-shadow: 2px 2px #800080;
}

.manifest-sub {
  text-align: center;
  color: #ffccff;
  margin: 0 0 20px;
  font-size: 1rem;
}

.manifest-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  padding: 12px 8px 20px;
  min-height: 120px;
}

.manifest-card {
  margin: 0;
  padding: 10px 10px 28px;
  background: #fffef5;
  border: 2px solid #ddd;
  box-shadow:
    4px 4px 12px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px #fff;
  transform: rotate(var(--tilt, -2deg));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  max-width: 260px;
  position: relative;
}

.manifest-card::before {
  content: "📌";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem;
  filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.4));
  z-index: 1;
}

.manifest-card:hover {
  transform: rotate(0deg) scale(1.05);
  z-index: 2;
  box-shadow: 8px 8px 20px rgba(255, 0, 255, 0.4);
}

.manifest-img-wrap {
  position: relative;
  display: block;
}

.manifest-img-wrap.is-missing {
  min-height: 140px;
  background: #300;
  border: 2px dashed #f66;
  display: flex;
  align-items: center;
  justify-content: center;
}

.manifest-img-wrap.is-missing::after {
  content: "Image missing on server — upload the images/ folder to S3";
  color: #faa;
  font-size: 0.75rem;
  text-align: center;
  padding: 12px;
  max-width: 200px;
}

.manifest-img-wrap.is-missing img {
  display: none;
}

.manifest-card img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border: 1px inset #999;
}

.manifest-card--banned img {
  filter: grayscale(0.35) contrast(1.05);
}

.manifest-card--banned .no-sign {
  position: absolute;
  inset: 6%;
  border: 7px solid #ff0000;
  border-radius: 50%;
  box-shadow:
    0 0 0 3px #fff,
    0 0 12px rgba(255, 0, 0, 0.8);
  pointer-events: none;
  z-index: 2;
}

.manifest-card--banned .no-sign::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 88%;
  height: 9px;
  background: #ff0000;
  border-radius: 3px;
  transform: translate(-50%, -50%) rotate(-45deg);
  box-shadow: 0 0 0 2px #fff;
}

.manifest-card figcaption {
  margin-top: 10px;
  font-family: "Comic Sans MS", cursive;
  font-size: 0.9rem;
  color: #333;
  text-align: center;
  line-height: 1.3;
  font-style: italic;
}

.manifest-card:nth-child(odd) {
  animation: float-wobble 4s ease-in-out infinite;
}

.manifest-card:nth-child(even) {
  animation: float-wobble 4.5s ease-in-out infinite reverse;
}

@keyframes float-wobble {
  0%,
  100% {
    transform: rotate(var(--tilt, -2deg)) translateY(0);
  }
  50% {
    transform: rotate(calc(var(--tilt, -2deg) + 1deg)) translateY(-4px);
  }
}
