/* Sudoku Whale — 2026 redesign. Light theme, indigo-violet accent, Outfit display font. */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font-display: "Outfit", "Inter", -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --accent-soft: #eef0ff;

  --bg: #f7f7fb;
  --surface: #ffffff;
  --border: #e4e6f0;
  --text: #171c2e;
  --text-soft: #5d6478;

  --error: #e11d48;
  --hint: #059669;
  --ink: #1e2438;   /* board frame */

  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(23, 28, 46, .06), 0 1px 6px rgba(23, 28, 46, .05);
  --shadow-md: 0 4px 14px rgba(23, 28, 46, .08), 0 2px 4px rgba(23, 28, 46, .04);
  --shadow-lg: 0 12px 40px rgba(52, 46, 130, .14), 0 4px 12px rgba(23, 28, 46, .06);
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(900px 380px at 15% -80px, rgba(124, 58, 237, .08), transparent 60%),
    radial-gradient(900px 380px at 85% -80px, rgba(79, 70, 229, .09), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 880px; margin: 0 auto; padding: 0 18px; }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; gap: 12px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.22rem; letter-spacing: -.01em;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--accent);
  white-space: nowrap;
}
.logo .dot { -webkit-text-fill-color: var(--accent-2); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a {
  color: var(--text-soft); font-size: .9rem; font-weight: 500;
  padding: 7px 11px; border-radius: 999px; white-space: nowrap;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* ---- footer ---- */
.site-footer {
  margin-top: 56px; padding: 28px 0;
  background: var(--ink); color: #aab1c5; font-size: .87rem;
}
.site-footer a { color: #c9cfe2; }
.site-footer a:hover { color: #fff; }
.site-footer .container {
  display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }

/* ---- content ---- */
main { padding: 32px 0 44px; }
h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4.4vw, 2.5rem);
  font-weight: 800; letter-spacing: -.02em; line-height: 1.18;
  margin-bottom: 14px;
}
h2 {
  font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 700; letter-spacing: -.01em;
  margin: 40px 0 14px; position: relative; padding-left: 14px;
}
h2::before {
  content: ""; position: absolute; left: 0; top: .28em; bottom: .28em;
  width: 4px; border-radius: 2px; background: var(--accent-grad);
}
h3 { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; margin: 26px 0 8px; }
p, ul, ol { margin-bottom: 14px; }
ul, ol { padding-left: 22px; }
li { margin-bottom: 7px; }
.lead { font-size: 1.08rem; color: var(--text-soft); margin-bottom: 22px; max-width: 46rem; }

.hero {
  background: linear-gradient(180deg, rgba(79, 70, 229, .05), rgba(124, 58, 237, .03));
  border: 1px solid var(--border); border-radius: 20px;
  padding: clamp(22px, 4vw, 40px) clamp(20px, 4vw, 44px);
  margin: 0 0 26px;
}
.hero h1 { margin-bottom: 10px; }
.hero .lead { margin-bottom: 0; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; margin: 18px 0;
  box-shadow: var(--shadow-sm);
}
.cards-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 16px; margin: 20px 0;
}
.cards-grid .card { margin: 0; transition: transform .18s ease, box-shadow .18s ease; }
.cards-grid .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.cards-grid h3 { margin-top: 0; }
.cards-grid .card p { color: var(--text-soft); font-size: .93rem; margin-bottom: 10px; }

.btn {
  display: inline-block; background: var(--accent-grad); color: #fff; border: none;
  padding: 11px 22px; border-radius: 999px; font-size: .95rem; font-weight: 600;
  cursor: pointer; font-family: inherit; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); text-decoration: none; }
