@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600;700;800;900&display=swap');

@font-face {
  font-family: 'Ionicons';
  src: url('../assets/Ionicons.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

.ion-icon {
  font-family: 'Ionicons' !important;
  speak: never;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  display: inline-block;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root {
  --color-ghost-white: #F2F1F9;
  --color-space-cadet: #22223B;
  --color-ultra-violet: #4A4E69;
  --color-glaucous: #707599;
  --color-french-gray: #ABAEC4;
  --color-bittersweet: #F87060;
  --color-selective-yellow: #FFB100;
  --color-harvest-gold: #E09D00;
  --color-periwinkle: #CCC9E7;
  --color-periwinkle-half: #E7E6F1;
  --color-sunglow: #FFC847;
  --color-jasmine: #FFDA85;
  --color-peach: #FFE7AD;

  --color-yellow-warn-bg: #FFFBEB;
  --color-yellow-warn-border: #FBBF24;
  --color-yellow-warn-text: #B45309;

  --font-family: -apple-system, BlinkMacSystemFont, "Roboto", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-ghost-white);
  color: var(--color-space-cadet);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 8px 12px 8px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overflow-x: hidden;
}

.app-container {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

/* Brand Header */
.brand-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 8px;
  margin-bottom: 4px;
  text-decoration: none;
}

.brand-header-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  line-height: 1.15;
}

.brand-logo-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.brand-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--color-ultra-violet);
  letter-spacing: -0.3px;
  line-height: 1.15;
}

.brand-sub {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-glaucous);
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1.15;
}

.brand-sub .date-bullet {
  opacity: 0.4;
}

/* In-Game Header: Mistakes (Left) | Hint (Center) | Timer (Right)
   Matches SudokuHeader.tsx (marginTop: 10, marginHorizontal: 10, marginBottom: 4) */
.sudoku-header-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 10px;
  margin-top: 4px;
  margin-bottom: 2px;
}

.header-col-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.header-col-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-col-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Mistakes Count: close-circle-outline + text in #22223B */
.mistakes-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  color: var(--color-space-cadet);
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
}

.header-icon {
  font-size: 24px;
  line-height: 24px;
  color: inherit;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Hint Button */
.hint-header-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  color: var(--color-space-cadet);
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  padding: 4px 8px;
  border-radius: 8px;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.hint-header-btn:hover {
  color: var(--color-selective-yellow);
}

.hint-header-btn:active {
  opacity: 0.7;
}

/* Timer */
.timer-container {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  color: var(--color-space-cadet);
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  padding: 0;
  border-radius: 8px;
  transition: opacity 0.15s ease, color 0.15s ease;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.timer-container .header-icon {
  font-size: 26px;
  line-height: 26px;
}

.timer-container:hover:not(:disabled) {
  color: var(--color-selective-yellow);
}

.timer-container:active:not(:disabled) {
  opacity: 0.7;
}

.timer-container:disabled {
  cursor: default;
  pointer-events: none;
  opacity: 1;
}

/* Sudoku Board Grid:
   Mobile app has NO card shadow, sits directly on background with 3px outer border */
.board-container {
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1 / 1;
  background: transparent;
  padding: 0 10px;
  position: relative;
}

.board-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  background-color: transparent;
  border: 3px solid var(--color-ultra-violet);
  box-sizing: border-box;
}

.cell {
  background-color: transparent;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 1.7rem;
  user-select: none;
  touch-action: manipulation;
  transition: background-color 0.1s ease;
  box-sizing: border-box;
}

/* Cell Borders: 1px thin inner dividers, 3px box borders (BORDER_WIDTH = 3) */
.cell:nth-child(n) {
  border-right: 1px solid var(--color-ultra-violet);
  border-bottom: 1px solid var(--color-ultra-violet);
}

.cell:nth-child(3n) {
  border-right: 3px solid var(--color-ultra-violet);
}

.cell:nth-child(9n) {
  border-right: none;
}

.cell:nth-child(n + 19):nth-child(-n + 27),
.cell:nth-child(n + 46):nth-child(-n + 54) {
  border-bottom: 3px solid var(--color-ultra-violet);
}

.cell:nth-child(n + 73):nth-child(-n + 81) {
  border-bottom: none;
}

/* Exact cell states matching SudokuCellValueComp:
   Initial clues: THEME.background -> #22223B (Space Cadet)
   Valid user inputs: THEME.backgroundSoftSoft -> #707599 (Glaucous)
   Mistakes: THEME.accent -> #F87060 (Bittersweet)
*/
.cell.given {
  color: var(--color-space-cadet); /* #22223B */
  font-weight: 400;
}

.cell.user-input {
  color: var(--color-glaucous); /* #707599 */
  font-weight: 400;
}

.cell.mistake {
  color: var(--color-bittersweet); /* #F87060 */
  font-weight: 400;
}

/* Highlighting logic from SudokuCellComp:
   1. focusedValue && !focused -> THEME.auxFocusedCell (#FFE7AD) + fontWeight 800
   2. focused -> THEME.focusedCell (#FFC847)
   3. selected (same row or col) -> THEME.accentLight (#CCC9E7)
*/
.cell.focused-cell {
  background-color: var(--color-sunglow) !important; /* #FFC847 */
}

.cell.aux-focused-value {
  background-color: var(--color-peach) !important; /* #FFE7AD */
  font-weight: 800 !important;
}

.cell.bold-value {
  font-weight: 800 !important;
}

.cell.selected-row-col {
  background-color: var(--color-periwinkle) !important; /* #CCC9E7 */
}

/* Pencil Notes */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  padding: 2px;
  pointer-events: none;
}

