/* Color Swirl. Copyright © 2026 Adam Sho* and Co. All rights reserved. */

:root {
  --ink: #2a1248;
  --ink-soft: #5b3a7a;
  --paper: #fff7ee;
  --card: #fffdf9;
  --line: rgba(42, 18, 72, 0.12);
  --pink: #ff6b9a;
  --mint: #3dceb0;
  --gold: #ffd166;
  --sky: #6cb6ff;
  --violet: #a78bfa;
  --shadow: 0 18px 40px rgba(42, 18, 72, 0.18);
  --radius: 28px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 10% -10%, #ffd6e8 0%, transparent 55%),
    radial-gradient(900px 600px at 110% 10%, #c9f4ea 0%, transparent 50%),
    radial-gradient(800px 500px at 50% 120%, #d9c7ff 0%, transparent 55%),
    var(--paper);
  overflow-x: hidden;
  padding-bottom: calc(24px + var(--safe-bottom));
}

h1,
h2,
.ask,
.answer-name,
.level-card strong,
.mode-card strong,
.btn,
.lang-btn,
.lang-toggle {
  font-family: "Fredoka", "Nunito", sans-serif;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.45;
  animation: drift 16s ease-in-out infinite;
}

.b1 {
  width: 180px;
  height: 180px;
  background: #ffb3c7;
  top: 12%;
  left: -40px;
}

.b2 {
  width: 220px;
  height: 220px;
  background: #9de7d3;
  top: 48%;
  right: -60px;
  animation-delay: -4s;
}

.b3 {
  width: 140px;
  height: 140px;
  background: #ffe08a;
  bottom: 8%;
  left: 18%;
  animation-delay: -8s;
}

.b4 {
  width: 120px;
  height: 120px;
  background: #c4b5fd;
  top: 8%;
  right: 18%;
  animation-delay: -2s;
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(18px, -22px) scale(1.08);
  }
}

.float-icons {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.floater {
  position: absolute;
  width: 42px;
  height: 42px;
  opacity: 0.55;
  animation: floaty 9s ease-in-out infinite;
}

.f1 { top: 18%; left: 6%; animation-delay: -1s; }
.f2 { top: 28%; right: 8%; width: 36px; animation-delay: -3s; }
.f3 { bottom: 22%; left: 10%; width: 34px; animation-delay: -5s; }
.f4 { bottom: 16%; right: 12%; animation-delay: -2s; }
.f5 { top: 62%; left: 4%; width: 30px; animation-delay: -6s; }
.f6 { top: 72%; right: 6%; width: 46px; animation-delay: -7s; }

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0) rotate(-8deg);
  }
  50% {
    transform: translateY(-14px) rotate(8deg);
  }
}

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

.topbar,
main,
footer {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(16px + var(--safe-top)) 20px 8px;
  max-width: 760px;
  margin: 0 auto;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.brand:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 12px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  filter: drop-shadow(0 6px 10px rgba(42, 18, 72, 0.25));
}

.brand h1 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.tagline {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.copyright {
  margin: 6px 0 0;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--ink-soft);
  line-height: 1.35;
}

