:root {
  --bg-top: #fff3df;
  --bg-bottom: #ffd1a8;
  --surface: rgba(255, 249, 241, 0.82);
  --surface-strong: #fff7ee;
  --line: rgba(145, 69, 13, 0.18);
  --line-strong: #b95e16;
  --text: #5a2800;
  --muted: #9b6031;
  --accent: #f07d1e;
  --accent-dark: #cb5d08;
  --accent-soft: #ffd7b2;
  --success: #2f8f5b;
  --error: #c74116;
  --shadow: 0 24px 60px rgba(147, 75, 7, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 28%),
    radial-gradient(circle at right center, rgba(255, 198, 116, 0.45), transparent 30%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

button,
input {
  font: inherit;
}

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

.language-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.language-picker {
  display: grid;
  gap: 8px;
}

.language-picker-label {
  font-family: "Sora", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.language-picker-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  padding: 10px 14px;
  border: 1px solid rgba(203, 93, 8, 0.2);
  border-radius: 18px;
  background: rgba(255, 249, 241, 0.82);
  box-shadow: 0 10px 24px rgba(147, 75, 7, 0.08);
}

.language-flag {
  font-size: 1.25rem;
  line-height: 1;
}

.language-select {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.hero-card,
.control-card,
.board-card,
.ad-banner {
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.ad-banner {
  padding: 18px 22px;
  margin-bottom: 24px;
}

.promo-banner {
  padding: 10px;
  overflow: hidden;
}

.promo-banner-link {
  display: block;
  border-radius: 22px;
  overflow: hidden;
}

.promo-banner-image {
  display: block;
  width: 100%;
  height: auto;
}

.ad-banner-bottom {
  margin-top: 24px;
  margin-bottom: 0;
}

.ad-banner-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
}

.ad-banner-label {
  font-family: "Sora", sans-serif;
  font-size: 0.98rem;
  color: var(--accent-dark);
}

.ad-banner-label-row small {
  font-size: 0.84rem;
}

.ad-slot {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 20px;
  border: 2px dashed rgba(203, 93, 8, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 244, 231, 0.94), rgba(255, 230, 204, 0.82));
  text-align: center;
  color: var(--muted);
}

.ad-slot iframe {
  display: block;
  margin: 0 auto;
  border: 0;
}

.ad-slot span {
  max-width: 32ch;
  line-height: 1.5;
}

.hero-card {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.75fr;
  gap: 22px;
  padding: 28px;
  margin-bottom: 24px;
}

.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-board-image {
  width: min(100%, 320px);
  height: auto;
  filter: drop-shadow(0 20px 32px rgba(177, 91, 14, 0.18));
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-dark);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
}

h1 {
  font-size: clamp(2.3rem, 4vw, 4rem);
  line-height: 0.98;
}

.hero-text {
  max-width: 54ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.hero-panel {
  display: grid;
  gap: 14px;
}

.stat-chip {
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 221, 184, 0.85), rgba(255, 241, 226, 0.95));
  border: 1px solid rgba(240, 125, 30, 0.18);
}

.stat-chip span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.stat-chip strong {
  font-size: 1.15rem;
}

.game-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
}

.control-card,
.board-card {
  padding: 24px;
}

.card-heading {
  margin-bottom: 18px;
}

.difficulty-picker {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.difficulty-button,
.primary-button,
.secondary-button,
.ghost-button {
  border: 0;
  border-radius: 18px;
  padding: 14px 16px;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.difficulty-button {
  text-align: left;
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
  border: 1px solid transparent;
}

.difficulty-button:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.difficulty-button.is-active {
  background: linear-gradient(135deg, #ff9b3d, #f06c00);
  color: #fff7ef;
  box-shadow: 0 14px 26px rgba(214, 106, 11, 0.24);
}

.action-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.primary-button {
  background: linear-gradient(135deg, #ff952d, #e86800);
  color: #fff9f2;
  box-shadow: 0 16px 28px rgba(215, 98, 5, 0.25);
}

.secondary-button {
  background: #fff2e2;
  color: var(--accent-dark);
  border: 1px solid rgba(203, 93, 8, 0.16);
}

.ghost-button {
  background: transparent;
  color: var(--text);
  border: 1px dashed rgba(185, 94, 22, 0.4);
}

.tips-card {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 244, 231, 0.88), rgba(255, 235, 211, 0.7));
}

.tips-card h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.tips-card p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.5;
}

.tips-card p:last-child {
  margin-bottom: 0;
}

.board-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 20px;
}

.board-message {
  max-width: 30ch;
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.sudoku-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 0;
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 10px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 245, 234, 0.96), rgba(255, 230, 204, 0.92));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.cell {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  text-align: center;
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 700;
  outline: none;
}

.cell:focus {
  position: relative;
  z-index: 2;
  background: #fff7ef;
  box-shadow: inset 0 0 0 2px rgba(240, 125, 30, 0.78);
}

.cell.is-fixed {
  background: rgba(255, 216, 177, 0.72);
  color: #7d3800;
}

.cell.is-related {
  background: rgba(255, 235, 214, 0.95);
}

.cell.is-error {
  background: rgba(255, 126, 80, 0.2);
  color: var(--error);
}

.board-message.is-error {
  color: var(--error);
  font-weight: 700;
}

.board-message.is-success {
  color: var(--success);
  font-weight: 700;
}

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

.cell.border-bottom {
  border-bottom: 3px solid var(--line-strong);
}

.cell.top-edge {
  border-top: 3px solid var(--line-strong);
}

.cell.left-edge {
  border-left: 3px solid var(--line-strong);
}

.cell.right-edge {
  border-right: 3px solid var(--line-strong);
}

.cell.bottom-edge {
  border-bottom: 3px solid var(--line-strong);
}

.board-card.is-solved .sudoku-board {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.65),
    0 0 0 3px rgba(47, 143, 91, 0.16);
}

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

  .hero-visual {
    order: 3;
  }

  .board-header {
    flex-direction: column;
    align-items: start;
  }

  .board-message {
    text-align: left;
  }
}

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

  .language-toolbar {
    justify-content: stretch;
  }

  .language-picker,
  .language-picker-control {
    width: 100%;
  }

  .hero-card,
  .control-card,
  .board-card,
  .ad-banner {
    border-radius: 24px;
    padding: 20px;
  }

  .promo-banner {
    padding: 8px;
  }

  .sudoku-board {
    padding: 6px;
    border-radius: 20px;
  }

  .ad-banner-label-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .ad-slot {
    justify-content: flex-start;
    padding: 10px 8px;
  }
}
