@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,650;750&family=Nunito:wght@500;650;800&display=swap");

:root {
  --bg: #e7eef5;
  --bg-2: #d5e2ee;
  --ink: #0c1b2a;
  --muted: #4a6275;
  --brand: #0e7490;
  --brand-deep: #155e75;
  --accent: #e85d4c;
  --accent-2: #0ea5e9;
  --card: #ffffff;
  --line: rgba(12, 27, 42, 0.1);
  --shadow: 0 14px 42px rgba(12, 27, 42, 0.1);
  --radius: 18px;
  --font-display: "Fraunces", "Segoe UI", Georgia, serif;
  --font-body: "Nunito", "Segoe UI", sans-serif;
  --max: 1120px;
  --max-play: 1680px;
  --board-ink: #0b1220;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1000px 520px at 8% -8%, #fff1eb 0%, transparent 55%),
    radial-gradient(900px 480px at 100% 0%, #cfeef8 0%, transparent 52%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  min-height: 100vh;
  line-height: 1.55;
}

a {
  color: var(--brand-deep);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.wrap {
  width: min(100% - 1.25rem, var(--max));
  margin-inline: auto;
}

/* Play pages: use side margins — board needs width more than prose does */
.wrap:has(#play-workspace) {
  width: min(100% - 1rem, var(--max-play));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(231, 238, 245, 0.9);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 2.8vw, 2.25rem);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.04em;
  line-height: 1;
}

.logo span {
  color: var(--brand);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: center;
  justify-content: flex-end;
}

.nav-lang {
  position: relative;
}

.nav-lang > summary {
  list-style: none;
  cursor: pointer;
  font-weight: 750;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  min-width: 2.4rem;
  text-align: center;
  user-select: none;
}

.nav-lang > summary::-webkit-details-marker {
  display: none;
}

.nav-lang > summary:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.nav-lang__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 30;
  min-width: 11.5rem;
  max-height: min(70vh, 28rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  display: grid;
  gap: 0.1rem;
}

.nav-lang__panel button {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  font-weight: 650;
  font-size: 0.9rem;
  color: var(--ink);
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
}

.nav-lang__panel button:hover,
.nav-lang__panel button.is-active {
  background: #ecfeff;
  color: var(--brand-deep);
}

.nav a {
  font-weight: 650;
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--brand-deep);
}

.nav-btn {
  font: inherit;
  font-weight: 650;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.nav-btn:hover {
  color: var(--brand-deep);
}

.nav-btn--how {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--brand-deep);
  font-weight: 800;
}

.nav-btn--how:hover {
  border-color: var(--brand);
  background: #ecfeff;
}

.nav-more {
  position: relative;
}

.nav-more > summary {
  list-style: none;
  cursor: pointer;
  font-weight: 650;
  color: var(--muted);
}

.nav-more > summary::-webkit-details-marker {
  display: none;
}

.nav-more > summary:hover {
  color: var(--brand-deep);
}

.nav-more__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  min-width: 10.5rem;
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 30;
}

.nav-more__panel a {
  display: block;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
}

.nav-more__panel a:hover {
  background: #ecfeff;
  color: var(--brand-deep);
}

.path-strip {
  margin: 0.25rem 0 0.75rem;
  display: grid;
  gap: 0.75rem;
}

.path-strip__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 750;
  font-size: clamp(1.55rem, 3.8vw, 2.15rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--ink);
}

.path-strip__lead {
  margin: 0.4rem 0 0;
  color: var(--muted);
  max-width: 36rem;
  font-size: 0.98rem;
  line-height: 1.45;
}

.path-strip__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.path-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: left;
  text-decoration: none;
  color: inherit;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  font: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.path-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.path-card__kicker {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.path-card__label {
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--ink);
}

