/* MMM — game page: forms, timer, buttons, badges, status, waiting, results */

/* ── Form controls ───────────────────────────────────────────────────────── */
.answer-input,
.form-control,
.pin-input,
.range-input,
.color-swatch-input {
  width: 100%;
  border-radius: var(--radius-sm);
  border: var(--neo-border-w) solid var(--neo-border);
  background: var(--surface);
  color: var(--text-primary);
  transition: var(--transition);
}
.answer-input,
.form-control,
.pin-input { padding: 11px 13px; }
.answer-input:focus,
.form-control:focus,
.pin-input:focus,
.range-input:focus,
.color-swatch-input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.18);
}
.answer-input {
  font-weight: 700;
  background: color-mix(in srgb, var(--surface-alt) 60%, var(--surface));
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-weight: 800; font-size: 0.88rem; color: var(--text-primary); }
.code-area {
  min-height: 200px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.88rem;
}

/* ── Timer ───────────────────────────────────────────────────────────────── */
.timer-card { position: sticky; top: 14px; z-index: 3; }
.timer-container { display: flex; justify-content: center; }
.timer-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.timer-ring svg { transform: rotate(-90deg); }
.timer-text {
  position: absolute;
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--text-primary);
}
.timer-text.warning { color: var(--orange); }
.timer-text.danger  { color: var(--red); animation: pulse 0.55s infinite alternate; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  border: var(--neo-border-w) solid var(--neo-border);
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 900;
  font-size: 0.94rem;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: var(--neo-shadow-sm);
  letter-spacing: 0.01em;
}
.btn:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 0 var(--neo-border);
}
.btn:active:not(:disabled) {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 0 var(--neo-border);
}
.btn-primary  { background: var(--purple);    color: white; }
.btn-secondary{ background: var(--surface);   color: var(--text-primary); }
.btn-danger   { background: var(--red);       color: white; }
.btn-accent   { background: var(--teal);      color: white; }
.btn-ghost    { background: rgba(255,255,255,0.18); color: white; border-color: rgba(255,255,255,0.5); box-shadow: none; }
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.28); transform: none; box-shadow: none; }
.btn-full     { width: 100%; }
.btn-sm       { padding: 8px 12px; font-size: 0.86rem; }
.btn-xl       { padding: 15px 22px; font-size: 1.05rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: var(--neo-shadow-sm) !important; }

/* ── Badges & Chips ──────────────────────────────────────────────────────── */
.badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  font-size: 0.8rem;
  font-weight: 800;
  border: 1.5px solid var(--neo-border);
}
.badge-green, .chip-primary   { background: color-mix(in srgb, var(--green) 15%, white); color: #065f46; }
.badge-red                    { background: color-mix(in srgb, var(--red) 12%, white);   color: #991b1b; }
.badge-yellow, .chip-secondary{ background: color-mix(in srgb, var(--yellow) 25%, white);color: #78350f; }
.badge-soft, .chip-ghost      { background: rgba(255,255,255,0.18); color: inherit; border-color: rgba(255,255,255,0.4); }

/* ── Status messages ─────────────────────────────────────────────────────── */
.status-msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: var(--neo-border-w) solid var(--neo-border);
  font-weight: 600;
}
.status-msg.success { background: color-mix(in srgb, var(--green) 10%, white); color: #065f46; }
.status-msg.info    { background: color-mix(in srgb, var(--purple) 8%, white); color: var(--purple-dark); }
.status-msg.warning { background: color-mix(in srgb, var(--yellow) 20%, white); color: #78350f; }
.status-msg.error   { background: color-mix(in srgb, var(--red) 10%, white);   color: #991b1b; }
.status-msg { word-break: break-word; }

/* ── Waiting players ─────────────────────────────────────────────────────── */
.waiting-players { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.waiting-player-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-weight: 800;
  border: var(--neo-border-w) solid var(--neo-border);
}
.waiting-player-chip.done    { background: color-mix(in srgb, var(--green) 15%, white); color: #065f46; }
.waiting-player-chip.pending { background: color-mix(in srgb, #94a3b8 10%, white);      color: #475569; }

/* ── Results grid ────────────────────────────────────────────────────────── */
.results-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.result-card {
  border-radius: var(--radius-lg);
  padding: 16px;
  border: var(--neo-border-w) solid var(--neo-border);
  box-shadow: var(--neo-shadow);
  background: var(--surface);
}
.player-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: var(--neo-border-w) solid var(--neo-border);
}
.result-answer-row,
.mini-answer-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1.5px dashed rgba(13,13,13,0.14);
}
.result-answer-row:last-child,
.mini-answer-row:last-child { border-bottom: none; }
.q-category { flex: 1; font-size: 0.88rem; color: var(--text-muted); }
.q-answer   { font-weight: 800; text-align: right; }
.q-answer.empty { color: var(--text-muted); font-style: italic; font-weight: 600; }
.mini-player-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.mini-player-card {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: var(--neo-border-w) solid var(--neo-border);
  box-shadow: var(--neo-shadow-sm);
}
.mini-player-header { font-weight: 900; margin-bottom: 8px; }
