/* ===== Word Guess – Neon Pro ===== */
.gh-wordguess{
  --panel: rgba(16,22,46,.6);
  --stroke: rgba(255,255,255,.08);
  --text: #e8ecff;
  --muted: #a9b7ff;
  --accent: #6c7cff;
  --accent2: #33e0ff;
  --good: #2dd196;
  --mid: #ffd866;
  --bad: #2b345f;
  --radius: 16px;
  --glow: 0 10px 30px rgba(51,224,255,.25);
  --inner: inset 0 0 0 1px rgba(255,255,255,.05);
  --glass: blur(10px) saturate(120%);
  --pad: 12px;
  color: var(--text);
  font-family: system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  position:relative; overflow:hidden;
}

/* aurora background */
.gh-wordguess .wg-aurora{
  position:absolute; inset:-20% -10% -20% -10%; z-index:0; pointer-events:none;
  background:
    radial-gradient(800px 600px at 20% 10%, rgba(108,124,255,.35), transparent 60%),
    radial-gradient(800px 600px at 80% 20%, rgba(51,224,255,.35), transparent 60%),
    radial-gradient(700px 700px at 50% 90%, rgba(255,183,3,.20), transparent 65%),
    linear-gradient(180deg,#070c1b 0%, #060912 100%);
}

/* shell */
.gh-wordguess .wg-shell{
  position:relative; z-index:1; width:min(1100px,100vw);
  margin:32px auto 46px;
  background:var(--panel); backdrop-filter:var(--glass);
  border:1px solid var(--stroke); border-radius:var(--radius);
  box-shadow:var(--glow), var(--inner);
  padding:clamp(12px,2.5vw,18px); box-sizing:border-box;
}

/* header/title + back */
.gh-wordguess .wg-header{ display:grid; grid-template-columns:1fr auto; gap:14px; align-items:center; }
.gh-wordguess .wg-titlebar{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.gh-wordguess .wg-title{
  margin:0; font-size:34px; font-weight:900;
  background:linear-gradient(90deg,var(--accent),var(--accent2));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.gh-wordguess .wg-home{
  display:inline-flex; align-items:center; gap:8px; text-decoration:none; font-weight:900;
  padding:10px 14px; min-height:44px; border-radius:999px; color:#0a0e21;
  background:linear-gradient(90deg,#ffe87c,#7affd9);
  box-shadow:0 10px 28px rgba(122,255,217,.25); border:1px solid rgba(255,255,255,.18);
  white-space:nowrap; transform:translateZ(0);
  transition:transform .12s ease, filter .18s ease, box-shadow .18s ease;
}
.gh-wordguess .wg-home .txt{ display:none; }
.gh-wordguess .wg-home .ico{ width:20px; height:20px; flex:0 0 20px; transition:transform .18s ease; }
@media (hover:hover){
  .gh-wordguess .wg-home:hover{ transform:translateY(-1px); filter:brightness(1.05); box-shadow:0 12px 32px rgba(122,255,217,.34); }
  .gh-wordguess .wg-home:hover .ico{ transform:translateX(3px); }
}
.gh-wordguess .wg-home:focus-visible{
  outline:none;
  box-shadow:0 0 0 2px rgba(255,255,255,.65), 0 0 0 6px rgba(51,224,255,.35), 0 10px 28px rgba(122,255,217,.25);
}
@media (min-width:680px){ .gh-wordguess .wg-home .txt{ display:inline; } }

/* controls */
.gh-wordguess .wg-actions{
  display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; align-items:center;
}
.gh-wordguess .wg-field{ display:flex; flex-direction:column; gap:6px; color:#a9b7ff; font-size:13px; }
.gh-wordguess .select-wrap{ position:relative; }
.gh-wordguess .select-wrap .chev{ position:absolute; right:12px; top:50%; transform:translateY(-50%); font-size:12px; color:#a9b7ff; pointer-events:none; }
.gh-wordguess select{
  appearance:none; width:170px; color-scheme: dark;
  background:rgba(255,255,255,.06); border:1px solid var(--stroke); border-radius:12px;
  color:#fff; padding:10px 34px 10px 12px; outline:none; box-shadow:var(--inner);
}
.gh-wordguess select option{ background-color:#0e1537; color:#fff; }

.gh-wordguess .wg-toggle{ position:relative; display:inline-flex; align-items:center; gap:8px; }
.gh-wordguess .wg-toggle input{ position:absolute; opacity:0; pointer-events:none; }
.gh-wordguess .wg-toggle .knob{
  width:44px; height:26px; border-radius:999px; display:inline-block;
  background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.16); box-shadow:var(--inner); position:relative;
}
.gh-wordguess .wg-toggle .knob::after{
  content:""; position:absolute; left:3px; top:3px; width:18px; height:18px; border-radius:999px;
  background:linear-gradient(180deg, rgba(255,255,255,.15), rgba(0,0,0,.25));
  border:1px solid rgba(255,255,255,.14);
  transition:transform .18s ease;
}
.gh-wordguess .wg-toggle input:checked + .knob::after{ transform:translateX(18px); }
.gh-wordguess .wg-toggle .lbl{ color:#fff; font-weight:900; }

.gh-wordguess .wg-btn{
  background:linear-gradient(90deg,var(--accent),var(--accent2));
  color:#0a0e21; border:none; border-radius:12px; padding:10px 16px; font-weight:900; letter-spacing:.2px; cursor:pointer;
  box-shadow:var(--glow); transition:transform .08s ease, filter .16s ease;
}
.gh-wordguess .wg-btn:hover,.gh-wordguess .wg-btn:focus{ transform:translateY(-1px); filter:brightness(1.06); }
.gh-wordguess .wg-btn.ghost{ background:transparent; color:#fff; border:1px solid rgba(255,255,255,.16); }

.gh-wordguess .wg-sound{
  width:42px; height:42px; border-radius:12px; border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.06); color:#fff; cursor:pointer; outline:none;
  display:grid; place-items:center; box-shadow:var(--inner); transition:filter .16s, transform .08s;
}
.gh-wordguess .wg-sound:hover{ transform:translateY(-1px); filter:brightness(1.1); }
.gh-wordguess .wg-sound .ico{ width:22px; height:22px; display:block; }
.gh-wordguess .wg-sound .off{ display:none; }
.gh-wordguess .wg-sound.is-muted{ color:#d2dae9; border-color:rgba(255,255,255,.12); }
.gh-wordguess .wg-sound.is-muted .on{ display:none; }
.gh-wordguess .wg-sound.is-muted .off{ display:block; }

/* stage & board */
.gh-wordguess .wg-stage{ position:relative; border-radius:var(--radius); padding:14px 10px; }
.gh-wordguess .wg-board{
  width:min(540px,100%); aspect-ratio:1/1; margin:10px auto 12px; position:relative;
  display:grid; grid-template-rows: repeat(6, 1fr); gap:6px; padding:10px;
  border-radius:18px; box-shadow:var(--inner);
}
.gh-wordguess .wg-board::before{
  content:""; position:absolute; inset:0; border-radius:18px; pointer-events:none;
  background:linear-gradient(90deg,var(--accent),var(--accent2));
  filter:blur(22px); opacity:.25; z-index:0;
}
.gh-wordguess .wg-board::after{
  content:""; position:absolute; inset:0; border-radius:18px; pointer-events:none; z-index:0;
  box-shadow:0 0 0 1px rgba(255,255,255,.12), inset 0 0 28px rgba(0,0,0,.28);
}
.gh-wordguess .wg-row{ display:grid; grid-template-columns: repeat(5, 1fr); gap:6px; z-index:1; }
.gh-wordguess .tile{
  display:grid; place-items:center; font-weight:900; font-size:clamp(20px, 5.5vw, 34px);
  background:rgba(255,255,255,.06); color:#fff; border:1px solid rgba(255,255,255,.16);
  border-radius:12px; box-shadow:var(--inner); text-transform:uppercase;
  transform-style:preserve-3d; transition:transform .25s ease, background .2s ease, border-color .2s ease;
  user-select:none; -webkit-user-select:none;
}
.gh-wordguess .tile.filled{ border-color:rgba(255,255,255,.28); }
.gh-wordguess .tile.flip{ animation:flip .66s ease both; }
@keyframes flip {
  0%{ transform:rotateX(0deg); }
  49%{ transform:rotateX(90deg); }
  51%{ transform:rotateX(90deg); }
  100%{ transform:rotateX(0deg); }
}
.gh-wordguess .tile.pop{ animation:pop .12s ease; }
@keyframes pop { from{transform:scale(.98);} to{transform:scale(1);} }
.gh-wordguess .tile.shake{ animation:shake .35s ease; }
@keyframes shake {
  10%, 90%{ transform:translateX(-2px); }
  20%, 80%{ transform:translateX(3px); }
  30%, 50%, 70%{ transform:translateX(-5px); }
  40%, 60%{ transform:translateX(5px); }
}

.gh-wordguess .tile.good{ background:rgba(45,209,150,.18); border-color:rgba(45,209,150,.55); }
.gh-wordguess .tile.mid{ background:rgba(255,216,102,.18); border-color:rgba(255,216,102,.55); }
.gh-wordguess .tile.bad{ background:rgba(43,52,95,.65); border-color:rgba(255,255,255,.08); color:#d9defb; }

/* keyboard */
.gh-wordguess .wg-kb{ width:min(540px,100%); margin:0 auto; user-select:none; -webkit-user-select:none; }
.gh-wordguess .wg-kb .row{ display:flex; gap:6px; justify-content:center; margin:6px 0; }
.gh-wordguess .key{
  flex:1; max-width:44px; padding:12px 8px; text-align:center; border-radius:10px; font-weight:900;
  background:rgba(255,255,255,.06); color:#fff; border:1px solid rgba(255,255,255,.16); box-shadow:var(--inner);
  touch-action:manipulation; -webkit-tap-highlight-color: transparent; cursor:pointer;
}
.gh-wordguess .key.wide{ flex:1.6; max-width:none; }
.gh-wordguess .key.good{ background:rgba(45,209,150,.18); border-color:rgba(45,209,150,.55); }
.gh-wordguess .key.mid{ background:rgba(255,216,102,.18); border-color:rgba(255,216,102,.55); }
.gh-wordguess .key.bad{ background:rgba(43,52,95,.65); border-color:rgba(255,255,255,.08); color:#d9defb; }

/* confetti + overlays */
.gh-wordguess .wg-confetti{ position:absolute; inset:var(--pad); width:calc(100% - var(--pad)*2); height:calc(100% - var(--pad)*2); border-radius:18px; pointer-events:none; }
.gh-wordguess .wg-overlay{
  position:absolute; inset:0; display:grid; place-items:center; z-index:5;
  background:rgba(5,10,22,.55); border-radius:18px;
}
.gh-wordguess .wg-card{
  width:min(520px,92vw); background:rgba(19,26,56,.85); border:1px solid var(--stroke); border-radius:18px;
  backdrop-filter:var(--glass); box-shadow:var(--glow), var(--inner); padding:16px 16px 18px; text-align:center; color:#e8ecff;
}
.gh-wordguess .wg-card-title{
  margin:0 0 8px; font-size:26px; font-weight:900;
  background:linear-gradient(90deg,var(--accent),var(--accent2));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.gh-wordguess .wg-summary{ color:var(--muted); display:grid; gap:6px; margin:10px 0 14px; }
.gh-wordguess .wg-share{ width:100%; min-height:110px; background:rgba(255,255,255,.06); border:1px solid var(--stroke); color:#fff; border-radius:12px; padding:10px; box-sizing:border-box; }
.gh-wordguess .wg-card-actions{ display:flex; justify-content:center; gap:10px; margin-top:10px; }

/* stats */
.gh-wordguess .wg-stats{ display:flex; gap:10px; justify-content:space-between; margin:8px 0 10px; }
.gh-wordguess .wg-stats .stat{ flex:1; text-align:center; background:rgba(255,255,255,.06); border:1px solid var(--stroke); border-radius:12px; padding:10px; box-shadow:var(--inner); }
.gh-wordguess .wg-stats .n{ display:block; font-size:22px; font-weight:900; color:#fff; }
.gh-wordguess .wg-stats .l{ display:block; color:#a9b7ff; font-size:12px; }
.gh-wordguess .wg-dist{ display:grid; gap:6px; text-align:left; }
.gh-wordguess .wg-dist .bar{ display:flex; align-items:center; gap:8px; }
.gh-wordguess .wg-dist .bar .lab{ width:24px; color:#a9b7ff; }
.gh-wordguess .wg-dist .bar .fill{ flex:1; background:rgba(255,255,255,.06); border:1px solid var(--stroke); border-radius:8px; overflow:hidden; position:relative; height:18px; }
.gh-wordguess .wg-dist .bar .val{ position:absolute; left:8px; top:50%; transform:translateY(-50%); font-size:12px; color:#fff; }
.gh-wordguess .wg-dist .bar .chunk{ height:100%; background:linear-gradient(90deg,var(--accent),var(--accent2)); }

/* how-to */
.gh-wordguess .wg-howto{ margin-top:14px; background:rgba(255,255,255,.06); border:1px solid var(--stroke); border-radius:12px; padding:10px 12px; }
.gh-wordguess .wg-inline-toggle{ background:transparent; color:var(--accent2); font-weight:900; border:none; cursor:pointer; }

@media (max-width:900px){ .gh-wordguess .wg-header{ grid-template-columns:1fr; } }
@media (max-width:680px){
  .gh-wordguess .wg-actions{ justify-content:stretch; }
  .gh-wordguess .wg-actions .wg-btn{ flex:1; }
  .gh-wordguess select{ width:100%; }
}
