* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #0f1220;
  color: #e8eaf2;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
}

h1 { text-align: center; margin: 0 0 24px; letter-spacing: 0.05em; }
h2 { font-size: 1rem; margin: 0 0 8px; color: #9aa3bf; text-align: center; }
h3 { font-size: 0.85rem; margin: 0 0 8px; color: #9aa3bf; text-transform: uppercase; letter-spacing: 0.08em; }

.panel {
  max-width: 420px;
  margin: 40px auto;
  padding: 24px;
  background: #181c30;
  border-radius: 12px;
}

label { display: block; margin-bottom: 8px; font-weight: 600; }
.row { display: flex; gap: 8px; }

input {
  flex: 1;
  padding: 10px 12px;
  font-size: 1.1rem;
  text-transform: uppercase;
  border: 1px solid #343a5c;
  border-radius: 8px;
  background: #0f1220;
  color: inherit;
}

button {
  padding: 10px 18px;
  font-size: 1rem;
  font-weight: 600;
  border: 0;
  border-radius: 8px;
  background: #3d7bff;
  color: #fff;
  cursor: pointer;
}
button:hover { background: #2f66e0; }
button:disabled { background: #343a5c; cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid #00d8ff; outline-offset: 2px; }

.hint { color: #9aa3bf; font-size: 0.9rem; }
.status { min-height: 1.4em; font-weight: 600; }

#game { position: relative; }

.boards {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
}

canvas {
  display: block;
  background: #080a14;
  border: 2px solid #2a3050;
  border-radius: 4px;
}

.info { display: flex; flex-direction: column; gap: 12px; width: 150px; }
.box { background: #181c30; border-radius: 8px; padding: 10px 12px; }
.box canvas { border: 0; margin: 0 auto; }
.stats div { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 2px 0; }
.stats span { color: #9aa3bf; }
.keys p { margin: 0; font-size: 0.8rem; line-height: 1.6; color: #c2c8dc; }

.opp-stats { margin-top: 8px; font-size: 0.85rem; color: #9aa3bf; text-align: center; }

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 20, 0.7);
}
.overlay[hidden] { display: none; }
.overlay-box {
  background: #181c30;
  padding: 24px 32px;
  border-radius: 12px;
  text-align: center;
  min-width: 260px;
}
.big { font-size: 1.8rem; font-weight: 700; margin: 0 0 8px; }

@media (max-width: 700px) {
  .boards { flex-wrap: wrap; }
}
