/* Type Sprint SWC - Glow aesthetic with gradients */
:root {
  --bg1: #0b1020;
  --bg2: #0e1630;
  --ink: #eaf4ff;
  --muted: #9fb3c8;
  --accent: #74f0ff;
  --accent-2: #8a7dff;
  --accent-3: #ff6bcb;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.2);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
    Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  background: radial-gradient(
      1200px 800px at 10% 10%,
      #161f3d 0%,
      transparent 60%
    ),
    radial-gradient(1000px 900px at 90% 20%, #1b1140 0%, transparent 60%),
    radial-gradient(1200px 1000px at 50% 100%, #1a1337 0%, transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  overflow-x: hidden;
}

.bg {
  position: fixed;
  inset: -10vmax;
  background: radial-gradient(
      60vmax 60vmax at 20% 30%,
      rgba(138, 125, 255, 0.25),
      transparent 60%
    ),
    radial-gradient(
      40vmax 30vmax at 80% 20%,
      rgba(116, 240, 255, 0.25),
      transparent 60%
    ),
    radial-gradient(
      50vmax 40vmax at 40% 90%,
      rgba(255, 107, 203, 0.2),
      transparent 60%
    );
  filter: blur(40px) saturate(1.1);
  z-index: -1;
  animation: float 20s ease-in-out infinite alternate;
}

@keyframes float {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-2%);
  }
}

.wrap {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.title {
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.1;
  margin: 0;
  font-size: clamp(24px, 3vw + 8px, 44px);
}

.title span {
  font-weight: 600;
  font-size: 0.75em;
  padding-left: 6px;
  color: var(--muted);
}

.glow-text {
  text-shadow: 0 0 8px rgba(116, 240, 255, 0.5),
    0 0 18px rgba(138, 125, 255, 0.5), 0 0 36px rgba(255, 107, 203, 0.35);
}

.mode-switch .tab {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s;
}

.mode-switch .tab.active {
  background: linear-gradient(
    90deg,
    rgba(116, 240, 255, 0.2),
    rgba(138, 125, 255, 0.2),
    rgba(255, 107, 203, 0.2)
  );
  box-shadow: 0 0 0 2px rgba(116, 240, 255, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.glass {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px) saturate(1.1);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35),
    inset 0 0 80px rgba(255, 255, 255, 0.04);
}

.panel {
  padding: 18px;
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.btn {
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.25s ease, background 0.2s,
    border-color 0.2s;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(90deg, #74f0ff, #8a7dff, #ff6bcb);
  color: #0b1020;
  border: none;
  box-shadow: 0 10px 30px rgba(138, 125, 255, 0.4);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

.glow-ring {
  box-shadow: 0 0 0 2px rgba(116, 240, 255, 0.25),
    0 0 25px rgba(138, 125, 255, 0.35), inset 0 0 18px rgba(255, 255, 255, 0.08);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.stat {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.stat .label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.stat .value {
  font-size: 22px;
  font-weight: 800;
  font-family: "JetBrains Mono", monospace;
}

.playfield {
  position: relative;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  padding: 16px;
  min-height: 220px;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
  cursor: text;
}

.words {
  font-size: clamp(18px, 2vw + 6px, 20px);
  line-height: 1.8;
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  user-select: none;
  font-family: "JetBrains Mono", monospace;
}

.word {
  position: relative;
  padding: 2px 4px;
  border-radius: 6px;
}
.word .char {
  opacity: 0.6;
}
.word .char.correct {
  color: #c8fff9;
  opacity: 1;
}
.word .char.wrong {
  color: #ff9bbf;
  text-decoration: line-through;
  opacity: 1;
}

.word.active {
  background: rgba(138, 125, 255, 0.12);
  box-shadow: 0 0 0 1px rgba(116, 240, 255, 0.25);
}

.caret {
  position: absolute;
  width: 2px;
  height: 1.4em;
  background: linear-gradient(180deg, #74f0ff, #8a7dff);
  box-shadow: 0 0 12px rgba(138, 125, 255, 0.8);
  transform: translate(-2px, -2px);
  animation: blink 1s steps(2, jump-none) infinite;
  border-radius: 2px;
}

@keyframes blink {
  50% {
    opacity: 0.2;
  }
}

.helper {
  color: var(--muted);
  font-size: 14px;
  margin-top: 10px;
}

.hidden-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  height: 0;
  width: 0;
}

.footer {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.footer a {
  color: #bfe7ff;
  text-decoration: none;
}
.footer a:hover {
  text-decoration: underline;
}

.dot {
  opacity: 0.5;
}

@media (max-width: 700px) {
  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
}
