:root {
  --bg: #1a1021;
  --bg-2: #2f1236;
  --panel: rgba(72, 18, 50, 0.72);
  --panel-2: rgba(98, 25, 68, 0.85);
  --text: #fff7fb;
  --muted: #f3c5d8;
  --accent: #d81b60;
  --accent-strong: #b70036;
  --accent-2: #22d3ee;
  --accent-3: #fde68a;
  --warn: #f59e0b;
  --hole: #140814;
  --cell: #fff8f5;
  --grid: #5a214b;
  --outline: rgba(255,255,255,0.16);
  --shadow: 0 18px 40px rgba(0,0,0,0.28);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.16), transparent 28%),
    radial-gradient(circle at top left, rgba(216, 27, 96, 0.18), transparent 32%),
    linear-gradient(180deg, #180c18 0%, #2a0f2e 42%, #120814 100%);
  color: var(--text);
  overflow-x: hidden;
}

.wrap {
  width: min(1040px, calc(100vw - 14px));
  margin: 0 auto;
  padding: clamp(8px, 1.5vw, 14px);
}

h1 {
  font-size: clamp(1.2rem, 2vw, 1.95rem);
  margin: 0 0 8px;
  line-height: 1.1;
}

.sub {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: clamp(10px, 1.6vw, 14px);
  max-width: 760px;
  font-size: clamp(0.82rem, 1.15vw, 0.92rem);
}

.layout {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  gap: clamp(10px, 1.5vw, 14px);
  align-items: start;
}

.panel {
  background: linear-gradient(180deg, rgba(99, 28, 72, 0.72), rgba(53, 17, 46, 0.88));
  border: 1px solid var(--outline);
  border-radius: 14px;
  padding: clamp(10px, 1.3vw, 12px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.controls {
  display: grid;
  gap: 8px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text);
}

select,
input[type="date"],
button {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: var(--panel-2);
  color: var(--text);
  padding: 8px 10px;
  font-size: clamp(0.84rem, 1.05vw, 0.93rem);
}

button {
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border: none;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: white;
  box-shadow: 0 10px 22px rgba(183, 0, 54, 0.28);
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(183, 0, 54, 0.34);
}

button.secondary {
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  box-shadow: 0 10px 22px rgba(8, 145, 178, 0.28);
}

button.ghost {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: none;
}

.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

.inline-check input {
  transform: scale(1.1);
}

.note,
.status {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
  background: rgba(255,255,255,0.05);
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
}

.status strong {
  color: white;
}

.board-wrap {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(2px, 0.45vw, 4px);
  width: min(100%, 470px);
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  padding: clamp(6px, 1vw, 10px);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

.cell {
  aspect-ratio: 1 / 1;
  min-width: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.5rem, 1vw, 0.76rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  user-select: none;
  text-align: center;
  padding: 2px;
  line-height: 1.1;
  overflow: hidden;
}

.off { visibility: hidden; }

.open-date {
  background: linear-gradient(135deg, #fde68a, #fb7185);
  color: #3b1027;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.34);
}

.covered {
  color: white;
  border: 1px solid rgba(255,255,255,0.15);
}

.empty {
  background: var(--cell);
  color: #3f1635;
  border: 1px solid rgba(63,22,53,0.08);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted);
  font-size: 0.8rem;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.25);
}

.pieces {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 8px;
}

.piece-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 10px;
  min-width: 0;
}

.piece-card.hinted-piece {
  cursor: pointer;
  border-color: rgba(253, 230, 138, 0.45);
  box-shadow: 0 0 0 1px rgba(253, 230, 138, 0.14) inset;
}

.piece-card.hinted-piece:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.08);
}

.piece-card.hinted-piece.preview-active {
  border-color: rgba(34, 211, 238, 0.7);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.22), 0 10px 20px rgba(0,0,0,0.2);
}

.piece-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.piece-title .hint-mark {
  color: #fde68a;
  font-weight: 900;
  font-size: 1.1rem;
  line-height: 1;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(5, 12px);
  gap: 2px;
  width: max-content;
  max-width: 100%;
}

.mini-cell {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: rgba(255,255,255,0.07);
}

.mini-cell.on {
  border: 1px solid rgba(255,255,255,0.2);
}

code {
  color: #93c5fd;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--accent-3);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.logo-wrap a {
  display: inline-block;
  border: none;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.logo-wrap a:hover .solver-logo {
  filter: drop-shadow(0 0 18px rgba(255,255,255,0.55));
  transform: translateY(-2px);
}

.solver-logo {
  display: block;
  width: 320px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  transition: filter 0.3s ease, transform 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

.site-logo {
  width: min(100%, 250px);
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.22));
}
.hint-header {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.today-solution-count {
  justify-self: center;
  width: 100%;
  max-width: 420px;
  text-align: center;
  color: var(--accent-3);
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.2;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.14);
}

