.game-card {
  position: relative;
  overflow: hidden;
}

.game-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, #38bdf8, #a78bfa, #34d399);
  content: "";
}

.game-control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.game-target {
  display: grid;
  width: min(100%, 560px);
  min-height: 250px;
  margin: 4px auto 0;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 22px;
  color: #e0f2fe;
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.16), rgba(30, 41, 59, 0.8));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 16px 40px rgba(2, 6, 23, 0.26);
  cursor: pointer;
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  font-weight: 760;
  text-align: center;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
  user-select: none;
}

.game-target:hover,
.game-target:focus-visible {
  border-color: #7dd3fc;
  transform: translateY(-1px);
}

.game-target[data-state="waiting"] {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.16), rgba(30, 41, 59, 0.82));
}

.game-target[data-state="ready"] {
  border-color: rgba(52, 211, 153, 0.8);
  color: #022c22;
  background: linear-gradient(145deg, #6ee7b7, #22c55e);
  box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.12), 0 18px 50px rgba(34, 197, 94, 0.25);
}

.game-target[data-state="false"] {
  border-color: rgba(251, 113, 133, 0.75);
  color: #ffe4e6;
  background: linear-gradient(145deg, rgba(225, 29, 72, 0.38), rgba(30, 41, 59, 0.88));
}

.game-target:disabled {
  cursor: default;
}

.game-round {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 17px;
  color: var(--gt-muted);
  font-size: 0.84rem;
}

.game-round strong {
  color: var(--gt-text);
  font-variant-numeric: tabular-nums;
}

.game-results {
  display: grid;
  gap: 13px;
  margin-top: 23px;
}

.game-results[hidden],
.game-live[hidden] {
  display: none;
}

.game-results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.game-score {
  padding: 14px;
  border: 1px solid var(--gt-line);
  border-radius: 13px;
  background: rgba(7, 17, 31, 0.5);
}

.game-score span,
.game-score strong {
  display: block;
}

.game-score span {
  color: var(--gt-subtle);
  font-size: 0.75rem;
}

.game-score strong {
  margin-top: 3px;
  color: var(--gt-text);
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}

.game-measurements {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.game-measurements li {
  padding: 4px 9px;
  border: 1px solid var(--gt-line);
  border-radius: 999px;
  color: var(--gt-muted);
  background: rgba(15, 31, 51, 0.65);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.typing-prompt {
  min-height: 158px;
  padding: 19px;
  border: 1px solid var(--gt-line-strong);
  border-radius: 14px;
  color: var(--gt-muted);
  background: rgba(2, 6, 23, 0.52);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.9;
  letter-spacing: 0.01em;
}

.typing-prompt .is-correct {
  color: #86efac;
}

.typing-prompt .is-wrong {
  color: #fda4af;
  text-decoration: underline wavy #fb7185;
  text-decoration-thickness: 1px;
}

.typing-prompt .is-current {
  border-left: 2px solid #f8fafc;
  color: #f8fafc;
  background: rgba(248, 250, 252, 0.12);
}

.typing-prompt .is-remaining {
  color: #64748b;
}

.typing-input {
  display: block;
  width: 100%;
  min-height: 112px;
  margin-top: 15px;
  padding: 14px;
  border: 1px solid var(--gt-line-strong);
  border-radius: 13px;
  color: var(--gt-text);
  background: rgba(7, 17, 31, 0.72);
  outline: 0;
  resize: vertical;
}

.typing-input:focus {
  border-color: var(--gt-accent);
  box-shadow: 0 0 0 3px var(--gt-accent-soft);
}

.typing-input:disabled {
  opacity: 0.62;
}

.typing-progress {
  display: block;
  width: 100%;
  height: 10px;
  margin-top: 18px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.typing-progress::-webkit-progress-bar {
  background: rgba(148, 163, 184, 0.16);
}

.typing-progress::-webkit-progress-value {
  background: linear-gradient(90deg, #38bdf8, #a78bfa);
}

.typing-progress::-moz-progress-bar {
  background: linear-gradient(90deg, #38bdf8, #a78bfa);
}

.typing-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.typing-stats .game-score strong {
  font-size: 1.1rem;
}

.game-note {
  margin: 15px 0 0;
  color: var(--gt-subtle);
  font-size: 0.78rem;
  line-height: 1.65;
}

@media (max-width: 640px) {
  .game-target {
    min-height: 210px;
  }

  .game-results-grid,
  .typing-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-control-row .gt-button {
    flex: 1 1 150px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-target,
  .gt-button {
    transition: none;
  }
}
