:root {
  --bg1: #070a17;
  --bg2: #140a2d;
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.68);
  --line: rgba(255,255,255,0.16);

  --g: #22c55e;
  --y: #f59e0b;
  --b: #64748b;

  --accentA: #7c3aed;
  --accentB: #22c55e;
  --accentC: #06b6d4;
  --accentD: #f97316;

  --shadow: 0 22px 90px rgba(0,0,0,0.55);
  --r1: 18px;
  --r2: 26px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1100px 750px at 10% 10%, rgba(124,58,237,0.22), transparent 60%),
    radial-gradient(900px 700px at 95% 20%, rgba(34,197,94,0.18), transparent 60%),
    radial-gradient(900px 700px at 75% 95%, rgba(6,182,212,0.18), transparent 60%),
    linear-gradient(160deg, var(--bg1), var(--bg2));
}

.bg {
  position: fixed;
  inset: -40vh -30vw;
  pointer-events: none;
  background:
    conic-gradient(from 210deg, rgba(6,182,212,0.10), rgba(124,58,237,0.10), rgba(34,197,94,0.10), rgba(249,115,22,0.10));
  filter: blur(30px);
  opacity: 0.85;
  transform: rotate(-6deg);
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 30px;
  display: grid;
  gap: 14px;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(135deg, rgba(34,197,94,0.18), rgba(124,58,237,0.20));
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

h1 { margin: 0; font-size: 28px; line-height: 1.1; }
.subtitle { margin: 6px 0 0; color: var(--muted); }

.status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill {
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  font-size: 13px;
  color: rgba(255,255,255,0.86);
}

.iconBtn {
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  border-radius: 12px;
  width: 44px;
  height: 40px;
  cursor: pointer;
}

.card {
  border-radius: var(--r2);
  background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.05));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.topRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.stats {
  font-size: 13px;
  color: rgba(255,255,255,0.80);
}

.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
}

.btnPrimary {
  background: linear-gradient(135deg, rgba(34,197,94,0.16), rgba(124,58,237,0.16));
}

.btnGhost { background: transparent; }

.board {
  display: grid;
  gap: 8px;
  justify-content: center;
}

.row {
  display: grid;
  grid-template-columns: repeat(5, 56px);
  gap: 8px;
}

.cell {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.18);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 24px;
  text-transform: uppercase;
  user-select: none;
}

.cell.g { background: rgba(34,197,94,0.24); border-color: rgba(34,197,94,0.35); }
.cell.y { background: rgba(245,158,11,0.24); border-color: rgba(245,158,11,0.35); }
.cell.b { background: rgba(100,116,139,0.24); border-color: rgba(100,116,139,0.35); }

.keyboard {
  display: grid;
  gap: 8px;
  justify-content: center;
}

.krow {
  display: grid;
  grid-template-columns: repeat(10, minmax(28px, 1fr));
  gap: 8px;
  max-width: 620px;
}

.krow:nth-child(2) { grid-template-columns: repeat(9, minmax(28px, 1fr)); max-width: 560px; }
.krow:nth-child(3) { grid-template-columns: 1.6fr repeat(7, minmax(28px, 1fr)) 1.6fr; max-width: 620px; }

.key {
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  border-radius: 14px;
  padding: 12px 8px;
  cursor: pointer;
  font-weight: 900;
  text-transform: uppercase;
  user-select: none;
}

.key.g { background: rgba(34,197,94,0.22); }
.key.y { background: rgba(245,158,11,0.22); }
.key.b { background: rgba(100,116,139,0.22); }

.hint { color: var(--muted); font-size: 12px; text-align: center; }

.bottomRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}
.bottomRow .hint {
  flex: 1;
  text-align: center;
  margin-left: 80px;
}
.showAnswer {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  border-bottom: 1px dotted rgba(255,255,255,0.25);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.showAnswer:hover {
  color: rgba(255,255,255,0.85);
  border-bottom-color: rgba(255,255,255,0.55);
}
@media (max-width: 520px) {
  .bottomRow { flex-direction: column; gap: 6px; }
  .bottomRow .hint { margin-left: 0; }
  .promo { flex-direction: column; align-items: stretch; text-align: center; }
  .promoImg { align-self: center; }
}

.promo {
  margin-top: 18px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(124,92,255,0.14), rgba(86,193,255,0.06));
  border: 1px solid rgba(154, 208, 255, 0.18);
  border-left: 2px solid rgba(124,92,255,0.7);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.30);
  display: flex;
  align-items: center;
  gap: 16px;
}
.promoImg {
  flex: 0 0 auto;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.25);
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
}
.promoImg img {
  display: block;
  height: 80px;
  width: auto;
  max-width: 180px;
}
.promoText { flex: 1 1 auto; min-width: 0; }
.promoTitle {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #56c1ff, #7c5cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 4px;
}
.promoBody {
  margin: 0;
  font-size: 13px;
  color: rgba(255,255,255,0.78);
  line-height: 1.55;
}
.promoBody a {
  color: rgba(154, 208, 255, 0.95);
  border-bottom: 1px dotted rgba(154, 208, 255, 0.4);
  text-decoration: none;
  font-weight: 600;
}
.promoBody a:hover {
  border-bottom-color: rgba(154, 208, 255, 0.85);
}

.footer { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: rgba(255,255,255,0.62); font-size: 12px; }
.footer a { color: rgba(255,255,255,0.75); text-decoration: none; border-bottom: 1px dotted rgba(255,255,255,0.35); }
.sep { opacity: 0.55; }

.footLink { color: rgba(154, 208, 255, 0.92); text-decoration: none; border-bottom: 1px dotted rgba(154, 208, 255, 0.35); }
.footLink:hover { border-bottom-color: rgba(154, 208, 255, 0.70); }

.modal {
  border: none;
  padding: 0;
  border-radius: 18px;
  width: min(720px, calc(100% - 24px));
  background: rgba(15, 18, 34, 0.92);
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0,0,0,0.65);
  border: 1px solid rgba(255,255,255,0.16);
}

.modal::backdrop { background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); }

.modalInner { padding: 18px; }

.modalHeader { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modalHeader h2 { margin: 0; font-size: 18px; }

.modalActions { display: flex; justify-content: flex-end; margin-top: 12px; }

.chip { display: inline-flex; align-items: center; justify-content: center; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.18); font-size: 12px; }
.chipG { background: rgba(34,197,94,0.22); }
.chipY { background: rgba(245,158,11,0.22); }
.chipB { background: rgba(100,116,139,0.22); }

.muted { color: var(--muted); }