.copyright-header {
  max-width: 16.5rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.restart-btn {
  position: relative;
  width: auto;
  height: 36px;
  min-height: 36px;
  padding: 0 14px 0 12px;
  font-size: 0.88rem;
  line-height: 1;
  border-width: 2px;
  border-radius: 999px;
  box-shadow: none;
  background: rgba(255, 253, 249, 0.8);
  gap: 6px;
}

.restart-btn .restart-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.restart-btn[hidden] {
  display: none !important;
}

.restart-btn:hover,
.restart-btn:active {
  transform: none;
  box-shadow: none;
}

.lang-picker {
  position: relative;
  flex-shrink: 0;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 36px;
  padding: 0 8px 0 12px;
  background: rgba(255, 253, 249, 0.8);
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
}

.lang-caret {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}

.lang-picker.is-open .lang-caret {
  transform: rotate(180deg);
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 88px;
  flex-direction: column;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 4px 4px 0 var(--ink);
  overflow: hidden;
  z-index: 20;
}

.lang-picker.is-open .lang-menu {
  display: flex;
}

.lang-menu .lang-btn {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
}

.lang-btn {
  border: 0;
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
  padding: 8px 11px;
  cursor: pointer;
}

.lang-btn.is-active {
  background: var(--ink);
  color: #fff;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 24px;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
  animation: pop-in 0.45s cubic-bezier(0.2, 0.9, 0.25, 1);
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.card {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 8px 8px 0 var(--ink);
  padding: 24px 22px 26px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 1.7rem;
}

.lede {
  margin: 0 0 22px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.field {
  margin-bottom: 22px;
}

.field-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 800;
}

.icon-wrap {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 10px;
  color: var(--ink);
}

.icon-wrap svg {
  width: 16px;
  height: 16px;
}

input[type="text"] {
  width: 100%;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  padding: 12px 14px;
  font: 700 16px/1.2 "Nunito", sans-serif;
  color: var(--ink);
  background: #fff;
}

input[type="text"]:focus {
  outline: 3px solid var(--mint);
  outline-offset: 1px;
}

.levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.level-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  background: #fff;
  padding: 12px 10px;
  cursor: pointer;
  color: inherit;
  min-height: 108px;
}

.level-card:hover {
  background: #f7f3ff;
}

.level-card:focus-visible {
  background: #f7f3ff;
  outline: 3px solid var(--mint);
  outline-offset: 2px;
}

.level-card strong {
  font-size: 0.95rem;
}

.level-card small {
  color: var(--ink-soft);
  font-size: 0.75rem;
  line-height: 1.25;
}

.level-swatches {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
}

.level-swatches i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
}

.modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  border: 2.5px solid var(--ink);
  border-radius: 22px;
  background: #fff;
  padding: 16px 14px;
  cursor: pointer;
  color: inherit;
  min-height: 168px;
}

.mode-card:hover {
  background: #f7f3ff;
}

.mode-card:focus-visible {
  background: #f7f3ff;
  outline: 3px solid var(--mint);
  outline-offset: 2px;
}

.mode-card strong {
  font-size: 1.05rem;
}

.mode-card small {
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.3;
}

.mode-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 64px;
  margin-bottom: 4px;
}

.mode-preview i {
  flex-shrink: 0;
  aspect-ratio: 1;
  box-sizing: border-box;
}

.guess-preview i {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: conic-gradient(
    from 20deg,
    #e53935,
    #fb8c00,
    #fdd835,
    #43a047,
    #1e88e5,
    #8e24aa,
    #e53935
  );
}

.mix-preview i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--ink);
}

.create-preview {
  gap: 0;
}

.create-preview i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  margin-left: -8px;
}

.create-preview i:first-child {
  margin-left: 0;
}

.create-preview-mix {
  width: 36px !important;
  height: 36px !important;
  margin-left: 8px !important;
  background: conic-gradient(
    from 20deg,
    #e53935,
    #fdd835,
    #1e88e5,
    #e53935
  );
}

.create-lede {
  text-align: center;
  margin: 0 0 8px;
}

.create-stage-anchor {
  height: 0;
}

#screen-create .create-stage-pin {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--card);
  margin: 0 -8px 16px;
  padding: 4px 8px 12px;
}

#screen-create .create-stage-pin .create-stage {
  height: 280px;
  margin: 0;
  overflow: hidden;
  transition: height 0.2s ease;
}

#screen-create .create-stage-pin.is-compact .create-stage {
  height: 168px;
}

#screen-create .create-stage-pin.is-compact .swirl {
  width: min(36vw, 132px);
  height: min(36vw, 132px);
  border-width: 3px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 6px 0 rgba(42, 18, 72, 0.12);
}

#screen-create .create-stage-pin.is-compact .swirl-glow {
  width: 120px;
  height: 120px;
  filter: blur(14px);
}

#screen-create .create-stage-pin.is-compact .swirl-orbit {
  width: min(42vw, 150px);
  height: min(42vw, 150px);
}

.create-live-hex {
  margin: 0 0 14px;
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  min-height: 1.2em;
}

