:root {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: #202b35;
  background: #f4f7f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
.app { width: min(100% - 32px, 760px); margin: 0 auto; padding: 64px 0 32px; }
.intro { margin: 0 auto 32px; max-width: 620px; text-align: center; }
.eyebrow { color: #287c9f; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 12px 0; font: 800 clamp(32px, 6vw, 48px)/1.1 system-ui, sans-serif; letter-spacing: -.04em; }
.description { max-width: 560px; margin: 0 auto; color: #61717d; line-height: 1.65; }
.solver-card { padding: 28px; border: 1px solid #e4ebee; border-radius: 18px; background: #fff; box-shadow: 0 16px 48px #2337430c; }
label { display: block; margin-bottom: 9px; font-weight: 700; }
.form-row { display: flex; gap: 10px; }
input, button { min-height: 48px; border-radius: 10px; font: inherit; }
input { width: 116px; padding: 0 14px; border: 1px solid #cbd7dd; color: #202b35; font-size: 18px; }
button { padding: 0 20px; border: 0; background: #176b8d; color: white; font-weight: 700; cursor: pointer; transition: background .15s; }
button:hover { background: #105774; }
button:disabled { cursor: wait; opacity: .65; }
.hint { margin: 7px 0 0; color: #85939b; font-size: 13px; }
.status { min-height: 24px; margin: 22px 0 12px; color: #687984; font-size: 14px; }
.status.success { color: #247a57; }
.status.error { color: #bd3f43; }
.board-wrap { display: grid; justify-items: center; gap: 12px; }
.board { display: grid; grid-template-columns: repeat(var(--size), minmax(0, 1fr)); grid-template-rows: repeat(var(--size), minmax(0, 1fr)); width: min(100%, 510px); aspect-ratio: 1; overflow: hidden; border: 5px solid #243a47; border-radius: 8px; box-shadow: 0 10px 24px #243a4720; }
.square { display: grid; place-items: center; min-width: 0; min-height: 0; aspect-ratio: 1; container-type: inline-size; }
.square.light { background: #fff; }
.square.blue { background: #b9dfeb; }
.queen { color: #111820; font-family: Georgia, serif; font-size: 75cqi; line-height: 1; text-shadow: 0 1px 0 #fff8; }
.result { margin: 0; color: #243a47; font: 700 18px system-ui, sans-serif; }
footer { margin-top: 24px; color: #85939b; text-align: center; font-size: 13px; }

@media (max-width: 520px) {
  .app { padding-top: 40px; }
  .solver-card { padding: 20px; }
  .form-row { flex-direction: column; }
  input { width: 100%; }
}

@media (min-width: 1000px) and (min-height: 600px) {
  .app { padding: 14px 0 12px; }
  .intro { margin-bottom: 10px; }
  .eyebrow { margin: 0; }
  h1 { margin: 6px 0; font-size: clamp(28px, 3vw, 40px); }
  .description { line-height: 1.4; }
  .solver-card { padding: 18px; }
  .status { margin: 8px 0 6px; }
  .board-wrap { gap: 8px; }
  .board { width: min(100%, 38vh, 470px); }
  footer { margin-top: 10px; }
}
