/* ==========================================================================
   Daily Games: soft clay / glass look
   ========================================================================== */

:root {
  color-scheme: light;

  --ink: #171a5c;
  --ink-2: #4c5088;
  --ink-3: #8a8cae;
  --line: rgba(23, 26, 92, 0.08);

  --glass: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.75);
  --shadow-soft: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 14px 34px -14px rgba(40, 34, 110, 0.22),
    0 2px 6px rgba(40, 34, 110, 0.05);

  --pink-1: #ff86bb;
  --pink-2: #e5458e;
  --gold-1: #f6cd7a;
  --gold-2: #d9993a;
  --gray-1: #a6a8c6;
  --gray-2: #7d7fa4;

  --font: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* Space between the top of the screen and the floating top bars. */
  --edge-gap: 10px;
  /* The page background's color at the very top. */
  --edge-color: #efedf5;
}

/* iOS 26 home-screen apps blur the top ~40pt of the page (the "scroll edge
   effect"). There's no setting to turn it off, but WebKit skips it when a
   full-width fixed box with a plain background color covers the top edge
   (gradients don't count). So the installed app gets a thin solid strip there,
   blended into the page so it doesn't read as a band:
   - the strip is the same color as the top of the page background,
   - the background's glow and light streaks fade in just below it, and
   - content scrolling up fades out under it instead of being cut off. */
.edge-cap,
.edge-fade {
  display: none;
}
@media (display-mode: standalone) {
  :root {
    --edge-gap: 14px;
    --edge-cap: calc(env(safe-area-inset-top) + 12px);
  }
  .edge-cap {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    height: var(--edge-cap);
    background: var(--edge-color);
    pointer-events: none;
  }
  .edge-fade {
    display: block;
    position: fixed;
    top: var(--edge-cap);
    left: 0;
    right: 0;
    z-index: 5; /* behind the top bars, so they stay crisp */
    height: 36px;
    background: linear-gradient(var(--edge-color), rgba(239, 237, 245, 0));
    pointer-events: none;
  }
  .topbar {
    position: relative;
    z-index: 10;
  }
  .backdrop::after {
    -webkit-mask-image: linear-gradient(transparent var(--edge-cap), #000 calc(var(--edge-cap) + 140px));
    mask-image: linear-gradient(transparent var(--edge-cap), #000 calc(var(--edge-cap) + 140px));
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* App-like feel: no double-tap zoom, and nothing can widen the page. */
  touch-action: manipulation;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: #ecebf3;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body[data-view='game'] {
  overflow: hidden;
  overscroll-behavior: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid rgba(229, 69, 142, 0.45);
  outline-offset: 2px;
}

/* Background: isometric floor grid + window light streaks ------------------ */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background: linear-gradient(165deg, #efedf5 0%, #e8e6f1 45%, #f3e8ea 100%);
  /* Its own layer, painted once, so scrolling never repaints it. */
  transform: translateZ(0);
}

.backdrop::before {
  content: '';
  position: absolute;
  inset: -20%;
  background-image: repeating-linear-gradient(30deg, rgba(255, 255, 255, 0.55) 0 1.5px, transparent 1.5px 72px),
    repeating-linear-gradient(150deg, rgba(255, 255, 255, 0.55) 0 1.5px, transparent 1.5px 72px);
  mask-image: radial-gradient(70% 60% at 60% 55%, #000 0%, transparent 85%);
  -webkit-mask-image: radial-gradient(70% 60% at 60% 55%, #000 0%, transparent 85%);
}

.backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(55% 45% at 88% 8%, rgba(255, 214, 196, 0.6), transparent 70%),
    radial-gradient(40% 40% at 5% 95%, rgba(214, 206, 255, 0.55), transparent 70%),
    linear-gradient(118deg, transparent 26%, rgba(255, 255, 255, 0.5) 36%, transparent 46%),
    linear-gradient(118deg, transparent 48%, rgba(255, 255, 255, 0.36) 56%, transparent 64%);
}

/* Shared bits -------------------------------------------------------------- */

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
}

/* Frosted blur is expensive, so only the bars that float over content get it. */
.navbar,
.topbar {
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
}

.icon3d {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  overflow: visible;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}
.pill-soft {
  background: rgba(23, 26, 92, 0.06);
}
.pill-muted {
  background: rgba(23, 26, 92, 0.05);
  color: var(--ink-3);
}
.pill-done {
  background: #ffe2ef;
  color: #c62f77;
}

.pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink-2);
}
.pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--pink-2);
  animation: ping 2s ease-out infinite;
}

