:root {
  color-scheme: dark;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: #0b0d10;
  color: #e9eef5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top right, #17253a 0, transparent 38rem), #0b0d10;
}

main {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 4rem 0 6rem;
}

header { max-width: 760px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 1rem; font-size: clamp(2.2rem, 7vw, 4.5rem); letter-spacing: -.06em; }
h2 { margin-bottom: .5rem; }
.eyebrow { margin-bottom: .65rem; color: #6ee7b7; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; }
.lede { color: #a8b3c2; font: 1rem/1.65 system-ui, sans-serif; }

form, #results {
  margin-top: 2rem;
  padding: 1.4rem;
  border: 1px solid #263140;
  border-radius: 14px;
  background: rgb(16 20 26 / 88%);
}

label { display: block; margin-bottom: .6rem; color: #c7d2df; font-size: .85rem; }
.search-row { display: flex; gap: .7rem; }
input, button { min-height: 46px; border-radius: 8px; font: inherit; }
input { min-width: 0; flex: 1; padding: .75rem .9rem; border: 1px solid #364456; background: #090b0e; color: inherit; }
input:focus { outline: 2px solid #6ee7b7; outline-offset: 2px; }
button { padding: .75rem 1rem; border: 0; background: #6ee7b7; color: #07120e; font-weight: 700; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
.request-status { margin: .8rem 0 0; color: #8e9aaa; font: .88rem/1.5 system-ui, sans-serif; }
.request-status.error { color: #fda4af; }

.summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.badge { padding: .45rem .65rem; border-radius: 999px; background: #273241; color: #c7d2df; font-size: .75rem; text-transform: uppercase; }
.badge.valid { background: #123b2d; color: #86efac; }
.badge.invalid { background: #4c1720; color: #fda4af; }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .65rem; margin: 1.2rem 0 2rem; }
.checks div { padding: .85rem; border: 1px solid #263140; border-radius: 8px; }
.checks span { display: block; min-height: 2.3em; color: #8e9aaa; font: .78rem/1.35 system-ui, sans-serif; }
.checks strong { display: block; margin-top: .6rem; font-size: .82rem; }
.check-valid { color: #86efac; }
.check-invalid { color: #fda4af; }
.check-neutral { color: #fcd34d; }

.details { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; border: 1px solid #263140; border-radius: 8px; overflow: hidden; }
.details div { min-width: 0; padding: .85rem; border-bottom: 1px solid #263140; }
.details div:nth-child(odd) { border-right: 1px solid #263140; }
.details div:nth-last-child(-n + 2) { border-bottom: 0; }
dt { margin-bottom: .4rem; color: #8e9aaa; font: .76rem system-ui, sans-serif; }
dd { margin: 0; overflow-wrap: anywhere; line-height: 1.45; }

.mines-board { margin-top: 2rem; }
.board-note { color: #8e9aaa; font: .88rem/1.5 system-ui, sans-serif; }
.mines-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 3.4rem)); gap: .4rem; margin: 1rem 0 .8rem; }
.tile { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border: 1px solid #263140; border-radius: 8px; background: #10151c; color: #c7d2df; font-size: .95rem; font-weight: 700; }
.tile.pick { border-color: #1f6b50; background: #123b2d; color: #86efac; }
.tile.mine { border-color: #5b2330; background: #2a1219; color: #fda4af; }
.tile.mine.pick, .tile.losing { border-color: #fda4af; background: #4c1720; color: #fff1f2; box-shadow: 0 0 0 2px #fb7185; }
.board-summary { margin: 0 0 .8rem; color: #c7d2df; font-size: .85rem; }
.board-legend { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; margin: 0; padding: 0; list-style: none; color: #8e9aaa; font: .8rem system-ui, sans-serif; }
.board-legend li { display: flex; align-items: center; gap: .45rem; }
.tile-sample { width: 1.6rem; font-size: .75rem; }

@media (max-width: 720px) {
  main { padding-top: 2.5rem; }
  .search-row { flex-direction: column; }
  .checks { grid-template-columns: 1fr 1fr; }
  .details { grid-template-columns: 1fr; }
  .details div, .details div:nth-child(odd), .details div:nth-last-child(2) { border-right: 0; border-bottom: 1px solid #263140; }
  .details div:last-child { border-bottom: 0; }
}
