:root { --bg:#020617; --card:#0b1220; --text:#e5e7eb; --acc:#22d3ee; --mut:#94a3b8; }
*{ box-sizing:border-box; font-family:system-ui; }
body{ margin:0; background:var(--bg); color:var(--text); }
.wrap{ max-width:1100px; margin:0 auto; padding:18px; }
.card{ background:var(--card); border-radius:14px; padding:14px; margin:12px 0; border:1px solid rgba(148,163,184,.14); }
.grid2{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media(max-width:860px){ .grid2{ grid-template-columns:1fr; } }
button, input, select{ width:100%; padding:12px; border-radius:12px; border:1px solid #1f2a44; background:#081023; color:var(--text); }
button:hover{ border-color:var(--acc); cursor:pointer; }
.primary{ background:rgba(34,211,238,.12); border-color:rgba(34,211,238,.35); }
.row{ display:flex; justify-content:space-between; padding:8px 0; border-bottom:1px solid rgba(148,163,184,.12); gap:10px; }
.row:last-child{ border-bottom:none; }
.mono{ font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.board{ width:100%; border-collapse:separate; border-spacing:8px; }
.board th, .board td{ background:#081023; border:1px solid #1f2a44; padding:12px; border-radius:12px; text-align:center; }
.board td.cell{ cursor:pointer; }
.board td.cat{ text-align:left; background:#060c1a; }
.hint{ color:var(--mut); margin:10px 0 0; }
.scorebar{ display:flex; gap:12px; flex-wrap:wrap; }
.scorebar .row{ border:none; padding:0; min-width:180px; }
.topline{ display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.timer{ min-width:120px; text-align:center; }
.answers{ display:grid; gap:10px; margin-top:12px; }
.check{ display:flex; gap:10px; align-items:center; margin-bottom:10px; }

.answer-feedback {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    padding: 20px 30px;
    border-radius: 14px;
    font-size: 1.4rem;
    font-weight: bold;
    z-index: 9999;
    animation: popIn 0.3s ease;
}

.answer-feedback.correct {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    box-shadow: 0 0 20px #10b981;
}

.answer-feedback.wrong {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    box-shadow: 0 0 20px #ef4444;
}

.hidden {
    display: none;
}

@keyframes popIn {
    from { transform: translateX(-50%) scale(0.8); opacity: 0; }
    to   { transform: translateX(-50%) scale(1); opacity: 1; }
}

.cell.used{
  opacity:.35;
  filter: grayscale(0.6);
  pointer-events:none;
  cursor:not-allowed;
  text-decoration: line-through;
}

.turn-banner{
  position: sticky;
  top: 0;
  z-index: 50;
  margin: 10px 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.turn-title{ font-size: 16px; font-weight: 800; letter-spacing: .3px; }
.turn-sub{ margin-top: 4px; font-size: 13px; opacity: .9; }

.turn-you{ background: rgba(60, 255, 180, .10); }
.turn-wait{ background: rgba(140, 160, 255, .10); }
.turn-error{ background: rgba(255, 80, 80, .10); }

.board-disabled{
  pointer-events: none;
  opacity: .55;
  filter: grayscale(.15);
}

.gameover.hidden{ display:none; }
.gameover{
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.gameover-card{
  width: min(520px, 92vw);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(15,15,22,.92);
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  padding: 18px;
  text-align: center;
}
.gameover-title{ font-size: 22px; font-weight: 900; margin-bottom: 6px; }
.gameover-sub{ font-size: 14px; opacity: .9; margin-bottom: 14px; }
.gameover-btn{
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}