.go {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(180deg, var(--pink-1), var(--pink-2));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -3px 0 rgba(140, 20, 80, 0.2),
    0 10px 18px -8px rgba(229, 69, 142, 0.8);
  transition: transform 0.2s ease;
}

.icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s;
}
.icon-btn:hover {
  background: rgba(23, 26, 92, 0.06);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  background: linear-gradient(180deg, var(--pink-1), var(--pink-2));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -3px 0 rgba(140, 20, 80, 0.22),
    0 12px 22px -10px rgba(229, 69, 142, 0.85);
  transition: transform 0.1s;
}
.btn-primary:active {
  transform: translateY(2px);
}

/* Home --------------------------------------------------------------------- */

.home {
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) 16px calc(env(safe-area-inset-bottom) + 28px);
}

.navbar {
  position: sticky;
  top: calc(env(safe-area-inset-top) + var(--edge-gap));
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 24px;
  border-radius: 999px;
}

.brand {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.brand .dot {
  color: var(--pink-2);
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-date {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-2);
}
.nav-meta .pill {
  font-variant-numeric: tabular-nums;
  padding: 10px 16px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 24px;
  padding: 40px 0 28px;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2.5rem, 6vw, 4.6rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.lede {
  margin: 0 0 28px;
  max-width: 32ch;
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink-2);
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 8px 8px 10px;
  border-radius: 999px;
  max-width: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cta:hover {
  transform: translateY(-2px);
}
.cta:hover .go {
  transform: translateX(3px);
}
.cta-icon {
  width: 62px;
  flex: none;
}
.cta-label {
  display: flex;
  flex-direction: column;
  padding-right: 10px;
  min-width: 0;
}
.cta-label strong {
  font-size: 1.05rem;
  font-weight: 800;
}
.cta-label small {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-3);
}

.hero-art-wrap {
  min-width: 0;
}
.hero-art {
  animation: drop-in 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}

.section-title {
  margin: 12px 4px 16px;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 18px;
}

.card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 30px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
a.card:hover {
  transform: translateY(-4px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 24px 40px -18px rgba(40, 34, 110, 0.32);
}
a.card:hover .card-art .icon3d {
  transform: translateY(-4px) scale(1.03);
}
a.card:hover .go {
  transform: translateX(3px);
}

.card-art {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  padding: 10% 12%;
  border-radius: 22px;
  background: radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.95), transparent 55%), var(--tint);
}
.card-art .icon3d {
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.tint-pink {
  --tint: linear-gradient(145deg, #fde6f1, #efe6fa);
}
.tint-lavender {
  --tint: linear-gradient(145deg, #ece8ff, #e3ecfb);
}
.tint-navy {
  --tint: linear-gradient(145deg, #e3e5f8, #f0e8f3);
}
.tint-gold {
  --tint: linear-gradient(145deg, #fdf0d9, #f6e6e8);
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px 8px 4px;
}
.card h3 {
  margin: 0 0 4px;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.card p {
  margin: 0 0 14px;
  font-size: 0.93rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink-2);
}
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.card.soon .card-art .icon3d {
  filter: saturate(0.7);
  opacity: 0.85;
}
.card.soon h3,
.card.soon p {
  opacity: 0.75;
}

.foot {
  margin-top: 36px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.version {
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 12px;
    gap: 0;
  }
  .hero-art-wrap {
    order: -1;
    margin: 0 -8px -8px;
  }
  .nav-date {
    display: none;
  }
}

@media (max-width: 560px) {
  .navbar {
    padding-left: 18px;
  }
  .brand {
    font-size: 1.25rem;
  }
  .nav-meta .pill {
    padding: 9px 12px;
  }
  .hero h1 {
    font-size: clamp(2.3rem, 11vw, 3rem);
  }
  .lede {
    font-size: 1rem;
  }
  .cta {
    width: 100%;
  }
  .cta-label {
    flex: 1;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .card {
    border-radius: 24px;
    padding: 10px;
  }
  .card-art {
    border-radius: 18px;
  }
  .card.soon p {
    display: none;
  }
  .card.soon h3 {
    font-size: 1.05rem;
  }
  .card.soon .card-body {
    padding: 10px 4px 2px;
  }
  .card.soon .pill {
    font-size: 0.72rem;
  }
  /* Playable games get the full width, side by side with their art. */
  a.card {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: stretch;
    gap: 6px;
  }
  a.card .card-art {
    width: 44%;
    flex: none;
    aspect-ratio: auto;
    padding: 8%;
  }
  a.card .card-body {
    padding: 6px 4px 2px 10px;
  }
}

/* Game shell --------------------------------------------------------------- */

.game {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100dvh;
  max-width: 540px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + var(--edge-gap)) 10px calc(env(safe-area-inset-bottom) + 10px);
}

.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
}
.topbar-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.topbar-icon {
  width: 48px;
  flex: none;
}
.topbar-title div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar-title strong {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.topbar-title small {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-actions {
  display: flex;
}

/* Hexle board -------------------------------------------------------------- */

.board-wrap {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  container-type: size;
}

.board {
  --size: min(calc(100cqw - 8px), calc(100cqh - 8px), 430px);
  --gap: calc(var(--size) * 0.018);
  width: var(--size);
  height: var(--size);
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: var(--gap);
}

.row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--gap);
}

.tile {
  perspective: 500px;
  font-size: calc(var(--size) / 6 * 0.46);
  font-weight: 800;
  text-transform: uppercase;
  user-select: none;
}

.tile-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.52s cubic-bezier(0.45, 0.05, 0.3, 1) var(--delay, 0ms);
}
.tile.flipped .tile-inner {
  transform: rotateX(180deg);
}
.tile.instant .tile-inner {
  transition: none;
}

.face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: calc(var(--size) * 0.03);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.front {
  background: rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 0 0 2px rgba(23, 26, 92, 0.07), inset 0 3px 8px rgba(40, 34, 110, 0.05);
  transition: box-shadow 0.15s, background 0.15s;
}
.tile[data-filled] .front {
  background: linear-gradient(180deg, #fff, #f5f4fb);
  box-shadow: inset 0 0 0 2px rgba(23, 26, 92, 0.24), inset 0 -3px 0 rgba(23, 26, 92, 0.06),
    0 8px 14px -10px rgba(40, 34, 110, 0.5);
}

.back {
  transform: rotateX(180deg);
  color: #fff;
  text-shadow: 0 1px 1px rgba(40, 20, 60, 0.25);
}

/* The colored, "pressed clay" result tiles. Shared with keys and help tiles. */
[data-state='correct'] > .tile-inner > .back,
.key[data-state='correct'],
.mini-tile[data-state='correct'] {
  background: linear-gradient(180deg, var(--pink-1), var(--pink-2));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), inset 0 -4px 0 rgba(150, 20, 80, 0.22),
    0 8px 16px -9px rgba(229, 69, 142, 0.8);
}
[data-state='present'] > .tile-inner > .back,
.key[data-state='present'],
.mini-tile[data-state='present'] {
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), inset 0 -4px 0 rgba(140, 90, 20, 0.22),
    0 8px 16px -9px rgba(217, 153, 58, 0.8);
}
[data-state='absent'] > .tile-inner > .back,
.key[data-state='absent'],
.mini-tile[data-state='absent'] {
  background: linear-gradient(180deg, var(--gray-1), var(--gray-2));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), inset 0 -4px 0 rgba(40, 40, 90, 0.18);
}

.tile.pop {
  animation: pop 0.12s ease-out;
}
.row.shake {
  animation: shake 0.5s;
}
.tile.win {
  animation: bounce 0.9s var(--delay, 0ms) ease;
}

/* Keyboard ----------------------------------------------------------------- */

.keyboard {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  user-select: none;
}
.krow {
  display: flex;
  gap: 6px;
}
.krow:nth-child(2) {
  padding: 0 4.5%;
}

.key {
  flex: 1;
  min-width: 0;
  height: clamp(44px, 7.4dvh, 58px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  background: linear-gradient(180deg, #fff, #f2f1f9);
  box-shadow: inset 0 -3px 0 rgba(23, 26, 92, 0.09), 0 4px 10px -6px rgba(40, 34, 110, 0.45);
  transition: transform 0.08s, background 0.3s, color 0.3s;
}
.key:active {
  transform: translateY(2px);
}
.key.wide {
  flex: 1.55;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: none;
}
.key[data-state] {
  color: #fff;
}

/* Toasts ------------------------------------------------------------------- */

.toasts {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 80px);
  left: 50%;
  z-index: 100;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  box-shadow: 0 14px 30px -12px rgba(23, 26, 92, 0.6);
  animation: toast-in 0.2s ease-out;
}
.toast.out {
  animation: toast-out 0.3s ease-in forwards;
}

/* Modals ------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(36, 30, 90, 0.22);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade-in 0.2s ease-out;
}
.modal {
  width: min(100%, 440px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 10px 22px 24px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 30px 60px -20px rgba(40, 34, 110, 0.45);
  animation: sheet-in 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
.modal-backdrop.closing {
  animation: fade-out 0.2s ease-in forwards;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-right: -10px;
  padding: 6px 0 8px;
}
.modal-head h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

@media (max-width: 560px) {
  .modal-backdrop {
    place-items: end stretch;
    padding: 0;
  }
  .modal {
    width: 100%;
    border-radius: 28px 28px 0 0;
    padding-bottom: calc(env(safe-area-inset-bottom) + 24px);
    animation-name: sheet-up;
  }
}

/* Stats */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}
.stat {
  padding: 12px 4px;
  border-radius: 18px;
  background: #f4f3fa;
}
.stat b {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.stat span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-3);
}
.stats h3 {
  margin: 22px 0 10px;
  font-size: 0.95rem;
  font-weight: 800;
}
.dist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dist-row {
  display: grid;
  grid-template-columns: max(14px, var(--label, 0px)) 1fr;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
}
.bar {
  width: var(--w);
  padding: 4px 9px;
  border-radius: 8px;
  text-align: right;
  background: #e5e4f0;
  color: var(--ink-2);
}
.bar.today {
  background: linear-gradient(90deg, var(--pink-1), var(--pink-2));
  color: #fff;
}
.reveal {
  margin: 20px 0 0;
  text-align: center;
  color: var(--ink-2);
  font-weight: 600;
}
.stats-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.next {
  flex: 1;
}
.next small {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-3);
}
.next b {
  font-size: 1.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* Help */
.help p {
  margin: 0 0 12px;
  line-height: 1.5;
  color: var(--ink-2);
}
.help strong {
  color: var(--ink);
}
.help .muted {
  margin-top: 18px;
  font-size: 0.88rem;
  color: var(--ink-3);
}
.mini-row {
  display: flex;
  gap: 5px;
  margin: 16px 0 8px;
}
.mini-tile {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  background: linear-gradient(180deg, #fff, #f5f4fb);
  box-shadow: inset 0 0 0 2px rgba(23, 26, 92, 0.18);
}
.mini-tile[data-state] {
  color: #fff;
}

/* Animations --------------------------------------------------------------- */

@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  80%,
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}
@keyframes drop-in {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.97);
  }
}
@keyframes pop {
  0% {
    transform: scale(0.88);
  }
  60% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes shake {
  10%,
  90% {
    transform: translateX(-2px);
  }
  20%,
  80% {
    transform: translateX(4px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-7px);
  }
  40%,
  60% {
    transform: translateX(7px);
  }
}
@keyframes bounce {
  0%,
  20% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-28%);
  }
  50% {
    transform: translateY(4%);
  }
  60% {
    transform: translateY(-14%);
  }
  80% {
    transform: translateY(2%);
  }
  100% {
    transform: translateY(0);
  }
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes fade-out {
  to {
    opacity: 0;
  }
}
@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
}
@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-art,
  .pulse::after {
    animation: none;
  }
  .tile.win,
  .row.shake,
  .tile.pop {
    animation-duration: 0.01ms;
  }
}

