:root{
  --bg0:#0f1114;
  --bg1:#14171c;
  --panel: rgba(20, 22, 26, .70);
  --panel2: rgba(12, 14, 18, .55);
  --stroke: rgba(255,255,255,.10);
  --stroke2: rgba(255,255,255,.07);

  --text:#f2f2f2;
  --muted: rgba(255,255,255,.55);

  --honey:#ffcc33;
  --honey2:#ffb200;
  --wax:#ffe7a6;

  --good:#46e2a6;
  --bad:#ff5a67;

  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;

  --shadow: 0 18px 60px rgba(0,0,0,.55);
  --soft: 0 10px 28px rgba(0,0,0,.35);
  --round: 18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color:var(--text);
  font-family:var(--sans);
  background:
    radial-gradient(1200px 700px at 16% 18%, rgba(255,204,51,.14), transparent 70%),
    radial-gradient(900px 600px at 84% 68%, rgba(70,226,166,.08), transparent 72%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

body::before{
  content:"";
  position:fixed;
  inset:-40px;
  pointer-events:none;
  opacity:.55;
  background:
    conic-gradient(from 30deg, rgba(255,204,51,.12) 0 60deg, transparent 60deg 120deg, rgba(255,204,51,.12) 120deg 180deg, transparent 180deg 240deg, rgba(255,204,51,.12) 240deg 300deg, transparent 300deg 360deg);
  background-size: 64px 56px;
  mask-image: radial-gradient(closest-side at 50% 18%, rgba(0,0,0,.85), transparent 70%);
  filter: blur(.2px);
}

.wrap{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding: 28px 16px 18px;
  gap: 18px;
  position:relative;
  isolation:isolate;
}

.top{
  width:min(980px, 100%);
  display:flex;
  flex-direction:column;
  gap: 12px;
  align-items:center;
}

.title{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 6px;
}

.title h1{
  margin:0;
  font-weight: 900;
  letter-spacing: .3px;
  color: var(--honey);
  text-shadow: 0 2px 0 rgba(0,0,0,.35);
}

.subtitle{
  font-size: 13px;
  color: rgba(255,255,255,.55);
  text-align:center;
  max-width: 58ch;
}

.controls{
  width:100%;
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap: 12px 14px;
  padding: 12px 12px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  box-shadow: var(--soft);
  backdrop-filter: blur(10px);
}

.ctrl{
  display:flex;
  flex-direction:column;
  gap: 6px;
}

.ctrl label{
  font-size: 12px;
  color: rgba(255,255,255,.62);
}

select{
  height: 40px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,.20);
  color: var(--text);
  outline:none;
}

select:focus{
  border-color: rgba(255,204,51,.55);
  box-shadow: 0 0 0 4px rgba(255,204,51,.14);
}

.toggles{
  flex-direction:row;
  align-items:flex-end;
  gap: 10px;
  padding-left: 6px;
}

.check{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,.62);
  user-select:none;
}

.check input{ transform: translateY(1px); }

.buttons{
  flex-direction:row;
  align-items:flex-end;
  gap: 10px;
}

.btn{
  height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  color: var(--text);
  cursor:pointer;
  box-shadow: var(--soft);
}

.btn:hover{ filter: brightness(1.06); }
.btn:active{ transform: translateY(1px); }
.btn:disabled{ opacity:.55; cursor:not-allowed; }

.btn.primary{
  background: linear-gradient(180deg, rgba(255,204,51,.98), rgba(255,176,0,.92));
  color: rgba(0,0,0,.88);
  border-color: rgba(0,0,0,.35);
}

.hud{
  width:min(980px, 100%);
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap: 18px 28px;
  align-items:flex-end;
}

.hudItem{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 6px;
  min-width: 90px;
}

.hudLabel{
  font-size: 13px;
  color: rgba(255,204,51,.92);
  letter-spacing:.25px;
}

.hudValue{
  font-family: var(--mono);
  font-size: 60px;
  line-height: 1;
  color: rgba(255,255,255,.30);
}

.hudItem.small .hudValue{
  font-size: 34px;
  color: rgba(255,255,255,.28);
}

.arena{
  width:min(980px, 100%);
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--round);
  box-shadow: var(--shadow);
  padding: 18px 16px 16px;
  display:flex;
  flex-direction:column;
  gap: 14px;
  backdrop-filter: blur(10px);
}

