:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #eef2f7;
  --border: #d8e0eb;
  --text: #162033;
  --muted: #5d687a;
  --accent: #2f5bea;
  --accent-2: #5d687a;
}

body.dark-mode {
  --bg: #1a1a1a;
  --surface: #242424;
  --surface-soft: #2a2a2a;
  --border: rgba(255,255,255,0.06);
  --text: #f1f1f1;
  --muted: rgba(241,241,241,0.64);
  --accent: #7c5cff;
  --accent-2: #7c5cff;
}

body.dark-mode .eyebrow {
  color: var(--accent);
}

body, .glass-card, .calendar-day, .gallery-card {
  transition: background-color 220ms ease, color 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

* { box-sizing: border-box; border: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
img { max-width: 100%; }

.shell {
  width: min(1100px, calc(100vw - 24px));
  margin: 0 auto;
}

.category-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
}

.category-tab {
  padding: 0.7rem 0.95rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.category-tab:hover {
  background: #f3f6fc;
  border-color: #c9d7ee;
  box-shadow: 0 0 0 1px rgba(47, 91, 234, 0.08), 0 8px 18px rgba(22, 32, 51, 0.08);
  transform: translateY(-1px);
}

body.dark-mode .category-tab:hover {
  background: rgba(124, 92, 255, 0.16);
  color: #ffffff;
  border-color: rgba(124, 92, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.16), 0 8px 20px rgba(0, 0, 0, 0.24);
  transform: translateY(-1px);
}

.category-tab.is-active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

#themeToggleBtn {
  margin-left: auto;
}

.theme-toggle-btn {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 0;
  overflow: hidden;
  flex: 0 0 auto;
}

.theme-toggle-lottie {
  width: 38px;
  height: 38px;
  display: block;
  pointer-events: none;
}

.theme-toggle-lottie svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

body.dark-mode .theme-toggle-lottie svg,
body.dark-mode .theme-toggle-lottie svg * {
  fill: #f1f1f1;
  stroke: #f1f1f1;
}

/* Language selector styled to match other buttons */
.language-select {
  -webkit-appearance: none;
  appearance: none;
  padding: 0 16px 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  height: 60px; /* match theme toggle */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 120px;
  font-size: 0.95rem;
  position: relative;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23162633' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: calc(100% - 12px) center;
  background-size: 12px;
}

.category-switcher .language-select {
  margin-left: 8px;
  flex: 0 0 auto;
}

.language-select:hover {
  background: var(--surface-soft);
  border-color: #c9d7ee;
  box-shadow: 0 0 0 1px rgba(47, 91, 234, 0.08), 0 8px 18px rgba(22, 32, 51, 0.08);
  transform: translateY(-1px);
}

.language-select::-ms-expand { display: none; }

.language-select option { padding: 8px; }

body.dark-mode .language-select:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(124, 92, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.12), 0 10px 24px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

.language-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(47,91,234,0.08);
}

/* Dropdown for language button */
.language-container { position: relative; display: inline-flex; align-items: center; }
.language-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(22,32,51,0.08);
  display: grid;
  gap: 6px;
  z-index: 40;
}
.language-dropdown[hidden] { display: none; }
.language-option {
  background: none;
  border: 1px solid transparent;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
}
.language-option:hover { background: var(--surface-soft); border-color: #c9d7ee; }

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px 0 8px;
}

.hero-copy h1,
.section-heading h2 {
  margin: 0;
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  max-width: 12ch;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  font-weight: 800;
}