.modal:focus {
  outline: none;
}

/* Leaderboard & groups ----------------------------------------------------- */

[hidden] {
  display: none !important;
}

.btn-block {
  display: flex;
  width: 100%;
  justify-content: center;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 13px 20px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  color: var(--ink);
  background: linear-gradient(180deg, #fff, #f1f0f8);
  box-shadow: inset 0 0 0 1.5px rgba(23, 26, 92, 0.1), inset 0 -3px 0 rgba(23, 26, 92, 0.06);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #ff8a72, #e8553c);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 0 rgba(140, 40, 20, 0.2);
}

button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.link-btn {
  padding: 4px 2px;
  border: 0;
  background: none;
  font-weight: 700;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: rgba(23, 26, 92, 0.2);
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Home: friends card */
.friends-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 28px;
  padding: 10px 14px 10px 10px;
  border-radius: 30px;
  transition: transform 0.25s ease;
}
.friends-card:hover {
  transform: translateY(-2px);
}
.friends-card:hover .go {
  transform: translateX(3px);
}
.friends-art {
  flex: none;
  width: 120px;
  padding: 8px 6px;
  border-radius: 22px;
  background: radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.95), transparent 55%),
    linear-gradient(145deg, #fdf0d9, #ece8ff);
}
.friends-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.friends-text small {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.friends-text strong {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.friends-text span {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-2);
}

/* Page shell (scrolling screens like the leaderboard) */
.page {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + var(--edge-gap)) 12px calc(env(safe-area-inset-bottom) + 28px);
}
.page .topbar {
  position: sticky;
  top: calc(env(safe-area-inset-top) + var(--edge-gap));
  z-index: 10;
}
.page-body {
  padding-top: 16px;
}