.wordsShell{
  width:100%;
  padding: 16px 16px;
  border-radius: 16px;
  background: var(--panel2);
  border: 1px solid var(--stroke2);
  overflow-y:auto;
  max-height: 220px;
  scrollbar-width: thin;
}

.words{
  font-family: var(--mono);
  font-size: 20px;
  line-height: 1.7;
  color: rgba(255,255,255,.28);
  word-wrap: break-word;
}

.word{
  display:inline-block;
  padding: 0 4px;
  margin: 0 3px 4px 0;
  border-radius: 10px;
  position:relative;
}

.word.current{
  color: rgba(255,255,255,.78);
  background: rgba(255,204,51,.10);
  box-shadow: inset 0 -4px 0 rgba(255,204,51,.55);
}

.word.done.good{
  color: rgba(70,226,166,.95);
  background: rgba(70,226,166,.08);
}

.word.done.bad{
  color: rgba(255,90,103,.98);
  background: rgba(255,90,103,.08);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

.word .c{ opacity:.35; }
.word .c.ok{ color: rgba(70,226,166,.95); opacity:1; }
.word .c.bad{
  color: rgba(255,90,103,.98);
  opacity:1;
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

.entry{
  display:flex;
  justify-content:center;
}

.input{
  width: min(440px, 100%);
  height: 54px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,.16);
  color: var(--text);
  font-family: var(--mono);
  font-size: 18px;
  padding: 0 14px;
  outline:none;
  text-align:center;
}

.input:focus{
  border-color: rgba(255,204,51,.58);
  box-shadow: 0 0 0 4px rgba(255,204,51,.14);
}

.venomRow{
  display:flex;
  flex-direction:column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(0,0,0,.14);
  border: 1px solid var(--stroke2);
}

.venomLabel{
  display:flex;
  justify-content:space-between;
  font-size: 12px;
  color: rgba(255,255,255,.55);
}

.venomBar{
  height: 12px;
  border-radius: 999px;
  overflow:hidden;
  background: rgba(0,0,0,.24);
  border: 1px solid var(--stroke2);
}

.venomFill{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(255,90,103,.92), rgba(255,204,51,.92));
  transition: width .12s linear;
}

.hint{
  text-align:center;
  font-size: 13px;
  color: rgba(255,255,255,.52);
  padding: 2px 6px;
}

.foot{
  width:min(980px, 100%);
  display:flex;
  justify-content:space-between;
  gap: 10px;
  font-size: 12px;
  color: rgba(255,255,255,.42);
}

.foot .muted{ color: rgba(255,255,255,.35); }

.overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.62);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 50;
}

.overlay[hidden]{
  display:none !important;
}

.card{
  width: min(520px, 100%);
  background: rgba(16,18,22,.96);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 16px;
  outline:none;
}

.cardTitle{
  font-weight: 900;
  color: var(--honey);
  font-size: 18px;
  margin-bottom: 12px;
}

.cardGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kv{
  background: rgba(0,0,0,.20);
  border: 1px solid var(--stroke2);
  border-radius: 16px;
  padding: 10px;
}

.kv .k{
  font-size: 12px;
  color: rgba(255,255,255,.55);
}

.kv .v{
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 22px;
  color: rgba(255,255,255,.88);
}

.cardActions{
  display:flex;
  justify-content:flex-end;
  gap: 10px;
}

@keyframes stingShake{
  0%{ transform: translate3d(0,0,0) rotate(0deg); }
  18%{ transform: translate3d(-10px, 0, 0) rotate(-1deg); }
  36%{ transform: translate3d(9px, 0, 0) rotate(1deg); }
  54%{ transform: translate3d(-7px, 0, 0) rotate(-.6deg); }
  72%{ transform: translate3d(6px, 0, 0) rotate(.6deg); }
  100%{ transform: translate3d(0,0,0) rotate(0deg); }
}

@keyframes stingGlow{
  0%{ box-shadow: 0 0 0 rgba(255,90,103,0); }
  30%{ box-shadow: 0 0 0 10px rgba(255,90,103,.18); }
  100%{ box-shadow: 0 0 0 rgba(255,90,103,0); }
}

.stingFX{
  animation: stingShake .22s ease-out, stingGlow .36s ease-out;
}

@media (prefers-reduced-motion: reduce){
  .venomFill{ transition:none; }
  .stingFX{ animation:none; }
}
