:root {
  --bg: #0f0f1a;
  --card: #1a1a2e;
  --accent: #ff66b2;
  --accent-dim: #cc4d8f;
  --text: #f5f5f7;
  --muted: #9a9ab0;
  --success: #3ecf8e;
  --danger: #ff5c7a;
  --border: rgba(255, 102, 178, 0.35);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(ellipse at top, #1f1f35 0%, var(--bg) 55%);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.game-card {
  width: min(100%, 400px);
  min-height: 480px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.game-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  color: var(--muted);
}

.game-header strong {
  color: var(--text);
}

.game-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0;
}

.timer {
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 600;
}

.question {
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 14px;
  line-height: 1.45;
  background: rgba(255, 102, 178, 0.06);
}

/* Visible text via pseudo-elements — Telegram Android linkifies DOM text nodes only. */
.question::before {
  content: attr(data-text);
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
}

.no-tap {
  pointer-events: none;
}

.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.answers-loading {
  grid-column: span 2;
  text-align: center;
  color: var(--muted);
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.98);
}

.btn.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.btn-answer {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-answer::before {
  content: attr(data-name);
  display: block;
  pointer-events: none;
  word-break: break-word;
}

.btn-start::before,
.btn-restart::before {
  content: attr(data-label);
  display: block;
  pointer-events: none;
}

.btn-answer:hover:not(.is-disabled) {
  border-color: var(--accent);
  background: rgba(255, 102, 178, 0.12);
}

.btn-start {
  background: var(--success);
  color: #0b1f14;
  width: 60%;
  margin: 0 auto;
}

.btn-restart {
  background: var(--danger);
  color: #fff;
  width: 60%;
  margin: 0 auto;
}

.spacer {
  flex: 1;
}

.game-over-text {
  text-align: center;
  line-height: 1.5;
}

.game-over-text strong {
  color: var(--accent);
  font-size: 1.15rem;
}

.loader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--muted);
}

.loader {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid rgba(255, 102, 178, 0.2);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-banner {
  background: rgba(255, 92, 122, 0.15);
  border: 1px solid var(--danger);
  color: #ffc9d4;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  text-align: center;
}