/* Segmented control */
.seg {
  display: flex;
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(23, 26, 92, 0.06);
}
.seg button {
  flex: 1;
  padding: 10px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.seg button[aria-selected='true'] {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 4px 12px -6px rgba(40, 34, 110, 0.4);
}

/* Join / create */
.join {
  text-align: center;
}
.join-art {
  width: min(78%, 320px);
  margin: 4px auto 0;
}
.join h1 {
  margin: 8px 0;
  font-size: clamp(2rem, 9vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.join .lede {
  margin: 0 auto 22px;
}
.join-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 18px 6px 16px;
  border-radius: 999px;
}
.field:focus-within {
  box-shadow: var(--shadow-soft), 0 0 0 3px rgba(229, 69, 142, 0.3);
}
.field-icon {
  display: grid;
  color: var(--pink-2);
}
.field input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  outline: none;
  background: transparent;
  font: 600 1rem var(--font);
  color: var(--ink);
}
.field input::placeholder {
  color: var(--ink-3);
  font-weight: 500;
}
.field input[name='code'] {
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.field input[name='code']::placeholder {
  text-transform: none;
  letter-spacing: normal;
}
.form-error {
  min-height: 1.2em;
  margin: 0 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #d0335f;
}

/* Board */
.group-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px 16px 16px 22px;
  border-radius: 26px;
}
.group-name {
  min-width: 0;
}
.group-name small {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.group-name h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.code-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #c62f77;
  background: #ffe2ef;
  font-weight: 700;
  font-size: 0.8rem;
}
.code-chip b {
  font-size: 1rem;
  letter-spacing: 0.1em;
}

.lb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 10px 16px 10px 12px;
  border-radius: 22px;
}
.lb-row.me {
  box-shadow: var(--shadow-soft), inset 0 0 0 2px rgba(229, 69, 142, 0.35);
}
.lb-row.waiting {
  opacity: 0.6;
}
.rank {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-weight: 800;
  color: var(--ink-2);
  background: rgba(23, 26, 92, 0.06);
}
.rank-1,
.rank-2,
.rank-3 {
  color: #fff;
  text-shadow: 0 1px 1px rgba(40, 20, 60, 0.25);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}