.path-card--primary {
  border-color: var(--brand);
  background: linear-gradient(160deg, #ecfeff 0%, #fff 70%);
}

.path-card--primary .path-card__label {
  color: var(--brand-deep);
}

.path-card--daily {
  border-color: #fb923c;
  background: linear-gradient(160deg, #fff7ed 0%, #fff 70%);
}

.path-card--daily .path-card__kicker {
  color: #c2410c;
}

.path-card--daily .path-card__label {
  color: #9a3412;
}

.path-card--how {
  border-style: dashed;
}

.mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
  justify-content: center;
}

.mode-badge {
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: #cffafe;
  color: var(--brand-deep);
}

.btn-daily {
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  border: 1.5px solid #ea580c;
  background: linear-gradient(180deg, #fff7ed, #ffedd5);
  color: #9a3412;
  box-shadow: 0 1px 0 rgba(234, 88, 12, 0.25);
}

.btn-daily:hover,
.btn-daily.is-active {
  background: #ea580c;
  border-color: #c2410c;
  color: #fff;
}

.chip--daily {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}

.chip--daily.is-active,
.chip--daily:hover {
  background: #ea580c;
  border-color: #ea580c;
  color: #fff;
}

.hub-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 0.5rem;
}

.hub-cta-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.btn-lg {
  padding: 0.7rem 1.15rem;
  font-size: 1.02rem;
}

.btn-daily-link {
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  text-decoration: none;
  border-radius: 12px;
  padding: 0.7rem 1.15rem;
  border: 1.5px solid #ea580c;
  background: #fff7ed;
  color: #9a3412;
}

.btn-daily-link:hover {
  background: #ea580c;
  color: #fff;
}

.chip-rail--diff {
  justify-content: center;
  padding-bottom: 0.35rem;
}

.size-advanced {
  margin: 0 auto 0.65rem;
  max-width: 520px;
  font-size: 0.88rem;
  color: var(--muted);
}

.size-advanced > summary {
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  list-style: none;
  user-select: none;
}

.size-advanced > summary::-webkit-details-marker {
  display: none;
}

.size-advanced > summary::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 0.45em;
  vertical-align: 0.15em;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform 0.15s ease;
}

.size-advanced[open] > summary::after {
  transform: rotate(180deg);
  vertical-align: 0.05em;
}

.tutorial[hidden] {
  display: none !important;
}

.tutorial {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.tutorial__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 27, 42, 0.55);
}

.tutorial__panel {
  position: relative;
  width: min(100%, 420px);
  background: #fff;
  border-radius: 20px;
  padding: 1.4rem 1.45rem 1.25rem;
  box-shadow: var(--shadow);
  z-index: 1;
}

.tutorial__panel h2 {
  font-family: var(--font-display);
  margin: 0 0 0.55rem;
  letter-spacing: -0.02em;
}

.tutorial__panel p {
  color: var(--muted);
  margin: 0 0 1rem;
}

.tutorial__x {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}


.hero {
  padding: 2rem 0 0.5rem;
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 880px) {
  .hero {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: end;
    padding-top: 2.5rem;
  }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin: 0 0 0.75rem;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 38ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.hero-visual {
  aspect-ratio: 5 / 4;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(14, 116, 144, 0.18), transparent 50%),
    repeating-linear-gradient(
      0deg,
      transparent 0 22px,
      rgba(12, 27, 42, 0.06) 22px 23px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 22px,
      rgba(12, 27, 42, 0.06) 22px 23px
    ),
    linear-gradient(160deg, #0b1220, #155e75 70%, #e85d4c);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  min-height: 220px;
}

.hero-visual::after {
  content: "5×5 → 30×30";
  position: absolute;
  left: 1.1rem;
  bottom: 1.1rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 2rem 0 0.9rem;
  letter-spacing: -0.02em;
}

.size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.size-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.size-card:hover {
  transform: translateY(-4px);
  border-color: rgba(14, 116, 144, 0.35);
}

.size-card__thumb {
  aspect-ratio: 1.15;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #0e7490, #155e75 50%, #e85d4c 130%);
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  position: relative;
}

.size-card__thumb small {
  position: absolute;
  bottom: 0.55rem;
  right: 0.55rem;
  font-size: 0.7rem;
  font-family: var(--font-body);
  background: rgba(0, 0, 0, 0.28);
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}

.size-card__meta {
  padding: 0.8rem 0.9rem 1rem;
}

.size-card__meta strong {
  display: block;
  margin-bottom: 0.15rem;
}

.size-card__meta span {
  color: var(--muted);
  font-size: 0.85rem;
}

.size-card[data-tone="easy"] .size-card__thumb {
  background: linear-gradient(145deg, #0ea5e9, #22d3ee 55%, #0e7490);
}
.size-card[data-tone="mid"] .size-card__thumb {
  background: linear-gradient(145deg, #0e7490, #14b8a6 55%, #e85d4c);
}
.size-card[data-tone="hard"] .size-card__thumb {
  background: linear-gradient(145deg, #0c1b2a, #155e75 55%, #e85d4c);
}

.chip-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  overflow: visible;
  padding: 0.25rem 0 0.75rem;
}

.chip-rail--sizes {
  justify-content: center;
  overflow: visible;
  flex-wrap: wrap;
}

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.chip.is-active,
.chip:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.seo-block {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(1.25rem, 3vw, 2rem);
  margin: 1rem 0 2.5rem;
  box-shadow: var(--shadow);
}

.seo-block h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 0.65rem;
  letter-spacing: -0.02em;
}

.seo-block h3 {
  font-size: 1.05rem;
  margin: 1.2rem 0 0.4rem;
  color: var(--brand-deep);
}

.seo-block p,
.seo-block li {
  color: var(--muted);
}

.faq details {
  border-top: 1px solid var(--line);
  padding: 0.85rem 0;
}

.faq details:first-of-type {
  border-top: 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 750;
  color: var(--ink);
}

.faq p {
  margin: 0.55rem 0 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem;
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.35);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  justify-content: space-between;
  color: var(--muted);
  font-weight: 650;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--brand-deep);
}

