:root {
  --bg: #0f1220;
  --card: #171b2e;
  --accent: #6c5ce7;
  --accent2: #00d2a8;
  --text: #eef0f7;
  --muted: #9aa0b4;
  --danger: #ff5470;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, #23264a 0%, var(--bg) 60%);
  color: var(--text);
  direction: rtl;
  min-height: 100vh;
  padding: 24px 16px;
}

.wrap { max-width: 720px; margin: 0 auto; }

h1 { font-size: 1.6rem; margin-bottom: 4px; }
.subtitle { color: var(--muted); margin-bottom: 28px; }

.card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

label { display: block; font-size: 0.9rem; color: var(--muted); margin: 14px 0 6px; }

input[type=text], input[type=number], textarea, select {
  width: 100%;
  background: #0e1120;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

textarea { min-height: 160px; resize: vertical; direction: rtl; }

button {
  background: linear-gradient(135deg, var(--accent), #8e7bff);
  color: white;
  border: none;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 18px;
  width: 100%;
}
button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.option-btn {
  display: block;
  width: 100%;
  text-align: right;
  background: #0e1120;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: 1rem;
  cursor: pointer;
}
.option-btn.selected { border-color: var(--accent); background: rgba(108,92,231,0.18); }

.timer {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--accent2);
}

.progress { color: var(--muted); font-size: 0.9rem; margin-bottom: 10px; }

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: #0e1120;
}
.result-row.me { border: 1px solid var(--accent2); }
.rank { font-weight: 800; width: 28px; }
.name { flex: 1; margin-right: 10px; }
.score { font-weight: 800; color: var(--accent2); }
.pending { color: var(--muted); font-size: 0.85rem; }

.error { color: var(--danger); margin-top: 10px; font-size: 0.9rem; }
.hint { color: var(--muted); font-size: 0.82rem; margin-top: 6px; }

.invite-box {
  background: #0e1120;
  border: 1px dashed var(--accent);
  border-radius: 10px;
  padding: 14px;
  word-break: break-all;
  font-family: monospace;
  margin-top: 8px;
}

a { color: var(--accent2); }