#hintBtn {
  justify-self: end;
}

@media (max-width: 760px) {
  .hint-header {
    grid-template-columns: 1fr;
  }

  .today-solution-count {
    max-width: 100%;
  }

  #hintBtn {
    justify-self: start;
  }
}
.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 clamp(12px, 2vw, 20px);
}

.hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 22px rgba(183, 0, 54, 0.28);
}

.hero-link.alt {
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  box-shadow: 0 10px 22px rgba(8, 145, 178, 0.28);
}

.sub strong { color: #fff; }

.panel-title {
  margin: 0 0 12px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

/* idle look for the confused bar */
#confusedBtn.panel-kicker {
  width: auto;
  max-width: min(100%, 420px);
  min-height: 48px;
  padding: 9px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.04);
  color: var(--accent-3);
  font-size: clamp(0.92rem, 1.2vw, 1.02rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  box-shadow: none;
  transform: none;
  transform-origin: center;
  flex-basis: 100%;
  margin: 6px auto 4px;
}

#confusedBtn.confused-link {
  cursor: pointer;
  position: relative;
  overflow: visible;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    filter 0.18s ease,
    background 0.18s ease;
}

/* remove bubble dots while idle */
#confusedBtn.confused-link::before,
#confusedBtn.confused-link::after {
  display: none;
}

/* simple idle hover */
#confusedBtn.confused-link:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: none;
}

#confusedBtn.confused-link:active {
  transform: scale(0.98);
}

#solveBtn.hold-active {
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  box-shadow: 0 10px 24px rgba(8, 145, 178, 0.34);
  transform: scale(0.98);
}

.hint-pulse {
  animation: hintBounce 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#confusedBtn.hint-pulse {
  border: 2px solid rgba(255,255,255,0.78);
  background:
    radial-gradient(circle at 25% 25%, rgba(255,255,255,0.30), transparent 26%),
    radial-gradient(circle at 78% 30%, rgba(255,255,255,0.20), transparent 22%),
    linear-gradient(135deg, #ff5fa2 0%, #d81b60 45%, #b70036 100%);
  color: #fffdf8;
  box-shadow:
    0 10px 22px rgba(183, 0, 54, 0.34),
    inset 0 2px 0 rgba(255,255,255,0.35),
    inset 0 -3px 0 rgba(0,0,0,0.14);
  transform: rotate(-3deg);
  animation: confusedBubblePop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#confusedBtn.hint-pulse::before,
#confusedBtn.hint-pulse::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  pointer-events: none;
  display: block;
}

#confusedBtn.hint-pulse::before {
  width: 16px;
  height: 16px;
  top: 8px;
  left: 20px;
}

#confusedBtn.hint-pulse::after {
  width: 10px;
  height: 10px;
  top: 18px;
  right: 26px;
}

#confusedBtn.hint-pulse:hover {
  transform: rotate(-4deg) translateY(-2px) scale(1.03);
  filter: brightness(1.06);
  box-shadow:
    0 14px 28px rgba(183, 0, 54, 0.42),
    inset 0 2px 0 rgba(255,255,255,0.4),
    inset 0 -3px 0 rgba(0,0,0,0.14);
}

@keyframes confusedBubblePop {
  0% {
    transform: rotate(0deg) scale(1);
  }
  30% {
    transform: rotate(-5deg) scale(1.1) translateY(-3px);
  }
  55% {
    transform: rotate(-2deg) scale(0.97) translateY(1px);
  }
  80% {
    transform: rotate(-4deg) scale(1.03) translateY(-1px);
  }
  100% {
    transform: rotate(-3deg) scale(1);
  }
}

@keyframes hintBounce {
  0% {
    transform: rotate(-3deg) scale(1);
  }
  25% {
    transform: rotate(-5deg) scale(1.12) translateY(-3px);
  }
  45% {
    transform: rotate(-2deg) scale(0.96) translateY(1px);
  }
  65% {
    transform: rotate(-4deg) scale(1.06) translateY(-2px);
  }
  100% {
    transform: rotate(-3deg) scale(1);
  }
}

.splash-hint {
  color: var(--accent-3);
}

.footer-note {
  margin-top: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .controls { order: 1; }
  .board-wrap { order: 2; }
}

@media (max-width: 760px) {
  .wrap {
    width: min(100vw - 10px, 100%);
    padding: 6px;
  }

  .row {
    grid-template-columns: 1fr;
  }

  .board {
    width: 100%;
  }

  .pieces {
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  }

  .piece-header {
    flex-direction: column;
    align-items: flex-start !important;
  }

  #confusedBtn.panel-kicker {
    font-size: 0.92rem;
    padding: 9px 14px;
    min-height: 48px;
    max-width: 100%;
    transform: none;
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.floaty {
  animation: float 4s ease-in-out infinite;
}

#floatingPiece {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  display: none;
}