.crumb {
  padding: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.crumb a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
}

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

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-tool {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.9rem;
  font-weight: 700;
}

.btn-tool.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* Play layout — board-first, options optional */
.play-shell {
  display: grid;
  gap: 0.85rem;
  margin: 0.65rem 0 1.5rem;
}

.play-shell--instant {
  grid-template-columns: 1fr;
}

.options-panel {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.35rem 0.85rem 0.75rem;
}

.options-panel > summary {
  cursor: pointer;
  font-weight: 750;
  list-style: none;
  padding: 0.45rem 0;
  color: var(--muted);
}

.options-panel > summary::-webkit-details-marker {
  display: none;
}

.options-panel > summary::after {
  content: " ▾";
  font-size: 0.85em;
}

.options-panel[open] > summary {
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.options-panel .chip-rail {
  padding-bottom: 0.35rem;
}

.options-panel .lb-block {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.options-panel .lb-block h2 {
  font-size: 0.95rem;
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
}

.site-header--slim .site-header__inner {
  padding: 0.55rem 0;
}

.page-h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  letter-spacing: -0.03em;
  margin: 0.5rem 0 1rem;
}

.stats-line {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.25rem 0 0;
}

.related-list {
  padding-left: 1.15rem;
}

.related-list a {
  font-weight: 650;
}

.solver-log {
  margin: 0.75rem 0 1.25rem;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.solver-log li {
  margin: 0.25rem 0;
}

/* AdSense shell: invisible until you paste a live unit and add .ad-slot--live */
.ad-slot {
  display: none;
  margin: 1.25rem auto;
  max-width: 728px;
  text-align: center;
  min-height: 0;
}
.ad-slot.ad-slot--live {
  display: block;
  min-height: 90px;
}
.ad-slot--in-article.ad-slot--live {
  min-height: 250px;
  margin: 1.5rem auto;
}

.faq-item {
  border-top: 1px solid var(--line);
  padding: 0.75rem 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 750;
}

.nav a.is-current {
  color: var(--brand-deep);
}

.tool-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: 1rem 0;
}

.tool-grid textarea,
.tool-grid select,
select#diff {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  font: inherit;
  padding: 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.tool-out {
  background: #0b1220;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 12px;
  overflow: auto;
  font-size: 0.85rem;
  line-height: 1.45;
}

.play-main {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 0.75rem;
  box-shadow: var(--shadow);
}

.play-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin: 0.55rem 0 0;
}

.play-toolbar--beside {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

.timer-pill {
  margin-left: auto;
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 1.05rem;
  background: var(--board-ink);
  color: #f8fafc;
  padding: 0.45rem 0.85rem;
  border-radius: 12px;
  letter-spacing: -0.02em;
}

.chip-rail--sizes {
  justify-content: center;
  padding: 0.35rem 0 0.65rem;
  overflow: visible;
  flex-wrap: wrap;
  max-width: 100%;
}

.size-advanced .chip-rail--sizes,
.sheet__more .chip-rail--sizes {
  overflow: visible;
  flex-wrap: wrap;
}

.lb-block--below {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  max-width: 420px;
  margin-inline: auto;
  width: 100%;
}

.lb-block--below h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.45rem;
}

.lb-more {
  margin: 0.65rem 0 0;
  font-size: 0.85rem;
}

.play-status {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.zoom-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0 auto 0.65rem;
}

.zoom-bar__btn {
  font: inherit;
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.zoom-bar__btn:hover {
  border-color: var(--brand);
  background: #ecfeff;
  color: var(--brand-deep);
}

.zoom-bar__icon {
  display: inline-flex;
  color: var(--brand-deep);
  opacity: 0.9;
}

.zoom-bar__label {
  min-width: 3.2rem;
  text-align: center;
  font-weight: 750;
  font-size: 0.85rem;
  color: var(--muted);
}

#board-wrap {
  display: block;
  width: fit-content;
  max-width: 100%;
  max-height: none;
  margin-inline: auto;
  background: transparent;
  border-radius: 12px;
  overflow: visible;
  line-height: 0;
  scroll-margin-block: 12vh;
}

#play-workspace {
  scroll-margin-block: 12vh;
}

#board {
  display: block;
  touch-action: none;
  cursor: crosshair;
  /* Never let CSS max-width shrink only one axis — that turns squares into rectangles. */
  max-width: none;
  width: auto;
  height: auto;
  flex-shrink: 0;
}

.play-aside {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}

.play-aside h1 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}

.play-aside h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 1.2rem 0 0.55rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.65rem 0 1rem;
}