.btn.outline { background: #fff; color: var(--accent); border: 1.5px solid var(--accent); box-shadow: none; }

table.shortcut { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .92rem; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
table.shortcut th, table.shortcut td { border-bottom: 1px solid var(--border); padding: 9px 14px; text-align: left; }
table.shortcut tr:last-child td { border-bottom: none; }
table.shortcut th { background: var(--accent-soft); font-weight: 600; }
code, kbd {
  background: #eef0f7; border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 6px; padding: 1px 7px;
  font-family: Consolas, monospace; font-size: .86em;
}

/* ---- game panel ---- */
.game-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 18px;
  max-width: 530px; margin: 24px auto;
  box-shadow: var(--shadow-lg);
}
.game-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; gap: 8px; flex-wrap: wrap;
}
.diff-tabs { display: flex; gap: 5px; background: #eef0f7; border-radius: 999px; padding: 3px; }
.diff-tabs a {
  font-size: .84rem; font-weight: 600; padding: 5px 14px; border-radius: 999px;
  color: var(--text-soft); transition: color .15s, background .15s;
}
.diff-tabs a:hover { color: var(--accent); text-decoration: none; }
.diff-tabs a[aria-current="page"] { background: var(--accent-grad); color: #fff; box-shadow: var(--shadow-sm); }
.game-stats { display: flex; gap: 14px; font-size: .87rem; color: var(--text-soft); }
.game-stats strong { color: var(--text); font-variant-numeric: tabular-nums; }

.board {
  display: grid; grid-template-columns: repeat(9, 1fr);
  width: 100%; aspect-ratio: 1 / 1;
  border: 3px solid var(--ink); border-radius: 12px; overflow: hidden;
  background: #fff; user-select: none; touch-action: manipulation;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0);
}
.board.dim { opacity: .4; }
.cell {
  position: relative; display: flex; align-items: center; justify-content: center;
  border-right: 1px solid #e2e5ef; border-bottom: 1px solid #e2e5ef;
  font-size: clamp(16px, 4.6vw, 25px); font-weight: 500; cursor: pointer;
  color: var(--accent); font-variant-numeric: tabular-nums;
  transition: background .1s ease;
}
.cell:nth-child(9n) { border-right: none; }
.cell:nth-last-child(-n+9) { border-bottom: none; }
.cell.br { border-right: 2px solid var(--ink); }
.cell.bb { border-bottom: 2px solid var(--ink); }
.cell.given { color: var(--text); font-weight: 700; }
.cell.hinted { color: var(--hint); font-weight: 700; }
.cell.user { color: var(--accent); }
.cell.error { color: var(--error); background: #fff1f3; }
.cell.peer { background: #f1f2fb; }
.cell.same { background: #dfe3fc; }
.cell.selected {
  background: #d8dcff;
  outline: 2.5px solid var(--accent); outline-offset: -2.5px; z-index: 1;
  border-radius: 3px;
}
.cell .notes {
  position: absolute; inset: 1px;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  pointer-events: none;
}
.cell .notes span {
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(7px, 1.7vw, 10px); font-weight: 500; color: var(--text-soft);
  line-height: 1;
}

.controls { margin-top: 16px; }
.numpad { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; }
.num-btn {
  aspect-ratio: 1 / 1.18; border: 1px solid var(--border); background: #fff;
  border-radius: 10px; cursor: pointer; font-family: inherit; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.num-btn:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-md); }
.num-btn .num {
  font-size: clamp(15px, 3.8vw, 20px); font-weight: 700;
  font-family: var(--font-display); color: var(--text);
}
.num-btn .left { font-size: 10px; color: var(--text-soft); line-height: 1.3; }
.num-btn.done { opacity: .3; }

.tools { display: flex; gap: 7px; margin-top: 12px; flex-wrap: wrap; }
.tools button {
  flex: 1 1 62px; padding: 10px 4px; font-size: .8rem; font-weight: 600;
  border: 1px solid var(--border); background: #fff; border-radius: 999px;
  cursor: pointer; color: var(--text); font-family: inherit; white-space: nowrap;
  transition: border-color .12s, color .12s, background .12s, transform .12s;
}
.tools button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.tools button:disabled { opacity: .35; cursor: default; }
.tools button.active {
  background: var(--accent-grad); border-color: transparent; color: #fff;
  box-shadow: var(--shadow-sm);
}

.game-message {
  text-align: center; font-size: .9rem; color: var(--text-soft);
  min-height: 1.4em; margin-top: 12px;
}

.daily-label { font-size: .9rem; color: var(--text-soft); }
.daily-label strong {
  font-family: var(--font-display); color: var(--text);
  margin-right: 10px; font-weight: 700;
}
.daily-countdown {
  text-align: center; font-size: .84rem; color: var(--text-soft);
  margin-top: 4px; font-variant-numeric: tabular-nums;
}

.soft-note { color: var(--text-soft); font-size: .88em; font-style: italic; }

/* ---- win overlay ---- */
.win-overlay {
  position: fixed; inset: 0; background: rgba(23, 28, 46, .55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 50;
  padding: 16px;
}
.win-overlay.hidden { display: none; }
.win-card {
  background: #fff; border-radius: 24px; padding: 36px 40px; text-align: center;
  max-width: 350px; width: 100%; box-shadow: var(--shadow-lg);
  animation: pop .3s cubic-bezier(.2, 1.4, .4, 1);
}
.win-card h2 {
  font-family: var(--font-display); font-size: 1.6rem;
  margin: 0 0 8px; padding: 0; background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.win-card h2::before { display: none; }
.win-stats { color: var(--text-soft); margin-bottom: 22px; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---- FAQ ---- */
details {
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  padding: 13px 18px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
details summary { font-weight: 600; cursor: pointer; }
details[open] summary { color: var(--accent); }
details p { margin: 10px 0 0; color: var(--text-soft); }

@media (max-width: 480px) {
  .game-panel { padding: 12px; border-radius: 16px; }
  .hero { border-radius: 16px; }
  .nav a { padding: 6px 8px; font-size: .84rem; }
  .site-header .container { height: 54px; }
}
