:root{
  --bg:#0b0f14;
  --card:#151a22;
  --text:#f2f5f7;
  --muted:rgba(242,245,247,.75);
  --accent:#e1b34b;
  --shadow:rgba(0,0,0,.45);
  --radius:20px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:
    radial-gradient(1200px 600px at 30% 10%, rgba(255,255,255,.06), transparent 55%),
    radial-gradient(900px 500px at 70% 30%, rgba(225,179,75,.10), transparent 60%),
    var(--bg);
  color:var(--text);
}

.wrap{
  min-height:100%;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding:56px 20px;
}

.card{
  width:min(1000px, 95vw);
  background:linear-gradient(180deg, rgba(255,255,255,.03), transparent 40%), var(--card);
  border-radius:var(--radius);
  box-shadow:0 20px 60px var(--shadow);
  padding:40px 44px;
}

h1{
  margin:0 0 12px 0;
  font-size:44px;
}

p{
  margin:10px 0;
  color:var(--muted);
  font-size:18px;
  line-height:1.5;
}

.small{ color:var(--text); opacity:.95; }

.row{
  margin-top:14px;
  display:grid;
  grid-template-columns:420px 1fr;
  gap:48px;
  align-items:start;
}

.text{
  color:var(--text);
  opacity:.9;
  font-size:18px;
  line-height:1.5;
  margin-top:52px;
}

.notice{
  margin-top:10px;
  color:var(--muted);
  font-size:16px;
}

.buttons{
  display:flex;
  gap:10px;
  margin-top:10px;
}

button{
  appearance:none;
  border:none;
  border-radius:12px;
  padding:10px 16px;
  font-size:16px;
  font-weight:700;
  cursor:pointer;
}

#resetBtn{
  background:var(--accent);
  color:#121212;
}

#enterBtn{
  background:rgba(225,179,75,.18);
  color:rgba(242,245,247,.75);
  border:1px solid rgba(225,179,75,.25);
}

#enterBtn:disabled{
  opacity:.55;
  cursor:not-allowed;
}

/* Board */
#board{
  display:grid;
  grid-template-columns:repeat(8, 1fr);
  width:360px;
  max-width:90vw;
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 10px 30px rgba(0,0,0,.35);
  user-select:none;
}

.sq{
  width:45px;
  height:45px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.light{ background:#f0d9b5; }
.dark{ background:#b58863; }

.piece{
  font-size:34px;
  line-height:1;
  cursor:grab;
}

.piece:active{ cursor:grabbing; }

.piece.white{
  color:#ffffff;
  text-shadow:0 1px 2px rgba(0,0,0,.35);
}

.piece.black{
  color:#111111;
  text-shadow:0 1px 2px rgba(255,255,255,.25);
}

/* highlights */
.sq.selected{
  outline:3px solid rgba(225,179,75,.9);
  outline-offset:-3px;
}
.sq.hint{
  box-shadow: inset 0 0 0 4px rgba(225,179,75,.35);
}

/* Mobile */
@media (max-width: 900px){
  .card{ padding:28px 22px; }
  h1{ font-size:34px; }
  .row{ grid-template-columns:1fr; gap:24px; }
  #board{ width:320px; }
  .sq{ width:40px; height:40px; }
  .piece{ font-size:30px; }
  .text{ margin-top:0; }
}
