:root {
  --bg: #eaf3ff;
  --ink: #0b1f33;
  --muted: #57708c;
  --accent: #1185fe;
  --accent2: #2fb88a;
  --gold: #f5a623;
  --card: #ffffff;
  --shadow: rgba(11, 31, 51, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at top, #f5faff 0%, var(--bg) 60%, #d9e9ff 100%);
  color: var(--ink);
  min-height: 100vh;
}

#flock {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 20px 64px;
  position: relative;
  z-index: 1;
}

header {
  text-align: center;
  margin-bottom: 28px;
}

h1 {
  font-size: 2.6rem;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  font-size: 1.1rem;
  margin: 0 0 6px;
  color: var(--ink);
}

.brief {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border-radius: 20px;
  padding: 28px 26px;
  box-shadow: 0 12px 30px var(--shadow);
  text-align: center;
}

.crown-label {
  margin: 0 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.crown-term {
  margin: 0 0 6px;
  min-height: 2.6em;
  display: flex;
  align-items: center;
  justify-content: center;
}

#crown-word {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  word-break: break-word;
  transition: opacity 0.25s ease;
}

.crown-count {
  margin: 0 0 22px;
  font-size: 0.85rem;
  color: var(--muted);
}

.board {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.board li {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.board .rank {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.board .bar-wrap {
  position: relative;
  background: #eaf3ff;
  border-radius: 999px;
  height: 22px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.board .bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0.35;
  transition: width 0.6s ease;
}

.board .term {
  position: relative;
  padding: 0 10px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board .count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.board .empty {
  grid-column: 1 / -1;
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

.live-count {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.asterisk {
  cursor: help;
  color: var(--accent);
}

.actions {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 12px var(--shadow);
  transition: transform 0.15s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn.primary {
  background: linear-gradient(90deg, var(--accent), var(--gold));
  color: #fff;
  font-size: 1.05rem;
  padding: 14px 28px;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

footer {
  margin-top: 44px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

footer p { margin: 6px 0; }

footer a {
  color: var(--accent2);
  text-decoration: none;
}
footer a:hover { text-decoration: underline; }

.fineprint {
  font-size: 0.72rem;
  opacity: 0.8;
}

@media (max-width: 480px) {
  h1 { font-size: 2.1rem; }
  #crown-word { font-size: 1.6rem; }
}
