:root {
  --ink: #1b1230;
  --paper: #fff7ea;
  --gap: 18px;
  --min-card-w: 440px;
  --min-card-h: 220px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 26px 32px 18px;
  color: var(--paper);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 92, 138, 0.55), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(86, 214, 255, 0.45), transparent 26%),
    radial-gradient(circle at 78% 88%, rgba(255, 214, 74, 0.28), transparent 24%),
    linear-gradient(160deg, #2a1658 0%, #1a1038 48%, #10203f 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 80%);
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(8px);
  pointer-events: none;
}

.glow-a { width: 220px; height: 220px; left: -60px; bottom: 40px; background: rgba(255, 122, 89, 0.35); }
.glow-b { width: 160px; height: 160px; right: 8%; top: 18%; background: rgba(125, 236, 200, 0.28); }
.glow-c { width: 120px; height: 120px; right: 18%; bottom: 12%; background: rgba(255, 179, 217, 0.3); }

.top, .board, .bottom { position: relative; z-index: 1; }

.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-width: 0;
  margin-bottom: 18px;
}

.brand { min-width: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  padding: 6px 12px 6px 10px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #ffe566;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  box-shadow: 4px 4px 0 var(--ink);
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff3b6b;
  box-shadow: 0 0 0 0 rgba(255, 59, 107, 0.7);
  animation: pulse 1.6s infinite;
}

h1 {
  margin: 0;
  color: white;
  font-size: clamp(36px, 4.6vw, 64px);
  line-height: 0.95;
  letter-spacing: -0.05em;
  text-shadow: 4px 4px 0 var(--ink);
}

.page-pill {
  margin: 0;
  padding: 12px 18px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: white;
  color: var(--ink);
  font-size: clamp(20px, 2vw, 32px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: 5px 5px 0 var(--ink);
}

.board {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows, 1), minmax(0, 1fr));
  gap: var(--gap);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
  padding: 22px 24px 20px;
  border: 4px solid var(--ink);
  border-radius: 28px;
  background: var(--tone, #ffe566);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 8px 8px 0 var(--ink);
}

.card::before,
.card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.card::before {
  width: 150px;
  height: 150px;
  top: -58px;
  right: -36px;
  background: rgba(255, 255, 255, 0.38);
}

.card::after {
  width: 28px;
  height: 28px;
  top: 18px;
  right: 18px;
  background: white;
  border: 3px solid var(--ink);
}

.tone-0 { --tone: #ffe566; }
.tone-1 { --tone: #ff8d72; }
.tone-2 { --tone: #7eebc8; }
.tone-3 { --tone: #a9c0ff; }
.tone-4 { --tone: #ffb7e0; }
.tone-5 { --tone: #d7f56e; }

.who {
  align-self: flex-start;
  max-width: 100%;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  font-size: clamp(16px, 1.6vw, 24px);
  font-weight: 800;
}

.title {
  position: relative;
  font-size: clamp(32px, 3.2vw, 54px);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1.12;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.empty {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  display: grid;
  place-items: center;
  margin: 0;
  border: 4px dashed rgba(255, 255, 255, 0.45);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: clamp(24px, 3vw, 42px);
  font-weight: 800;
  text-align: center;
}

.bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-width: 0;
  margin-top: 16px;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-height: 14px;
}

.dot {
  width: 12px;
  height: 12px;
  border: 2px solid white;
  border-radius: 50%;
  background: transparent;
}

.dot.on {
  background: #ffe566;
  border-color: #ffe566;
}

.progress {
  height: 12px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

#progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ffe566, #ff8d72);
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(255, 59, 107, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 107, 0); }
}

@media (max-width: 720px) {
  body { padding: 16px; }
  :root {
    --min-card-w: 220px;
    --min-card-h: 132px;
    --gap: 12px;
  }
  .card { box-shadow: 5px 5px 0 var(--ink); }
}