.badge {
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: #cffafe;
  color: var(--brand-deep);
}

select.size-select {
  font: inherit;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.5rem 0.7rem;
  background: #fff;
}

.lb-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lb-list li {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.lb-rank {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--brand);
}

.lb-name {
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-time {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 700;
}

.lb-empty {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.lb-boards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin: 1rem 0 2rem;
}

.lb-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.lb-card h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.65rem;
}

/* Modal */
.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(12, 27, 42, 0.55);
}

.modal__panel {
  width: min(100%, 400px);
  background: #fff;
  border-radius: 20px;
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow);
}

.modal__panel h2 {
  font-family: var(--font-display);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.modal__panel p {
  color: var(--muted);
  margin: 0.35rem 0;
}

.modal__time {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--brand-deep);
  margin: 0.5rem 0 0.85rem !important;
}

.modal__panel label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}

.modal__panel input {
  width: 100%;
  font: inherit;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-bottom: 1rem;
}

.modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.play-topbar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
}

.btn-new-game {
  font: inherit;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 0.55rem 0.95rem;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(14, 116, 144, 0.25);
}

.btn-new-game:active {
  transform: translateY(1px);
}

.timer-cluster {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-pause {
  font: inherit;
  font-size: 0.75rem;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  line-height: 1;
}

.btn-pause.is-paused {
  background: var(--brand-deep);
  color: #fff;
  border-color: var(--brand-deep);
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet[hidden] {
  display: none !important;
}

.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.sheet__panel {
  position: relative;
  width: min(100%, 420px);
  max-height: min(88vh, 640px);
  overflow: auto;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 1.1rem 1rem calc(1.1rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18);
}

.sheet__panel h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 0.25rem;
  color: var(--brand-deep);
}

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

.sheet__opt {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-weight: 700;
  min-height: 48px;
  padding: 0.85rem 0.75rem;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.sheet__opt--daily {
  color: var(--brand-deep);
}

.sheet__opt--ghost {
  color: var(--muted);
  font-weight: 650;
  text-align: center;
}

.sheet__more {
  border-top: 1px solid var(--line);
  padding: 0.65rem 0.25rem;
}

.sheet__more summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  display: flex;
  align-items: center;
}

body.sheet-open {
  overflow: hidden;
}

@media (min-width: 721px) {
  .sheet {
    align-items: center;
  }
  .sheet__panel {
    border-radius: 18px;
    padding-bottom: 1.1rem;
  }
}

@media (max-width: 720px) {
  .wrap {
    width: min(100% - 1.1rem, var(--max));
  }

  .wrap:has(#play-workspace) {
    width: min(100% - 0.75rem, var(--max-play));
  }

  .site-header {
    padding-top: env(safe-area-inset-top, 0px);
  }

  .site-header__inner {
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0.55rem 0;
  }

  .logo {
    font-size: clamp(1.45rem, 5vw, 1.75rem);
  }

  .nav {
    width: auto;
    flex: 1;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0.3rem 0.45rem;
    font-size: 0.84rem;
    padding-bottom: 0;
  }

  .nav-lang > summary {
    padding: 0.26rem 0.55rem;
    font-size: 0.78rem;
  }

  .path-strip {
    padding: 0.35rem 0 0.65rem;
    margin-top: 0.15rem;
  }

  .path-strip__intro {
    margin-bottom: 0.45rem;
  }

  .path-strip__title {
    font-size: clamp(1.35rem, 5.5vw, 1.75rem);
  }

  .path-strip__lead {
    display: none;
  }

  .path-strip__actions {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
  }

  .path-card {
    padding: 0.55rem 0.4rem;
    min-height: 44px;
  }

  .path-card__kicker {
    display: none;
  }

  .path-card__label {
    font-size: 0.82rem;
  }

  .play-chrome-extra {
    display: none;
  }

  .play-main {
    padding: 0.55rem;
    border-radius: 16px;
    padding-bottom: calc(0.55rem + 4.5rem);
  }

  .play-toolbar--beside {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0.55rem 0.65rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(10px);
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 0.35rem;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
  }

  .btn-tool {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 0.55rem 0.2rem;
    font-size: 0.78rem;
    border-radius: 12px;
  }

  .zoom-bar__btn {
    width: 44px;
    height: 44px;
  }

  .chip {
    min-height: 40px;
    padding: 0.5rem 0.75rem;
  }

  .timer-pill {
    margin-left: 0;
    width: auto;
    font-size: 0.95rem;
    padding: 0.45rem 0.7rem;
  }

  #board-wrap {
    max-height: none;
  }

  .nav-more__panel {
    left: auto;
    right: 0;
  }

  .site-footer {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px) + 3.5rem);
  }
}

@media (max-width: 640px) {
  .nav-more__panel {
    left: auto;
    right: 0;
  }
}