.swirl.is-empty {
  background:
    repeating-conic-gradient(#efe7ff 0 25%, #fff 0 50%) 0 0 / 22px 22px;
}

.swirl.is-empty + .swirl-glow,
.create-stage:has(.swirl.is-empty) .swirl-glow {
  opacity: 0.18;
  background: #c084fc;
}

.create-piece {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  padding: 12px 14px;
}

.create-piece .mix-blob {
  width: 56px;
  height: 56px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 6px 0 rgba(42, 18, 72, 0.12);
}

.create-piece .name {
  font-weight: 800;
}

.create-piece .create-piece-color {
  margin: 2px 0 0;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
}

.create-piece small {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-weight: 700;
  line-height: 1.3;
}

.mix-name-block {
  background: #efe7ff;
  border: 2.5px solid var(--ink);
  border-radius: 22px;
  padding: 18px 16px;
  margin: 4px 0 16px;
  box-shadow: 4px 4px 0 var(--ink);
}

.mix-name-block.has-swatch {
  background: #fff;
}

.mix-color-name {
  margin: 0;
  text-align: center;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  word-break: break-word;
}

.mix-target-preview {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.mix-target-preview[hidden] {
  display: none !important;
}

.mix-blob-sm {
  width: min(28vw, 96px);
  height: min(28vw, 96px);
}

.mix-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 8px 0 16px;
}

.mix-swatch-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.mix-blob {
  width: min(38vw, 132px);
  height: min(38vw, 132px);
  border-radius: 50%;
  border: 4px solid var(--ink);
  background: var(--swirl, #e53935);
  display: grid;
  place-items: center;
  font-family: "Fredoka", sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink-soft);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 10px 0 rgba(42, 18, 72, 0.12);
}

.mix-blob.is-pale {
  box-shadow:
    inset 0 0 0 1px rgba(42, 18, 72, 0.28),
    0 10px 0 rgba(42, 18, 72, 0.12);
}

.mix-blob.is-empty {
  background:
    repeating-conic-gradient(#efe7ff 0 25%, #fff 0 50%) 0 0 / 18px 18px;
  color: var(--ink);
}

.mix-mini-name {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
}

.mix-mixer {
  display: grid;
  gap: 12px;
}

.mix-palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

#create-palette {
  grid-template-columns: none;
  grid-template-rows: repeat(3, 4.85rem);
  grid-auto-flow: column;
  grid-auto-columns: 4.7rem;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 8px;
}

#create-palette .mix-pot {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 8px 2px 6px;
  justify-content: center;
}

#create-palette .mix-pot i {
  width: 26px;
  height: 26px;
}

#create-palette .mix-pot span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 2.2em;
}

.mix-pot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  background: #fff;
  padding: 10px 4px 8px;
  cursor: pointer;
  color: inherit;
}

.mix-pot.is-on {
  background: #efe7ff;
  border-color: var(--violet);
}

.mix-pot:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.mix-compare-reveal {
  margin-bottom: 20px;
}

.mix-pot i {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--ink);
}