.lead {
  margin: 18px 0 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.button,
.icon-button {
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.button { padding: 0.8rem 1rem; font-weight: 700; }

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

.secondary,
.tertiary,
.icon-button {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.secondary:hover,
.tertiary:hover,
.icon-button:hover {
  background: var(--surface-soft);
  border-color: #c9d7ee;
  box-shadow: 0 0 0 1px rgba(47, 91, 234, 0.08), 0 8px 18px rgba(22, 32, 51, 0.08);
  transform: translateY(-1px);
}

body.dark-mode .secondary:hover,
body.dark-mode .tertiary:hover,
body.dark-mode .icon-button:hover,
body.dark-mode .mode-btn:hover,
body.dark-mode .number-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(124, 92, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.12), 0 10px 24px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

body.dark-mode .lottery-section .button.primary:hover {
  background: #8f79ff;
  border-color: #8f79ff;
  box-shadow: 0 0 0 1px rgba(143, 121, 255, 0.2), 0 12px 26px rgba(0, 0, 0, 0.28);
}

body.dark-mode .lottery-section .number-btn:not(.selected):hover {
  background: rgba(45, 212, 191, 0.2);
  border-color: rgba(45, 212, 191, 0.82);
  color: #e7fffb;
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.2), 0 10px 24px rgba(3, 26, 24, 0.34);
}

body.dark-mode .lottery-section .number-btn.selected:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

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

.hero-panel {
  display: none;
}

.panel-top {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.panel-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.panel-pill.accent {
  color: var(--accent);
  background: #eef3ff;
}

.hero-stats {
  display: grid;
  gap: 16px;
}

.hero-stats article {
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.hero-stats strong {
  display: block;
  font-size: 2rem;
  margin-bottom: 6px;
}

.hero-stats span,
.section-text,
.calendar-meta span,
.field-hint,
.form-status {
  color: var(--muted);
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.calendar-meta strong { font-size: 1.05rem; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-weekday {
  padding: 6px 8px;
  font-weight: 700;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.calendar-day {
  min-height: 84px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.calendar-day {
  box-shadow: 0 0 0 1px rgba(22, 32, 51, 0.04) inset;
}

.calendar-day.other-month { opacity: 0.45; }
.calendar-day.today { outline: 2px solid var(--accent); }
.calendar-day button.day-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.calendar-day .day-number {
  font-weight: 700;
  color: var(--text);
}
.calendar-day .day-spot {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.calendar-day .day-btn:focus-visible,
.calendar-day:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(47,91,234,0.08);
}

.category-panel[hidden] {
  display: none !important;
}

.widget,
.card-wide,
.form-widget,
.sudoku-widget {
  grid-column: span 12;
  padding: 20px;
  border-radius: 12px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.section-heading h2 {
  font-size: clamp(1.25rem, 2.2vw, 1.8rem);
}

.section-text { margin: 0 0 14px; line-height: 1.6; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border);
  aspect-ratio: 4 / 5;
  cursor: pointer;
  background: var(--surface-soft);
  padding: 0;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 180ms ease;
}

.gallery-card:hover img { transform: scale(1.04); }

.gallery-caption {
  position: absolute;
  inset: auto 12px 12px 12px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface);
}

.gallery-caption strong,
.gallery-caption span { display: block; }

.gallery-caption span { font-size: 0.84rem; color: var(--muted); margin-top: 4px; }

.nav-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 1rem;
}

.calendar-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.calendar-meta strong { font-size: 1.15rem; }

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.day-card {
  min-height: 130px;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.day-card.weekend {
  background: #edf2fa;
}

.day-card.today {
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 91, 234, 0.08);
}

.day-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
  font-weight: 800;
}

.day-label small { color: var(--muted); font-weight: 600; }

.day-date {
  font-size: 2rem;
  font-weight: 800;
}

.day-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.tic-mode-selector {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.mode-btn {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  transition: background 160ms ease, border-color 160ms ease;
  font-size: 0.9rem;
}

.mode-btn:hover {
  background: var(--surface);
}

.mode-btn.is-active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.tic-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 360px;
}

.tic-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  font-size: clamp(2rem, 7vw, 3.2rem);
  font-weight: 800;
  cursor: pointer;
}

.tic-cell:disabled {
  cursor: default;
  opacity: 0.95;
}

.tic-cell.x { color: var(--accent); }
.tic-cell.o { color: var(--accent-2); }

.lottery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lottery-grid h3 { margin: 0 0 12px; }

.number-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.number-table td {
  padding: 8px;
}

.lottery-ball {
  width: 100%;
  min-height: 54px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-weight: 800;
  font-size: 1.05rem;
}

.lottery-ball.is-match {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(47, 91, 234, 0.2);
}

.accent-table .lottery-ball {
  background: #eaf8f8;
  color: var(--accent-2);
}

.accent-table .lottery-ball.is-match {
  background: #ffb703;
  border-color: #ffb703;
  color: #1f1500;
  box-shadow: 0 0 0 2px rgba(255, 183, 3, 0.35);
}

.lottery-section {
  margin-bottom: 24px;
}

.lottery-section h3,
.lottery-section h4 {
  margin: 0 0 12px;
}

.input-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.lottery-input-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 16px;
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.number-btn {
  aspect-ratio: 1;
  padding: 0;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 160ms ease;
}

.number-btn:hover {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 1px rgba(47, 91, 234, 0.08), 0 8px 18px rgba(22, 32, 51, 0.08);
  transform: translateY(-1px);
}

.lottery-section .button.primary:hover {
  background: #3655dd;
  border-color: #3655dd;
  box-shadow: 0 0 0 1px rgba(54, 85, 221, 0.2), 0 12px 26px rgba(36, 54, 143, 0.26);
  transform: translateY(-1px);
}

.lottery-section .number-btn:not(.selected):hover {
  border-color: #11b8a5;
  background: #defcf5;
  color: #0a3d37;
  box-shadow: 0 0 0 1px rgba(17, 184, 165, 0.22), 0 10px 22px rgba(12, 91, 82, 0.18);
  transform: translateY(-1px);
}

body:not(.dark-mode) .lottery-section .button.primary:hover,
body:not(.dark-mode) .lottery-section .number-btn:not(.selected):hover {
  box-shadow: 0 0 0 1px rgba(17, 184, 165, 0.22), 0 10px 22px rgba(12, 91, 82, 0.18) !important;
  transform: translateY(-1px) !important;
}

body:not(.dark-mode) .lottery-section .button.primary:hover {
  background: #3655dd !important;
  border-color: #3655dd !important;
}

body:not(.dark-mode) .lottery-section .number-btn:not(.selected):hover {
  background: #defcf5 !important;
  border-color: #11b8a5 !important;
  color: #0a3d37 !important;
  box-shadow: 0 0 0 1px rgba(17, 184, 165, 0.22), 0 10px 22px rgba(12, 91, 82, 0.18) !important;
  transform: translateY(-1px) !important;
}

.lottery-section .number-btn.selected:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.lottery-section .number-btn.selected,
.lottery-section .number-btn.selected:hover {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #ffffff !important;
}

.number-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.number-btn.selected:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.lottery-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.lottery-result-message {
  padding: 16px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-weight: 600;
  text-align: center;
  font-size: 1.1rem;
}

.lottery-result-message.win {
  background: rgba(57, 211, 173, 0.1);
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.lottery-result-message.loss {
  background: rgba(255, 112, 97, 0.1);
  border-color: #ff7061;
  color: #ff7061;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-field {
  display: grid;
  gap: 10px;
}

.form-field.wide { grid-column: span 2; }

.form-field span {
  font-weight: 700;
}

.form-field input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  padding: 0.85rem 0.95rem;
  outline: none;
}

body.dark-mode .form-field input {
  background: var(--surface-soft);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.form-field input::placeholder {
  color: var(--muted);
}

body.dark-mode .form-field input::placeholder {
  color: rgba(241, 241, 241, 0.42);
}

.form-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 91, 234, 0.1);
}

body.dark-mode .form-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}

.form-field.valid input { border-color: var(--accent-2); }
.form-field.invalid input { border-color: #c0392b; }

body.dark-mode .form-field.valid input { border-color: #39d3ad; }
body.dark-mode .form-field.invalid input { border-color: #ff8a80; }

.field-hint { min-height: 1.2em; font-size: 0.92rem; }
.form-field.valid .field-hint { color: var(--accent-2); }
.form-field.invalid .field-hint { color: #c0392b; }

body.dark-mode .field-hint {
  color: rgba(241, 241, 241, 0.62);
}

body.dark-mode .form-field.valid .field-hint { color: #39d3ad; }
body.dark-mode .form-field.invalid .field-hint { color: #ff8a80; }

.form-status {
  margin: 14px 0 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

body.dark-mode .form-status {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

body.dark-mode .form-field span {
  color: var(--text);
}

.submit-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.sudoku-controls {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.sudoku-difficulty-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sudoku-difficulty-btn {
  min-width: 92px;
}

.sudoku-status {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--muted);
}

body.dark-mode .sudoku-status {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(241, 241, 241, 0.72);
}

.sudoku-board {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 4px;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

body.dark-mode .sudoku-board {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.sudoku-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #ffffff;
  font-size: clamp(0.88rem, 1.8vw, 1.05rem);
  font-weight: 800;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

body.dark-mode .sudoku-cell {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.sudoku-cell.is-given {
  color: var(--text);
  font-weight: 900;
}

.sudoku-cell.is-editable {
  padding: 0;
  overflow: hidden;
}

.sudoku-cell input {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: center;
  font: inherit;
  font-weight: 900;
  outline: none;
}

.sudoku-cell input:focus {
  box-shadow: inset 0 0 0 2px var(--accent);
  background: rgba(47, 91, 234, 0.08);
}

.sudoku-cell.is-focused {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

body.dark-mode .sudoku-cell input:focus {
  background: rgba(124, 92, 255, 0.14);
  box-shadow: inset 0 0 0 2px rgba(124, 92, 255, 0.8);
}

.sudoku-cell.band-edge { box-shadow: inset 0 -1px 0 var(--border); }
.sudoku-cell.stack-edge { box-shadow: inset -1px 0 0 var(--border); }
.sudoku-cell.block {
  background: #f0f4ff;
}

body.dark-mode .sudoku-cell.block {
  background: rgba(124, 92, 255, 0.12);
}

.sudoku-cell.is-correct {
  background: rgba(57, 211, 173, 0.15);
  color: #0f7b64;
}

.sudoku-cell.is-wrong {
  background: rgba(255, 112, 97, 0.14);
  color: #b73629;
}

body.dark-mode .sudoku-cell.is-correct {
  background: rgba(57, 211, 173, 0.16);
  color: #8af0d5;
}

body.dark-mode .sudoku-cell.is-wrong {
  background: rgba(255, 112, 97, 0.18);
  color: #ffb2ab;
}

body.dark-mode .sudoku-cell.band-edge { box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08); }
body.dark-mode .sudoku-cell.stack-edge { box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08); }

@media (max-width: 1040px) {
  .hero,
  .page-grid {
    grid-template-columns: 1fr;
  }

  .widget,
  .card-wide,
  .form-widget,
  .sudoku-widget {
    grid-column: span 12;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 20px, 1180px);
  }

  .category-switcher {
    padding: 12px;
  }

  .hero {
    padding-top: 24px;
  }

  .hero-copy h1 {
    max-width: none;
  }

  .section-heading,
  .calendar-meta,
  .lottery-grid,
  .field-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .gallery-grid,
  .week-strip,
  .lottery-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .widget {
    padding: 16px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .form-field.wide {
    grid-column: auto;
  }

  .tic-board {
    max-width: none;
  }
}