:root {
  --bg: #08111f;
  --bg-alt: #0e1b2d;
  --panel: rgba(10, 20, 35, 0.78);
  --panel-strong: rgba(7, 15, 28, 0.95);
  --line: rgba(96, 247, 193, 0.22);
  --line-strong: rgba(96, 247, 193, 0.55);
  --text: #e8fff7;
  --muted: #94b9b0;
  --accent: #60f7c1;
  --accent-2: #22d3ee;
  --warning: #ff7a90;
  --fixed: #7af0ff;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(96, 247, 193, 0.16), transparent 28%),
    linear-gradient(135deg, #050a13, #091322 45%, #0a1724 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 100%);
  pointer-events: none;
}

.page-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.hero-copy,
.hero-panel,
.board-section,
.control-card {
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-panel {
  border-radius: 24px;
  padding: 28px;
}

.hero-copy::after,
.hero-panel::after,
.board-section::after,
.control-card::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(96, 247, 193, 0.08);
  pointer-events: none;
}

.eyebrow,
.panel-header,
.section-topline,
.card-code {
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--accent);
  margin: 0 0 12px;
  font-size: 0.85rem;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 0.96;
}

.hero-text {
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 18px 0 22px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tags span {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(96, 247, 193, 0.07);
  color: var(--text);
  font-size: 0.92rem;
}

.panel-header,
.section-topline,
.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.panel-header {
  color: var(--accent);
  margin-bottom: 16px;
  font-size: 0.82rem;
}

.status-list {
  margin: 0;
  display: grid;
  gap: 14px;
}

.status-list div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.status-list dt {
  color: var(--muted);
}

.status-list dd {
  margin: 0;
  font-family: "Share Tech Mono", monospace;
  font-size: 1.1rem;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(300px, 0.8fr);
  gap: 24px;
  align-items: start;
}

.board-section {
  border-radius: 28px;
  padding: 22px;
}

.section-topline {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.82rem;
}

.section-topline span:first-child {
  color: var(--accent);
}

.board-wrap {
  display: flex;
  justify-content: center;
}

.sudoku-board {
  display: grid;
  grid-template-columns: repeat(9, minmax(34px, 1fr));
  width: min(100%, 640px);
  aspect-ratio: 1;
  border: 2px solid var(--line-strong);
  background:
    linear-gradient(180deg, rgba(96, 247, 193, 0.05), rgba(34, 211, 238, 0.03)),
    var(--panel-strong);
}

.cell {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
  transition: background 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.cell strong {
  font-size: clamp(1.1rem, 2vw, 1.65rem);
  font-weight: 700;
}

.cell.fixed strong {
  color: var(--fixed);
}

.cell.editable strong {
  color: var(--text);
}

.cell.selected {
  background: rgba(96, 247, 193, 0.18);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.cell.related {
  background: rgba(96, 247, 193, 0.08);
}

.cell.same-number {
  background: rgba(34, 211, 238, 0.12);
}

.cell.error {
  background: rgba(255, 122, 144, 0.16);
}

.cell.notes-mode::before {
  content: "NOTE";
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 0.55rem;
  color: var(--accent);
  font-family: "Share Tech Mono", monospace;
}

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

.note {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.62rem;
}

.cell:nth-child(3n) {
  border-right: 2px solid var(--line-strong);
}

.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: 2px solid var(--line-strong);
}

.control-section {
  display: grid;
  gap: 18px;
}

.control-card {
  border-radius: 24px;
  padding: 20px;
}

.card-title-row {
  margin-bottom: 18px;
}

.card-title-row h2 {
  font-size: 1.2rem;
}

.card-code {
  color: var(--accent);
  font-size: 0.8rem;
}

.difficulty-switcher,
.action-grid,
.number-pad {
  display: grid;
  gap: 10px;
}

.difficulty-switcher {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 14px;
}

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

.number-pad {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 12px;
}

button {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 14px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

button.active,
button.toggle-on {
  background: linear-gradient(135deg, rgba(96, 247, 193, 0.2), rgba(34, 211, 238, 0.18));
  border-color: var(--line-strong);
}

.ghost-btn {
  color: #ffd8df;
  border-color: rgba(255, 122, 144, 0.28);
  background: rgba(255, 122, 144, 0.08);
}

.wide-btn {
  width: 100%;
}

.tips-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.tips-card li + li {
  margin-top: 8px;
}

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

  .hero {
    margin-bottom: 18px;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1280px);
    padding-top: 18px;
  }

  .hero-copy,
  .hero-panel,
  .board-section,
  .control-card {
    border-radius: 20px;
  }

  .hero-copy,
  .hero-panel,
  .board-section,
  .control-card {
    padding: 18px;
  }

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

  .section-topline,
  .panel-header,
  .card-title-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