.note-item {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--color-ultra-violet); /* THEME.backgroundSoft: #4A4E69 */
  line-height: 1;
}

.note-item.focused-note {
  font-weight: 900;
  color: var(--color-space-cadet); /* THEME.background: #22223B */
}

/* Sudoku Footer Controls */
.sudoku-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

/* Action Buttons Row: Undo | Input | Notes | Erase */
.footer-actions-row {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  width: 100%;
}

.footer-btn-container {
  flex: 1;
  display: flex;
  justify-content: center;
}

.footer-btn {
  width: 72px;
  background: none;
  border: 3px solid transparent;
  border-radius: 12px;
  padding: 3px 0 2px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  color: var(--color-ultra-violet);
  transition: all 0.15s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.footer-btn-text {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 2px;
  color: inherit;
  line-height: 1;
}

.footer-btn-icon,
.footer-btn ion-icon {
  width: 40px;
  height: 40px;
  font-size: 40px;
  line-height: 40px;
  color: inherit;
}

.footer-btn:disabled {
  color: var(--color-french-gray);
  cursor: default;
  opacity: 0.55;
}

.footer-btn:not(:disabled):active {
  opacity: 0.7;
}

/* Active Button States matching button.tsx & notes-button.tsx */
.footer-btn.active-value {
  background-color: var(--color-periwinkle-half); /* #E7E6F1 */
  border-color: var(--color-ultra-violet);       /* #4A4E69 */
  border-style: solid;
}

.footer-btn.active-notes {
  background-color: var(--color-periwinkle-half); /* #E7E6F1 */
  border-color: var(--color-ultra-violet);       /* #4A4E69 */
  border-style: dashed;
}

/* Input Dividers - EXACT match to <Divider /> in app (4px solid #4A4E69, border-radius 2px) */
.app-divider {
  width: 100%;
  height: 0;
  border-top: 4px solid var(--color-ultra-violet); /* #4A4E69 */
  border-radius: 2px;
  margin: 2px 0;
}

/* Number Input Row: EXACT match to SudokuInput & SudokuInputCell */
.number-input-row {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  padding: 0 2px;
  margin: 1px 0;
}

.input-cell-pressable {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  flex: 1;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.08s ease;
}

.input-cell-pressable:focus {
  outline: none;
}

.input-cell-pressable:focus-visible {
  outline: none;
}

/* Only change digit color on ACTIVE press, matching React Native onPressIn / onPressOut */
.input-cell-pressable:active .input-cell-digit {
  color: var(--color-selective-yellow);
}

@media (hover: hover) and (pointer: fine) {
  .input-cell-pressable:hover .input-cell-digit {
    color: var(--color-selective-yellow);
  }
}

.input-cell-digit {
  font-size: 52px;
  line-height: 50px;
  height: 50px;
  text-align: center;
  color: var(--color-ultra-violet);
  font-weight: 400;
  margin-bottom: 2px;
  transition: color 0.1s ease;
  font-family: inherit;
}

.input-cell-remaining {
  width: 14px;
  height: 14px;
  border-radius: 7px;
  background-color: var(--color-ultra-violet);
  color: var(--color-ghost-white);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 14px;
  text-align: center;
  box-sizing: border-box;
}

/* When 9 instances are filled, cell is opacity: 0 (vanishes like in the app) */
.input-cell-pressable.completed {
  opacity: 0;
  pointer-events: none;
}

/* App Promotion Banner */
.app-promo-card {
  width: 100%;
  background: #ffffff;
  border-radius: 16px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(34, 34, 59, 0.06);
  border: none;
  outline: none;
  margin-top: 2px;
}

.promo-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.promo-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--color-space-cadet);
  line-height: 1.2;
}

