:root {
  --bg-top: #eef8ff;
  --bg-bottom: #fff5df;
  --panel: rgba(255, 255, 255, 0.86);
  --text-main: #4f5868;
  --text-soft: #788396;
  --pink: #ff7ca8;
  --pink-deep: #f05286;
  --blue: #80c9ff;
  --green: #8edfa7;
  --yellow: #ffd96d;
  --line: rgba(118, 141, 168, 0.34);
  --line-strong: rgba(79, 88, 104, 0.72);
  --shadow: 0 26px 48px rgba(89, 136, 174, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    linear-gradient(135deg, rgba(128, 201, 255, 0.18), transparent 34%),
    linear-gradient(225deg, rgba(255, 217, 109, 0.24), transparent 30%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

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

.page-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.page-nav a,
.page-footer a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
}

.page-nav a {
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid rgba(174, 214, 241, 0.8);
  box-shadow: 0 10px 18px rgba(89, 136, 174, 0.1);
}

.hero-card,
.game-panel {
  background: var(--panel);
  backdrop-filter: blur(15px);
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 26px 28px;
  margin-bottom: 18px;
}

.eyebrow,
.mini-label,
.info-label {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1;
}

.subtitle {
  margin-top: 12px;
  max-width: 560px;
  line-height: 1.55;
  color: var(--text-soft);
}

.hero-icons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hero-icons span {
  display: inline-grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 22px;
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.75);
}

.game-panel {
  padding: 22px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.stats-grid,
.action-row,
.tool-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-pill {
  min-width: 118px;
  padding: 13px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 249, 255, 0.95));
  border: 2px solid rgba(181, 222, 248, 0.86);
}

.label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.stat-pill strong {
  font-size: 1.25rem;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}

button:hover {
  transform: translateY(-2px);
}

button:active {
  transform: scale(0.97);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 16px;
  font-weight: 700;
}

.primary-button {
  color: #fff;
  background: linear-gradient(180deg, var(--pink), var(--pink-deep));
  box-shadow: 0 14px 22px rgba(240, 82, 134, 0.2);
}

.secondary-button {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid rgba(181, 222, 248, 0.82);
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.board-card,
.side-panel,
.info-card {
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(247, 253, 255, 0.82));
  border: 2px solid rgba(181, 222, 248, 0.8);
}

.board-card {
  display: grid;
  place-items: center;
  padding: 18px;
}

.sudoku-board {
  width: min(100%, 560px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  border: 3px solid var(--line-strong);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 22px 34px rgba(89, 136, 174, 0.15);
}

.sudoku-cell {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-main);
  font-size: clamp(1.05rem, 4vw, 2rem);
  font-weight: 800;
}

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

.sudoku-cell:nth-child(n + 19):nth-child(-n + 27),
.sudoku-cell:nth-child(n + 46):nth-child(-n + 54) {
  border-bottom-color: var(--line-strong);
  border-bottom-width: 2px;
}

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

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

.sudoku-cell.given {
  color: #39566e;
  background: rgba(226, 246, 255, 0.92);
}

.sudoku-cell.selected {
  background: rgba(255, 217, 109, 0.42);
}

.sudoku-cell.related {
  background: rgba(142, 223, 167, 0.18);
}

.sudoku-cell.wrong {
  color: #d94c76;
  background: rgba(255, 124, 168, 0.18);
}

.sudoku-cell.completed {
  color: #297f55;
}

.side-panel {
  padding: 18px;
}

.level-card {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid rgba(255, 225, 141, 0.76);
  margin-bottom: 14px;
}

.level-card h2 {
  margin-bottom: 10px;
}

.level-card p,
.status-message,
.info-card p,
.info-card li {
  color: var(--text-soft);
  line-height: 1.6;
}

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

.number-pad button {
  aspect-ratio: 1;
  border-radius: 18px;
  color: var(--text-main);
  font-size: 1.35rem;
  font-weight: 800;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 249, 255, 0.96));
  border: 2px solid rgba(181, 222, 248, 0.85);
}

.tool-row {
  margin-bottom: 14px;
}

.status-message {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 250, 232, 0.9);
  border: 2px solid rgba(255, 225, 141, 0.78);
}

.status-message.success {
  color: #267c55;
  background: rgba(221, 250, 231, 0.92);
  border-color: rgba(142, 223, 167, 0.86);
}

.status-message.warning {
  color: #b34d70;
  background: rgba(255, 236, 244, 0.9);
  border-color: rgba(255, 170, 201, 0.82);
}

.info-panel {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.info-card {
  padding: 20px;
  box-shadow: var(--shadow);
}

.info-card h2 {
  margin-bottom: 12px;
}

.info-card ul {
  margin: 0;
  padding-left: 20px;
}

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

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 2px 4px 0;
  color: var(--text-soft);
}

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

  .side-panel {
    order: -1;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 18px, 100%);
    padding: 18px 0 28px;
  }

  .hero-card,
  .game-panel {
    border-radius: 26px;
  }

  .hero-card {
    padding: 22px 20px;
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-icons {
    justify-content: flex-start;
  }

  .game-panel,
  .board-card,
  .side-panel {
    padding: 16px;
  }

  .sudoku-board {
    border-radius: 14px;
  }

  .sudoku-cell {
    font-size: 1.15rem;
  }
}