.mix-pot span {
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.mix-sliders {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.mix-fader-name {
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.1;
}

.mix-fader {
  display: grid;
  grid-template-columns: 28px minmax(5.4rem, auto) 1fr 48px auto;
  gap: 8px;
  align-items: center;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  padding: 10px 12px;
}

.mix-fader.is-sat {
  background: #fff8fc;
}

.mix-fader.is-sat i {
  background: conic-gradient(#ff4d8d, #fdd835, #3dceb0, #6cb6ff, #c084fc, #ff4d8d);
}

.mix-fader i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--ink);
}

.mix-fader input[type="range"] {
  width: 100%;
  accent-color: var(--pink);
  height: 8px;
}

.mix-fader em {
  font-style: normal;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.mix-fader-remove {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: #ffe3ea;
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.mix-fader-remove:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn {
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn.primary {
  background: var(--pink);
  color: #fff;
}

.btn.ghost {
  background: #fff;
  width: 100%;
}

.btn.xl {
  width: 100%;
  padding: 16px 18px;
  font-size: 1.15rem;
}

.create-submit-bar {
  position: sticky;
  bottom: calc(10px + var(--safe-bottom));
  z-index: 4;
  background: linear-gradient(to top, var(--card) 72%, transparent);
  padding-top: 12px;
}

.play-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.round-label {
  margin: 0;
  font-weight: 800;
  white-space: nowrap;
}

.ask {
  text-align: center;
  margin: 4px 0 8px;
}

.swirl-stage {
  position: relative;
  height: 280px;
  display: grid;
  place-items: center;
  margin: 4px 0 18px;
}

.swirl-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--swirl, #ff6b9a);
  filter: blur(28px);
  opacity: 0.4;
  pointer-events: none;
  transition: background 0.4s ease, opacity 0.4s ease;
}

.swirl-stage.is-mixing .swirl-glow {
  background: conic-gradient(
    from 0deg,
    #ff6b9a,
    #ffd166,
    #3dceb0,
    #6cb6ff,
    #c084fc,
    #ff6b9a
  );
  opacity: 0.55;
  animation: spin 1.1s linear infinite;
}

.swirl,
.mini-swirl {
  --swirl: #e53935;
  border-radius: 50%;
  border: 4px solid var(--ink);
  background: var(--swirl);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 12px 0 rgba(42, 18, 72, 0.12);
}

.swirl.is-pale,
.mini-swirl.is-pale {
  box-shadow:
    inset 0 0 0 1px rgba(42, 18, 72, 0.28),
    0 12px 0 rgba(42, 18, 72, 0.12);
}

.swirl {
  width: min(64vw, 230px);
  height: min(64vw, 230px);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.swirl::before {
  content: "";
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #e53935,
    #fb8c00,
    #fdd835,
    #43a047,
    #26c6da,
    #1e88e5,
    #8e24aa,
    #ec407a,
    #e53935
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.swirl.is-mixing::before {
  opacity: 1;
  animation: spin 0.55s linear infinite;
}

.swirl.is-ready {
  animation: settle 0.45s ease;
}

@keyframes settle {
  0% {
    transform: scale(0.92);
  }
  55% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: 4px 4px 0 var(--ink);
}

.swirl-orbit {
  position: absolute;
  width: min(78vw, 280px);
  height: min(78vw, 280px);
  pointer-events: none;
  animation: spin 18s linear infinite reverse;
}

.spark {
  position: absolute;
  font-size: 1.1rem;
  color: var(--ink);
}

.s1 { top: 8%; left: 46%; }
.s2 { top: 48%; right: 4%; color: var(--pink); }
.s3 { bottom: 10%; left: 40%; color: var(--mint); }
.s4 { top: 40%; left: 2%; color: var(--sky); }

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .swirl-stage.is-mixing .swirl-glow,
  .swirl.is-mixing::before,
  .swirl.is-ready,
  .swirl-orbit {
    animation: none;
  }

  .swirl.is-mixing::before {
    opacity: 0;
  }
}

.guess-form {
  display: grid;
  gap: 10px;
}

.pips {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 0 0 6px;
}

.pips i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(42, 18, 72, 0.18);
  border: 1.5px solid var(--ink);
}

.pips i.is-done {
  background: var(--mint);
}

.pips i.is-now {
  background: var(--pink);
  transform: scale(1.25);
}

.step-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 0 14px;
}

.step-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(42, 18, 72, 0.16);
  border: 1.5px solid var(--ink);
}

.step-dots i.is-done {
  background: var(--mint);
}

.step-dots i.is-now {
  background: var(--pink);
  transform: scale(1.2);
}

.reveal-card {
  text-align: center;
}

.reveal-badge {
  width: 72px;
  height: 72px;
  margin: 0 auto 10px;
  border-radius: 24px;
  border: 3px solid var(--ink);
  display: grid;
  place-items: center;
  font-size: 2rem;
}

.reveal-badge.is-yes {
  background: #b8f3d8;
}

.reveal-badge.is-no {
  background: #ffd0d8;
}

.reveal-title {
  font-size: 2rem !important;
}

.guess-echo {
  color: var(--ink-soft);
  margin: 0 0 18px;
}

.answer-block {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  background: #f4edff;
  border: 2.5px solid var(--ink);
  border-radius: 22px;
  padding: 14px;
  margin-bottom: 20px;
}

.mini-swirl {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.answer-name {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-family: "Fredoka", "Nunito", sans-serif;
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 500;
  line-height: 1.1;
  word-break: break-word;
}

.reveal-actions {
  display: grid;
  gap: 10px;
}

.rank {
  font-weight: 800;
  font-size: 1.35rem;
  width: 36px;
  text-align: center;
}

.results-card {
  text-align: center;
}

.trophy {
  font-size: 3rem;
  filter: drop-shadow(0 6px 0 rgba(42, 18, 72, 0.12));
}

.scoreboard {
  display: grid;
  gap: 10px;
  margin: 8px 0 22px;
}

.score-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  padding: 12px 14px;
}

.score-row.is-winner {
  background: #fff3c4;
}

.score-row .pts {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
}

.result-actions {
  display: grid;
  gap: 10px;
}

.reveal-card .result-actions {
  margin-top: 20px;
}

footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
  padding: 0 16px 12px;
}