.promo-sub {
  font-size: 0.72rem;
  color: var(--color-glaucous);
  line-height: 1.2;
}

.promo-cta-btn {
  background: linear-gradient(135deg, var(--color-sunglow), var(--color-bittersweet));
  color: var(--color-space-cadet); /* Bold contrast on yellow/peach gradient */
  font-weight: 800;
  font-size: 0.82rem;
  padding: 7px 16px;
  border-radius: 16px;
  border: none;
  outline: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(248, 112, 96, 0.25);
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.promo-cta-btn:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.promo-cta-btn:active {
  opacity: 0.75;
  transform: translateY(0);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(34, 34, 59, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-out;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  border-radius: 24px;
  width: 100%;
  max-width: 400px;
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 16px 32px rgba(34, 34, 59, 0.18);
  transform: translateY(12px) scale(0.97);
  transition: transform 0.15s ease-out;
  position: relative;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-icon-circle {
  width: 80px;
  height: 80px;
  border-radius: 40px;
  background: var(--color-yellow-warn-bg);
  border: 2px solid var(--color-sunglow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.modal-icon-circle svg {
  width: 44px;
  height: 44px;
  color: var(--color-harvest-gold);
}

.modal-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--color-space-cadet);
  margin-bottom: 8px;
}

.perfect-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-yellow-warn-bg);
  border: 1px solid var(--color-yellow-warn-border);
  color: var(--color-yellow-warn-text);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.perfect-pill svg {
  width: 18px;
  height: 18px;
}

.stats-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--color-ghost-white);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 18px;
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-box-label {
  font-size: 0.75rem;
  color: var(--color-ultra-violet);
  font-weight: 600;
}

.stat-box-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-space-cadet);
  margin-top: 2px;
}

.stats-divider {
  width: 1px;
  height: 28px;
  background: var(--color-french-gray);
  opacity: 0.4;
}

.modal-pitch {
  font-size: 0.9rem;
  color: var(--color-ultra-violet);
  line-height: 1.45;
  margin-bottom: 18px;
}

.store-buttons-container {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 14px;
}

.store-badge-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, opacity 0.15s ease;
  height: 44px;
  outline: none;
}

.store-badge-link:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

.store-badge-link:active {
  transform: translateY(0);
  opacity: 0.8;
}

.store-badge-img {
  height: 44px;
  width: auto;
  max-width: 150px;
  display: block;
}

/* Desktop QR Code */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  background: var(--color-ghost-white);
  border-radius: 14px;
  margin-bottom: 14px;
  width: 100%;
}

.qr-caption {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-glaucous);
}

