.fullscreen-toggle-btn.is-active {
  background: rgba(199, 210, 254, 0.16);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.fullscreen-toggle-btn {
  white-space: normal;
}

body.sudoku-app-mode {
  --fullscreen-board-size: min(100%, calc(100dvw - 29rem), calc(100dvh - 11rem), 50rem);
}

body.sudoku-app-mode .wrap {
  min-height: 100dvh;
  padding: 0;
}

body.sudoku-app-mode .site-header {
  display: none;
}

body.sudoku-app-mode .shell {
  max-width: none;
  min-height: 100dvh;
  height: 100dvh;
  margin: 0;
  padding-top: max(0.8rem, env(safe-area-inset-top, 0px));
  padding-right: max(0.8rem, env(safe-area-inset-right, 0px));
  padding-bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
  padding-left: max(0.8rem, env(safe-area-inset-left, 0px));
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

body.sudoku-app-mode .hero-header {
  margin-bottom: 0.8rem;
}

body.sudoku-app-mode .hero-copy-wrap {
  gap: 0.7rem;
}

body.sudoku-app-mode .hero-back-link {
  width: 2.1rem;
  min-width: 2.1rem;
  min-height: 2.1rem;
  font-size: 1.12rem;
}

body.sudoku-app-mode .eyebrow {
  margin-bottom: 0.18rem;
  font-size: 0.64rem;
}

body.sudoku-app-mode .hero h1 {
  font-size: clamp(2rem, 3.2vw, 3rem);
}

body.sudoku-app-mode .playfield {
  grid-template-columns: minmax(152px, 184px) minmax(0, 1fr) minmax(178px, 228px);
  gap: 0.85rem;
}

body.sudoku-app-mode .hero-stats-rail {
  gap: 0.55rem;
}

body.sudoku-app-mode .hero-stats-rail .stat {
  min-height: 4.7rem;
  padding: 0.72rem 0.8rem;
}

body.sudoku-app-mode .hero-stats-rail .stat-label {
  font-size: 0.62rem;
}

body.sudoku-app-mode .hero-stats-rail .stat-value,
body.sudoku-app-mode .hero-stats-rail .stat-meta {
  white-space: normal;
}

body.sudoku-app-mode .hero-stats-rail .stat-value {
  line-height: 1.04;
  font-size: clamp(1.02rem, 1.4vw, 1.55rem);
}

body.sudoku-app-mode .hero-stats-rail .stat-meta {
  line-height: 1.2;
}

body.sudoku-app-mode .board-card {
  padding: 0.82rem;
}

body.sudoku-app-mode .board-shell {
  padding: 0.7rem;
}

body.sudoku-app-mode .board-grid {
  width: var(--fullscreen-board-size);
}

body.sudoku-app-mode .status-message {
  max-width: var(--fullscreen-board-size);
  margin: 0.75rem auto 0;
}

body.sudoku-app-mode .floating-controls {
  top: max(0.8rem, env(safe-area-inset-top, 0px));
  gap: 0.6rem;
}

body.sudoku-app-mode .mode-shortcuts {
  font-size: 0.68rem;
}

body.sudoku-app-mode .desktop-keypad {
  gap: 0.34rem;
  padding: 0.48rem;
}

body.sudoku-app-mode .floating-action {
  min-height: 2.56rem;
}

@media (max-width: 1280px) {
  body.sudoku-app-mode {
    --fullscreen-board-size: min(100%, calc(100dvw - 27rem), calc(100dvh - 11.25rem), 45rem);
  }

  body.sudoku-app-mode .playfield {
    grid-template-columns: minmax(144px, 174px) minmax(0, 1fr) minmax(166px, 212px);
  }
}

@media (max-width: 1080px) {
  body.sudoku-app-mode {
    --fullscreen-board-size: min(100%, calc(100dvh - 18rem), 46rem);
  }

  body.sudoku-app-mode .shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  body.sudoku-app-mode .hero-header {
    margin-bottom: 0.7rem;
  }

  body.sudoku-app-mode .hero-stats-rail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.sudoku-app-mode .playfield-rail-controls .floating-controls {
    top: auto;
  }
}

@media (max-width: 720px) {
  body.sudoku-app-mode .shell {
    padding-top: max(0.65rem, env(safe-area-inset-top, 0px));
    padding-right: max(0.65rem, env(safe-area-inset-right, 0px));
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
    padding-left: max(0.65rem, env(safe-area-inset-left, 0px));
    min-height: auto;
    height: auto;
  }

  body.sudoku-app-mode.has-mobile-keypad .shell {
    padding-bottom: calc(21.5rem + env(safe-area-inset-bottom, 0px));
  }

  body.sudoku-app-mode .hero-header {
    margin-bottom: 0.55rem;
  }

  body.sudoku-app-mode .eyebrow {
    display: none;
  }

  body.sudoku-app-mode .hero h1 {
    font-size: clamp(2rem, 9vw, 3rem);
  }

  body.sudoku-app-mode .hero-stats-rail {
    gap: 0.5rem;
  }

  body.sudoku-app-mode .hero-stats-rail .stat {
    min-height: 4.2rem;
  }

  body.sudoku-app-mode .floating-controls {
    margin-top: 0.7rem;
    padding: 0 0.35rem 0.35rem;
  }

  body.sudoku-app-mode .mode-shortcuts {
    margin-top: -0.2rem;
  }

  body.sudoku-app-mode .keypad {
    width: min(100vw - 0.2rem, 26rem);
    max-width: calc(100vw - 0.2rem);
  }
}