footer .copyright {
  margin-top: 8px;
}

.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%,
  100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

@media (max-width: 640px) {
  .copyright-header {
    max-width: 11rem;
    font-size: 0.62rem;
  }

  .restart-btn {
    width: 36px;
    min-width: 36px;
    padding: 0;
  }

  .restart-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
  }

  .floater.f5,
  .floater.f6 {
    display: none;
  }

  .guess-form {
    position: sticky;
    bottom: calc(10px + var(--safe-bottom));
    z-index: 3;
    background: linear-gradient(to top, var(--card) 80%, transparent);
    padding-top: 10px;
  }

  #mix-submit {
    position: sticky;
    bottom: calc(10px + var(--safe-bottom));
    z-index: 3;
  }

  .levels,
  .modes {
    grid-template-columns: 1fr;
  }

  .level-card,
  .mode-card {
    min-height: 0;
  }

  .level-card {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .mode-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
    row-gap: 2px;
  }

  .mode-preview {
    grid-row: 1 / span 2;
    align-self: center;
    width: auto;
    height: auto;
    min-height: 48px;
    margin: 0;
    justify-content: flex-start;
  }

  .mix-palette {
    grid-template-columns: repeat(5, 1fr);
  }

  #create-palette {
    grid-template-columns: none;
    grid-template-rows: repeat(3, 4.85rem);
    grid-auto-flow: column;
    grid-auto-columns: 4.7rem;
  }

  .mix-fader {
    grid-template-columns: 28px 1fr 48px auto;
  }

  .mix-fader-name {
    display: none;
  }

  .mix-blob {
    width: min(34vw, 110px);
    height: min(34vw, 110px);
  }

  .level-swatches {
    margin: 0;
  }

  .card {
    padding: 20px 16px 22px;
    box-shadow: var(--shadow), 5px 5px 0 var(--ink);
  }

  .swirl-stage {
    height: 240px;
  }

  .answer-block {
    flex-direction: column;
    text-align: center;
  }
}

@media (min-width: 860px) {
  .floater {
    width: 52px;
    height: 52px;
  }
}

.sheet-link,
.brand-link {
  color: inherit;
  text-decoration: none;
}

.sheet-link {
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
}

.sheet-overlay[hidden] {
  display: none;
}

body.sheet-open {
  overflow: hidden;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 18, 72, 0.48);
}

.sheet-panel {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: none;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) 18px 8px;
  flex-shrink: 0;
}

.sheet-head h2 {
  margin: 0;
  font-size: 1.7rem;
}

.sheet-close {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 2px solid var(--ink);
  background: #ffe3ea;
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.sheet-overlay .sheet-jump {
  flex-shrink: 0;
  padding: 0 16px 10px;
  margin-bottom: 0;
}

.sheet-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 20px calc(24px + var(--safe-bottom));
  -webkit-overflow-scrolling: touch;
}

.sheet-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.jump-btn {
  width: auto !important;
  padding: 8px 14px;
  font-size: 0.9rem;
}

.sheet-card {
  margin-bottom: 18px;
}

.sheet-card h2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.sheet-card h2 small {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.sheet-table-wrap {
  overflow-x: auto;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.sheet-table th,
.sheet-table td {
  padding: 10px 8px;
  border-bottom: 1.5px solid var(--line);
  vertical-align: middle;
}

.sheet-table th {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.sheet-table td:nth-child(2) {
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
}

.sheet-table td:nth-child(3),
.sheet-table td:nth-child(4) {
  white-space: nowrap;
}

.sheet-table code {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.sheet-swatch {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
}

.sheet-swatch.is-pale {
  box-shadow: inset 0 0 0 1px rgba(42, 18, 72, 0.28);
}