.qr-box {
  background: #ffffff;
  padding: 8px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(34, 34, 59, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-code-img {
  width: 120px;
  height: 120px;
  display: block;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.btn-gradient-sunglow-bittersweet {
  width: 100%;
  background: linear-gradient(135deg, var(--color-sunglow), var(--color-bittersweet));
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(248, 112, 96, 0.25);
  transition: opacity 0.15s ease, transform 0.12s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-gradient-sunglow-bittersweet:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.btn-gradient-glaucous-ultraviolet {
  width: 100%;
  background: linear-gradient(135deg, var(--color-glaucous), var(--color-ultra-violet));
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  padding: 11px 18px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-gradient-glaucous-ultraviolet:hover {
  opacity: 0.92;
}

.btn-close-modal {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-glaucous);
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close-modal:hover {
  color: var(--color-space-cadet);
  background: var(--color-ghost-white);
}

/* Loading Screen */
.loading-screen {
  background: transparent;
  width: 100%;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(74, 78, 105, 0.2);
  border-top-color: var(--color-selective-yellow);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-glaucous);
}

/* Error Screen */
.error-screen {
  background: #ffffff;
  border-radius: 20px;
  padding: 36px 24px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(34, 34, 59, 0.05);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.error-icon {
  width: 56px;
  height: 56px;
  border-radius: 28px;
  background: #fee2e2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-bittersweet);
}

.error-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-space-cadet);
}

.error-desc {
  font-size: 0.9rem;
  color: var(--color-glaucous);
  max-width: 320px;
  line-height: 1.45;
}

.paused-icon-circle {
  width: 80px;
  height: 80px;
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background-color: var(--color-periwinkle-half); /* #E7E6F1 */
  border: 2px solid var(--color-periwinkle);      /* #CCC9E7 */
}

.paused-title-text {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-space-cadet); /* #22223B */
  text-align: center;
  line-height: 1.2;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1200;
}

@media (max-width: 480px) {
  body {
    padding: 6px 6px 10px 6px;
  }
  .brand-header {
    gap: 10px;
    margin-top: 4px;
    margin-bottom: 2px;
  }
  .brand-logo-img {
    width: 42px;
    height: 42px;
  }
  .brand-title {
    font-size: 1.4rem;
  }
  .brand-sub {
    font-size: 0.82rem;
  }
  .sudoku-header-bar {
    padding: 0 4px;
    margin-top: 2px;
    margin-bottom: 2px;
  }
  .board-container {
    padding: 0 4px;
  }
  .cell {
    font-size: 1.55rem;
  }
  .input-cell-digit {
    font-size: 48px;
    line-height: 46px;
    height: 46px;
  }
  /* Action button icons MUST NOT shrink - keep them crisp and clear */
  .footer-btn {
    width: 68px;
  }
  .footer-btn-icon,
  .footer-btn ion-icon {
    width: 38px;
    height: 38px;
    font-size: 38px;
    line-height: 38px;
  }
  .app-promo-card {
    padding: 6px 12px;
    border-radius: 12px;
  }
  .qr-container {
    display: none;
  }
}

/* Extra compact optimization only for very short screens like iPhone SE (<= 667px height) */
@media (max-height: 700px) and (max-width: 480px) {
  body {
    padding: 4px 4px 6px 4px;
  }
  .app-container {
    gap: 1px;
  }
  .brand-header {
    gap: 6px;
    margin-top: 2px;
    margin-bottom: 1px;
  }
  .brand-logo-img {
    width: 34px;
    height: 34px;
  }
  .brand-title {
    font-size: 1.2rem;
  }
  .brand-sub {
    font-size: 0.74rem;
  }
  .sudoku-header-bar {
    margin-top: 1px;
    margin-bottom: 1px;
    padding: 0 2px;
  }
  .board-container {
    padding: 0 2px;
  }
  .cell {
    font-size: 1.45rem;
  }
  .note-item {
    font-size: 0.62rem;
  }
  .footer-btn {
    width: 62px;
    padding: 1px 0;
  }
  /* Keep icons clear and visible even on small screens */
  .footer-btn-icon,
  .footer-btn ion-icon {
    width: 36px;
    height: 36px;
    font-size: 36px;
    line-height: 36px;
  }
  .app-divider {
    border-top-width: 3px;
    margin: 1px 0;
  }
  .input-cell-digit {
    font-size: 44px;
    line-height: 42px;
    height: 42px;
    margin-bottom: 1px;
  }
  .app-promo-card {
    padding: 5px 10px;
    margin-top: 1px;
  }
  .promo-title {
    font-size: 0.78rem;
  }
  .promo-sub {
    font-size: 0.66rem;
  }
  .promo-cta-btn {
    font-size: 0.74rem;
    padding: 4px 10px;
  }
}

/* Dev-only Floating Solve Toolbar */
.dev-toolbar {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
}

.btn-dev-solve {
  background: var(--color-space-cadet);
  color: var(--color-sunglow);
  border: 1.5px solid var(--color-sunglow);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(34, 34, 59, 0.3);
  transition: transform 0.15s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-dev-solve:hover {
  transform: translateY(-2px);
  background: var(--color-ultra-violet);
}

.btn-dev-reset {
  background: var(--color-space-cadet);
  color: #ffffff;
  border: 1.5px solid var(--color-french-gray);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(34, 34, 59, 0.3);
  transition: transform 0.15s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.btn-dev-reset:hover {
  transform: translateY(-2px);
  background: var(--color-ultra-violet);
}

/* Post-Game Completed Card (Under Board) */
.post-game-card {
  width: 100%;
  max-width: var(--board-max-size, 460px);
  background: #ffffff;
  border-radius: 18px;
  padding: 14px 18px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 4px 16px rgba(34, 34, 59, 0.08);
  box-sizing: border-box;
}

.post-game-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.post-game-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-space-cadet);
}

.post-game-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-glaucous);
  margin-bottom: 10px;
}