.rank-1 {
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
}
.rank-2 {
  background: linear-gradient(180deg, #c9c0ff, #9183e0);
}
.rank-3 {
  background: linear-gradient(180deg, #ffb39f, #ee6448);
}
.who {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.who b {
  font-size: 1.02rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.who em {
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-style: normal;
  font-size: 0.7rem;
  vertical-align: 2px;
  color: #c62f77;
  background: #ffe2ef;
}
.who small {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-3);
}

.mini-grid {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mini-grid div {
  display: flex;
  gap: 2px;
}
.mini-grid i {
  width: 8px;
  height: 8px;
  border-radius: 2.5px;
}
.m-c {
  background: var(--pink-2);
}
.m-p {
  background: var(--gold-2);
}
.m-a {
  background: #cfd0e2;
}

.score,
.streak {
  flex: none;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.score.lost {
  color: var(--ink-3);
}
.streak {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: #e5458e;
}
.streak::before {
  content: '🔥';
  font-size: 1.1rem;
}
.streak.cold {
  color: var(--ink-3);
}
.streak.cold::before {
  filter: grayscale(1);
  opacity: 0.5;
}
.streak small {
  font-size: 0.75rem;
  font-weight: 700;
}

.lb-empty,
.lb-note {
  margin: 14px 8px;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-3);
}
.lb .btn-primary {
  margin-top: 16px;
}
.lb-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 16px;
  margin-top: 28px;
  font-size: 0.88rem;
  color: var(--ink-3);
}
.lb-foot b {
  color: var(--ink-2);
}

@media (max-width: 560px) {
  .friends-art {
    width: 96px;
  }
  .friends-text strong {
    font-size: 1.1rem;
  }
  .friends-text span {
    font-size: 0.85rem;
  }
}

/* Groups ------------------------------------------------------------------- */

.groups-wrap {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.groups-hint {
  margin: 0;
  text-align: center;
  font-weight: 600;
  color: var(--ink-2);
}
.groups-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.gtile {
  container-type: inline-size;
  height: clamp(60px, 10.5dvh, 84px);
  padding: 0 4px;
  border: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  background: linear-gradient(180deg, #fff, #f1f0f8);
  box-shadow: inset 0 -4px 0 rgba(23, 26, 92, 0.08), 0 6px 14px -8px rgba(40, 34, 110, 0.45);
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
/* Long words shrink to fit their tile. */
.gtile span {
  font-weight: 800;
  font-size: min(1.05rem, calc(100cqw * 1.3 / var(--len)));
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.gtile:active {
  transform: translateY(2px);
}
.gtile[aria-pressed='true'] {
  color: #fff;
  background: linear-gradient(180deg, #5458a8, #23276b);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), inset 0 -4px 0 rgba(0, 0, 0, 0.25),
    0 8px 16px -8px rgba(23, 26, 92, 0.7);
}
.gtile.jump {
  animation: gjump 0.42s var(--delay, 0ms) ease;
}
.gtile.shake {
  animation: shake 0.5s;
}
.gtile.shuffled {
  animation: gfade 0.3s ease;
}

.gbar {
  grid-column: 1 / -1;
  height: clamp(60px, 10.5dvh, 84px);
  padding: 0 12px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5), inset 0 -4px 0 rgba(0, 0, 0, 0.1),
    0 8px 16px -10px rgba(40, 34, 110, 0.5);
}
.gbar b {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.gbar span {
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0.85;
}
.gbar.pop {
  animation: bar-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
.lvl-0 {
  color: #5c3a0c;
  background: linear-gradient(180deg, #fbe1a2, #e9b864);
}
.lvl-1 {
  color: #0d4a3a;
  background: linear-gradient(180deg, #b2f3df, #5cd2ad);
}
.lvl-2 {
  color: #0f3c6b;
  background: linear-gradient(180deg, #bfe3ff, #73baf2);
}
.lvl-3 {
  color: #2b1f78;
  background: linear-gradient(180deg, #dcd5ff, #ab9df1);
}

.mistakes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-2);
}
.dots {
  display: flex;
  gap: 6px;
}
.dots i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(180deg, #5458a8, #23276b);
  transition: transform 0.3s, background 0.3s;
}
.dots i.used {
  background: rgba(23, 26, 92, 0.12);
  transform: scale(0.75);
}

.groups-actions {
  display: flex;
  gap: 8px;
}
.groups-actions button {
  flex: 1;
  margin-top: 0;
  padding: 13px 8px;
  font-size: 0.92rem;
}
.groups-actions button:disabled {
  opacity: 0.45;
  cursor: default;
}

.legend {
  display: grid;
  gap: 6px;
  margin: 14px 0;
}
.legend .gbar {
  height: 38px;
}

@keyframes gjump {
  40% {
    transform: translateY(-10px);
  }
}
@keyframes gfade {
  from {
    opacity: 0.3;
    transform: scale(0.94);
  }
}
@keyframes bar-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* Leaderboard: game switcher and Groups colors in the mini grids. */
/* One equal column per game, icon above the name, so four fit on a phone. */
.game-seg {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  border-radius: 22px;
}
.game-seg button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 18px;
  font-size: 0.82rem;
}
.seg-icon {
  width: 34px;
  flex: none;
}
.m-0 {
  background: var(--gold-2);
}
.m-1 {
  background: #36b38f;
}
.m-2 {
  background: #4f9fe0;
}
.m-3 {
  background: #8f80dc;
}

/* Mini --------------------------------------------------------------------- */

.mini-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.mini-play {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mini-status {
  display: flex;
  justify-content: center;
}
.mini-timer {
  padding: 8px 14px;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.mini .board-wrap {
  position: relative;
}

/* A navy clay slab with white squares, like the Mini icon. */
.mini-board {
  --size: min(calc(100cqw - 8px), calc(100cqh - 8px), 400px);
  width: var(--size);
  height: var(--size);
  display: grid;
  grid-template: repeat(5, 1fr) / repeat(5, 1fr);
  gap: 4px;
  padding: 6px;
  border-radius: 20px;
  background: linear-gradient(180deg, #2f3384, #1d2062);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), 0 18px 30px -16px rgba(23, 26, 92, 0.6);
  transition: filter 0.3s, opacity 0.3s;
}
.mini-board.shake {
  animation: shake 0.5s;
}
.mcell {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(180deg, #fff, #f1f0f8);
  box-shadow: inset 0 -3px 0 rgba(23, 26, 92, 0.1);
  transition: background 0.12s;
}
.mcell.black {
  background: transparent;
  box-shadow: none;
  cursor: default;
}
.mcell .num {
  position: absolute;
  top: 4%;
  left: 8%;
  font-size: calc(var(--size) / 5 * 0.2);
  font-weight: 700;
  color: var(--ink-2);
}
.mcell .letter {
  font-size: calc(var(--size) / 5 * 0.5);
  font-weight: 800;
  color: var(--ink);
}
.mcell.in-word {
  background: linear-gradient(180deg, #ebe6ff, #d9d1fb);
}
.mcell.active {
  background: linear-gradient(180deg, var(--gold-1), #eeb95f);
}
.mcell.pop {
  animation: pop 0.12s ease-out;
}
.mcell.wave {
  animation: bounce 0.9s var(--delay, 0ms) ease;
}
.game.solved .mcell:not(.black) {
  background: linear-gradient(180deg, #b2f3df, #5cd2ad);
}

/* "Ready?" cover: the puzzle stays blurred until the clock starts. */
.mini-ready {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 26px;
  border-radius: 26px;
  text-align: center;
  white-space: nowrap;
}
.mini-ready strong {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.mini-ready span {
  font-weight: 500;
  color: var(--ink-2);
}
.mini-ready .btn-primary {
  margin-top: 8px;
}
.game.mini:not(.veiled) .mini-ready {
  display: none;
}
.game.veiled .mini-board,
.game.veiled .clue-bar,
.game.veiled .mini-clues {
  filter: blur(6px);
  opacity: 0.7;
  pointer-events: none;
}
.game.veiled .keyboard,
.game.solved .keyboard {
  opacity: 0.5;
  pointer-events: none;
}

/* Current clue, above the keyboard. */
.clue-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 60px;
  padding: 6px;
  border-radius: 20px;
}
.clue-bar .icon-btn {
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1;
}
.clue-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border: 0;
  background: none;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  cursor: pointer;
}
.clue-main b {
  flex: none;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #2b1f78;
  background: #e6e1ff;
}

/* Full clue lists: desktop only. */
.mini-clues {
  display: none;
}
.mini-clues h3 {
  margin: 4px 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.mini-clues ol {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.mini-clues li {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-2);
  cursor: pointer;
}
.mini-clues li b {
  flex: none;
  width: 1.3em;
  color: var(--ink);
}
.mini-clues li.active {
  color: var(--ink);
  background: #e6e1ff;
}
.mini-clues li.cross {
  background: rgba(23, 26, 92, 0.05);
}
.mini-clues li.done span {
  opacity: 0.55;
}

@media (min-width: 900px) {
  .game.mini {
    max-width: 980px;
  }
  .mini-main {
    flex-direction: row;
    gap: 24px;
  }
  .mini-play {
    flex: 1.15;
  }
  .mini-clues {
    display: block;
    flex: 1;
    align-self: center;
    max-height: 100%;
    overflow: auto;
    padding: 18px 16px;
    border-radius: 26px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
  }
}
@media (min-width: 900px) and (pointer: fine) {
  .mini .keyboard {
    display: none; /* use the real keyboard */
  }
}

/* Hive --------------------------------------------------------------------- */

.hive-rank {
  flex: none;
  padding: 4px 6px 0;
}
.rank-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.rank-head b {
  font-size: 1.05rem;
  font-weight: 800;
}
.rank-head span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-3);
}
.rank-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 14px;
  margin: 0 4px;
}
.rank-track::before,
.rank-fill {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  height: 3px;
  border-radius: 2px;
  transform: translateY(-50%);
}
.rank-track::before {
  right: 0;
  background: rgba(23, 26, 92, 0.1);
}
.rank-fill {
  width: var(--p, 0%);
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2));
  transition: width 0.4s ease;
}
.rank-track i {
  position: relative;
  z-index: 1;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dcdbe8;
  transition: background 0.3s;
}
.rank-track i.on {
  background: var(--gold-2);
}

.found-wrap {
  position: relative;
  flex: none;
}
.found-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 16px;
  font-weight: 600;
  text-align: left;
  color: var(--ink-2);
  cursor: pointer;
}
.found-bar span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.found-bar[aria-expanded='true'] .chev {
  transform: rotate(180deg);
}
.found-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 50dvh;
  overflow: auto;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
}
.found-panel p {
  margin: 0 0 8px;
  font-weight: 700;
}
.found-panel ul,
.answers {
  columns: 2;
  column-gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.found-panel li,
.answers li {
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  text-transform: capitalize;
  break-inside: avoid;
}
.found-panel li.pangram,
.answers li.pangram {
  font-weight: 800;
  color: var(--gold-2);
}
.answers li {
  color: var(--ink-3);
}
.answers li.got {
  color: var(--ink);
}
.answers li.got::after {
  content: ' ✓';
  color: #36b38f;
}

.hive-play {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.hive-input {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.hive-input .is-center {
  color: var(--gold-2);
}
.hive-input .is-bad {
  color: #c8c8da;
}
.hive-input.shake {
  animation: shake 0.5s;
}
.caret {
  width: 2px;
  height: 1.7rem;
  margin-left: 3px;
  background: var(--gold-2);
  animation: blink 1s steps(1) infinite;
}

/* Flat-topped clay hexagons: the center plus six around it. */
.honeycomb {
  --hex: min(27vw, 108px, 12.5dvh);
  position: relative;
  width: calc(var(--hex) * 2.62);
  height: calc(var(--hex) * 0.866 * 3.1);
}
.hex-cell {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--hex);
  height: calc(var(--hex) * 0.866);
  margin: calc(var(--hex) * -0.433) 0 0 calc(var(--hex) * -0.5);
  translate: var(--x, 0) var(--y, 0);
  filter: drop-shadow(0 6px 8px rgba(40, 34, 110, 0.18));
}
.hex-cell[data-pos='1'] {
  --y: calc(var(--hex) * -0.9);
}
.hex-cell[data-pos='2'] {
  --x: calc(var(--hex) * 0.78);
  --y: calc(var(--hex) * -0.45);
}
.hex-cell[data-pos='3'] {
  --x: calc(var(--hex) * 0.78);
  --y: calc(var(--hex) * 0.45);
}
.hex-cell[data-pos='4'] {
  --y: calc(var(--hex) * 0.9);
}
.hex-cell[data-pos='5'] {
  --x: calc(var(--hex) * -0.78);
  --y: calc(var(--hex) * 0.45);
}
.hex-cell[data-pos='6'] {
  --x: calc(var(--hex) * -0.78);
  --y: calc(var(--hex) * -0.45);
}
.hex-cell.wave {
  animation: bounce 0.9s var(--delay, 0ms) ease;
}
.hex {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  font: 800 calc(var(--hex) * 0.3) var(--font);
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  background: linear-gradient(180deg, #ffffff, #e9e7f4);
  box-shadow: inset 0 -6px 0 rgba(23, 26, 92, 0.08), inset 0 3px 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.1s;
}
.hex:active {
  transform: scale(0.92);
}
.hex.center {
  color: #5c3a0c;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  box-shadow: inset 0 -6px 0 rgba(120, 70, 0, 0.18), inset 0 3px 0 rgba(255, 255, 255, 0.5);
}
.hex.spin {
  animation: hex-spin 0.3s ease;
}

.hive-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hive-actions .btn-secondary {
  min-width: 100px;
  margin-top: 0;
}
.hive-actions .shuffle {
  width: 52px;
  height: 52px;
  background: linear-gradient(180deg, #fff, #f1f0f8);
  box-shadow: inset 0 -3px 0 rgba(23, 26, 92, 0.08), 0 4px 10px -6px rgba(40, 34, 110, 0.45);
}
.yesterday {
  font-size: 0.85rem;
  color: var(--ink-3);
}

.rank-list {
  margin: 4px 0 14px;
  padding: 0;
  list-style: none;
}
.rank-list li {
  display: flex;
  justify-content: space-between;
  padding: 5px 2px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  color: var(--ink-2);
}
.rank-list b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

@keyframes hex-spin {
  50% {
    opacity: 0.3;
    transform: scale(0.6);
  }
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
