:root{
  --bg:#0b0d12;
  --card:#121622;
  --card2:#0f131d;
  --text:#ffffff;
  --muted:#aab2c0;
  --red:#ff3b3b;
  --border:rgba(255,255,255,.12);
  --shadow: 0 10px 30px rgba(0,0,0,.35);

  /* sizes */
  --base:16px;
  --sub:20px;
  --title:24px;

  /* inputs */
  --input-h:48px;
  --input-w:360px;
  --input-pad:14px 16px;
  --gap:24px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:"Work Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size:var(--base);
  background: radial-gradient(1200px 800px at 20% 10%, rgba(255,59,59,.12), transparent 60%),
              radial-gradient(1200px 800px at 80% 80%, rgba(255,255,255,.06), transparent 55%),
              var(--bg);
  color:var(--text);
}

h1{ font-size:var(--title); margin:0; }
h2{ font-size:var(--title); margin:0 0 12px; }
h3{ font-size:var(--sub); margin:0 0 12px; }
p{ margin:8px 0; }

.muted{ color:var(--muted); }
.small{ font-size:13px; }

.app{
  max-width:1200px;
  margin:0 auto;
  padding:24px;
  display:flex;
  flex-direction:column;
  gap:16px;
}

.topbar{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:16px;
  padding:16px 18px;
  border:1px solid var(--border);
  border-radius:16px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  box-shadow: var(--shadow);
}

.card{
  border:1px solid var(--border);
  border-radius:16px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  box-shadow: var(--shadow);
  padding:18px;
}

.view{ display:none; }
.view.active{ display:block; }

.divider{
  height:1px;
  background:var(--border);
  margin:16px 0;
}

.row{
  display:flex;
  gap:var(--gap);
  align-items:center;
  flex-wrap:wrap;
  margin-top:12px;
}

.form, .panel{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
}
@media (max-width: 980px){
  .grid-2{ grid-template-columns:1fr; }
}

label{ color:var(--muted); font-size:14px; }

input, textarea, select{
  height:var(--input-h);
  width:min(var(--input-w), 100%);
  padding:var(--input-pad);
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--card2);
  color:var(--text);
  outline:none;
}

textarea{
  height:auto;
  min-height:180px;
  resize:vertical;
}

select{
  background:#000;
  color:#fff;
}

.btn{
  height:40px;
  padding:12px 24px;
  border-radius:12px;
  border:1px solid var(--border);
  background:transparent;
  color:var(--text);
  cursor:pointer;
  transition:.15s ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  user-select:none;
}
.btn:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,.22); }
.btn:active{ transform: translateY(0px); }

.btn-primary{
  background:rgba(255,59,59,.14);
  border-color:rgba(255,59,59,.35);
}
.btn-primary:hover{ background:rgba(255,59,59,.2); }

.msg{
  margin:6px 0 0;
  min-height:18px;
  font-size:14px;
}
.msg.ok{ color:#6ee7b7; }
.msg.err{ color:#ff6b6b; }

.spacer{ height:10px; }

.game .game-layout{
  display:grid;
  grid-template-columns: 220px 1fr 260px;
  gap:16px;
  align-items:start;
}
@media (max-width: 980px){
  .game .game-layout{
    grid-template-columns: 1fr;
  }
}

.col-left, .col-right{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.info{
  display:flex;
  flex-direction:column;
  gap:8px;
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  background:rgba(255,255,255,.02);
}

.tag{
  display:inline-block;
  padding:2px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  color:var(--muted);
  font-size:12px;
  margin-right:6px;
}

.center-title{
  text-align:center;
  margin-bottom:12px;
}

.grid{
  display:grid;
  gap:4px;
  justify-content:center;
  align-content:start;
  padding:12px;
  border-radius:16px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.25);
}

.cell{
  width:32px;
  height:32px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:600;
  user-select:none;
  cursor:crosshair;
  position:relative;
}
.cell:hover{ border-color: rgba(255,59,59,.25); }

.cell.selected{
  outline: 2px solid rgba(255,59,59,.65);
  background: rgba(255,59,59,.18);
}

.cell.found{
  background: rgba(110,231,183,.18);
  border-color: rgba(110,231,183,.4);
}

.word-list{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.word-item{
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background: rgba(255,255,255,.02);
  display:flex;
  justify-content:space-between;
  gap:12px;
}
.word-item.done{
  opacity:.6;
  text-decoration:line-through;
}
.word-item .badge{
  border:1px solid rgba(255,59,59,.35);
  color: var(--red);
  padding:2px 10px;
  border-radius:999px;
  font-size:12px;
}

.status{
  border:1px dashed rgba(255,255,255,.18);
  border-radius:12px;
  padding:10px 12px;
}

.modal{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.90);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
}
.modal.hidden{ display:none; }

.modal-content{
  width:min(520px, 100%);
  border-radius:16px;
  border:1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  padding:18px;
  box-shadow: var(--shadow);
}

.footer{
  text-align:center;
  padding:8px 0;
}