.post-game-bullet {
  color: var(--color-french-gray);
}

.post-game-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin-bottom: 12px;
}

.post-game-actions .btn-gradient-sunglow-bittersweet {
  padding: 10px 20px;
  font-size: 0.95rem;
}

.post-game-app-promo {
  width: 100%;
  border-top: 1px solid var(--color-ghost-white);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.post-game-promo-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-ultra-violet);
  line-height: 1.3;
  margin-bottom: 6px;
}

/* ==========================================================================
   Embedded Sudoku Visual Diagrams (for How to Play & Guides)
   ========================================================================== */
.diagram-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  padding: 18px 14px;
  background: var(--color-ghost-white);
  border-radius: 16px;
  border: 1px solid var(--color-periwinkle);
}

.diagram-caption {
  font-size: 0.9rem;
  color: var(--color-ultra-violet);
  text-align: center;
  line-height: 1.45;
}

.diagram-caption strong {
  color: var(--color-space-cadet);
}

/* Row Diagram */
.diagram-row-wrapper {
  width: 100%;
  overflow-x: auto;
  display: flex;
  justify-content: center;
  padding: 4px 0;
}

.diagram-row {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 2px solid var(--color-space-cadet);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(34, 34, 59, 0.06);
}

.diagram-cell {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-space-cadet);
  border-right: 1px solid var(--color-periwinkle);
}

.diagram-cell:last-child {
  border-right: none;
}

.diagram-cell.highlight-target {
  background-color: var(--color-sunglow);
  color: var(--color-space-cadet);
  font-weight: 800;
}

/* Column Diagram */
.diagram-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 2px solid var(--color-space-cadet);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(34, 34, 59, 0.06);
}

.diagram-column .diagram-cell {
  border-right: none;
  border-bottom: 1px solid var(--color-periwinkle);
}

.diagram-column .diagram-cell:last-child {
  border-bottom: none;
}

/* 3x3 Mini Grid Diagram */
.diagram-grid-3x3 {
  display: grid;
  grid-template-columns: repeat(3, 40px);
  grid-template-rows: repeat(3, 40px);
  background: #ffffff;
  border: 2px solid var(--color-space-cadet);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(34, 34, 59, 0.06);
}

.diagram-grid-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-space-cadet);
  border-right: 1px solid var(--color-periwinkle);
  border-bottom: 1px solid var(--color-periwinkle);
}

.diagram-grid-cell:nth-child(3n) {
  border-right: none;
}

.diagram-grid-cell:nth-child(n + 7) {
  border-bottom: none;
}

.diagram-grid-cell.highlight-target {
  background-color: var(--color-sunglow);
  color: var(--color-space-cadet);
  font-weight: 800;
}

/* Notes Progression Diagram */
.notes-progression {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.notes-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.notes-step-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-glaucous);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.diagram-single-cell {
  width: 52px;
  height: 52px;
  background: #ffffff;
  border: 2px solid var(--color-space-cadet);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(34, 34, 59, 0.06);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-space-cadet);
}

.diagram-single-cell.solved {
  background-color: var(--color-peach);
  color: var(--color-space-cadet);
}

.diagram-single-cell .notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  padding: 3px;
}

.diagram-single-cell .note-item {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-glaucous);
  line-height: 1;
}

@media (max-width: 600px) {
  .diagram-container {
    padding: 14px 8px;
    margin: 14px 0;
  }
  .diagram-cell {
    width: 30px;
    height: 30px;
    font-size: 0.95rem;
  }
  .diagram-grid-3x3 {
    grid-template-columns: repeat(3, 34px);
    grid-template-rows: repeat(3, 34px);
  }
  .diagram-grid-cell {
    font-size: 1rem;
  }
  .diagram-single-cell {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
}

/* ==========================================================================
   Consistent Site Footer
   ========================================================================== */
.site-footer {
  margin-top: 36px;
  padding: 24px 16px 36px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 760px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 12px;
}

.footer-link {
  color: var(--color-glaucous);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.footer-link:hover {
  color: var(--color-space-cadet);
}

.footer-dot {
  color: var(--color-periwinkle);
  font-size: 0.75rem;
  user-select: none;
}

.footer-credit {
  font-size: 0.8rem;
  color: var(--color-glaucous);
  opacity: 0.85;
}

.footer-credit a {
  color: var(--color-ultra-violet);
  text-decoration: none;
  font-weight: 600;
}

.footer-credit a:hover {
  color: var(--color-space-cadet);
  text-decoration: underline;
}


