:root {
  --bg: #191225;
  --panel: #241a37;
  --panel-2: #2c2044;
  --line: #3c2d5a;
  --ink: #f2e9ff;
  --muted: #b7a6d9;
  --pink: #ff6fa5;
  --gold: #ffce54;
  --ok: #7de3a8;
  --err: #ff8a80;
  --display: "Baloo 2", ui-rounded, "Segoe UI Rounded", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 15% 0%, rgba(255, 111, 165, 0.14), transparent 45%),
    radial-gradient(circle at 90% 15%, rgba(255, 206, 84, 0.1), transparent 40%);
}
.wrap { max-width: 640px; margin: 0 auto; padding: 1.75rem 1rem 5rem; }

.hero { text-align: center; margin-bottom: 1.6rem; }
.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 9vw, 2.8rem);
  margin: 0 0 0.5rem;
  color: var(--gold);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}
.hero p {
  margin: 0 auto;
  max-width: 48ch;
  color: var(--muted);
  font-size: 0.9rem;
}

section { margin-top: 1.4rem; }

.auth-card, .about-card {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}
.who { font-size: 0.85rem; margin-bottom: 0.6rem; }
.who .h { color: var(--gold); font-weight: 700; }
.who a { color: var(--gold); cursor: pointer; }
.signin-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.signin-row input {
  flex: 1;
  min-width: 12ch;
  font-family: var(--mono);
  font-size: 0.92rem;
  padding: 0.6rem 0.7rem;
  border: 2px solid var(--line);
  background: #150f21;
  color: var(--ink);
  border-radius: 8px;
}
.signin-row input::placeholder { color: #6e5f8f; }
button {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.6rem 1.05rem;
  border: 2px solid var(--gold);
  background: transparent;
  color: var(--gold);
  border-radius: 999px;
  cursor: pointer;
}
button:hover { background: rgba(255, 206, 84, 0.12); }
button:disabled { opacity: 0.4; cursor: default; }
button.ghost { border-color: var(--line); color: var(--ink); }
button.ghost:hover { background: rgba(255, 255, 255, 0.06); }
.fine-print {
  font-size: 0.74rem;
  color: var(--muted);
  margin: 0.7rem 0 0;
  border-top: 1px dashed var(--line);
  padding-top: 0.6rem;
}
.fine-print em { color: var(--ink); font-style: normal; }

.board-section { }
.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.progress {
  font-family: var(--display);
  font-weight: 700;
  color: var(--pink);
  font-size: 1rem;
}

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  border: 3px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  background: #100a1a;
}
.stage .photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cover-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 2px;
}
.tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--panel-2), #201636);
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.tile.locked { cursor: default; }
.tile.pending { cursor: pointer; }
.tile.pending:hover { filter: brightness(1.15); }
.tile.pending:active { transform: scale(0.96); }
.tile.revealed {
  opacity: 0;
  transform: scale(1.15);
  pointer-events: none;
}
.tile.busy { cursor: wait; opacity: 0.85; }
.tile .tile-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px;
  width: 100%;
  height: 100%;
  text-align: center;
}
.tile .avatar {
  width: 42%;
  aspect-ratio: 1 / 1;
  max-width: 34px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.tile .handle {
  font-size: 0.52rem;
  color: var(--muted);
  max-width: 95%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile .heart {
  font-size: 0.85rem;
  filter: grayscale(0.2);
}
.tile.empty .heart { opacity: 0.25; font-size: 0.7rem; }
.tile.empty .handle { opacity: 0.4; }
.tile .spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--gold);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status { font-size: 0.8rem; color: var(--muted); margin-top: 0.6rem; min-height: 1.2em; }
.status.err { color: var(--err); }
.status.ok { color: var(--ok); }

.about-card { margin-top: 1.6rem; }
.about-card h2 {
  font-family: var(--display);
  color: var(--gold);
  font-size: 1rem;
  margin: 0 0 0.6rem;
}
.about-card ul { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.82rem; }
.about-card li { margin-bottom: 0.45rem; }
.about-card code { color: var(--ink); }

footer { margin-top: 2.5rem; color: var(--muted); font-size: 0.76rem; text-align: center; }
footer a { color: var(--gold); }

.done-banner {
  margin-top: 0.8rem;
  background: linear-gradient(135deg, rgba(255, 111, 165, 0.18), rgba(255, 206, 84, 0.14));
  border: 2px solid var(--pink);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}
