@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;600;700;900&display=swap');

:root {
  --bg: #070815;
  --card: rgba(255, 255, 255, 0.1);
  --card-strong: rgba(255, 255, 255, 0.16);
  --text: #f8fbff;
  --muted: #aab3cf;
  --primary: #8b5cf6;
  --primary-2: #06b6d4;
  --danger: #fb466c;
  --success: #34d399;
  --border: rgba(255, 255, 255, 0.18);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Vazirmatn, Tahoma, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 12%, rgba(139, 92, 246, 0.38), transparent 28rem),
    radial-gradient(circle at 86% 18%, rgba(6, 182, 212, 0.28), transparent 24rem),
    radial-gradient(circle at 50% 100%, rgba(251, 70, 108, 0.2), transparent 26rem),
    var(--bg);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black, transparent 75%);
}

a { color: inherit; text-decoration: none; }

.glass {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}

.auth-page, .app-shell {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  padding: 34px;
  border-radius: 34px;
  text-align: center;
}

.brand-mark {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 24px;
  font-size: 38px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 18px 45px rgba(139, 92, 246, .35);
}

h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(30px, 7vw, 58px); line-height: 1.08; margin-bottom: 16px; }
h2 { font-size: 24px; margin-bottom: 18px; }
p { color: var(--muted); line-height: 1.9; }

.eyebrow {
  margin-bottom: 8px;
  color: #bdefff;
  font-weight: 800;
  letter-spacing: .08em;
}

.form-stack, .game-form { display: grid; gap: 14px; }

input, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 15px 16px;
  color: var(--text);
  background: rgba(4, 8, 22, .5);
  outline: none;
  font: inherit;
}

select { appearance: none; }

input:focus, select:focus { border-color: rgba(6, 182, 212, .8); box-shadow: 0 0 0 4px rgba(6, 182, 212, .14); }
input::placeholder { color: #7984a3; }

.button {
  border: 0;
  border-radius: 18px;
  padding: 13px 18px;
  color: var(--text);
  cursor: pointer;
  font: 800 15px Vazirmatn, Tahoma, sans-serif;
  transition: transform .2s ease, filter .2s ease, background .2s ease;
}

.button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.secondary { background: rgba(6, 182, 212, .28); border: 1px solid rgba(6, 182, 212, .35); }
.ghost { background: rgba(255,255,255,.1); border: 1px solid var(--border); }
.danger { background: rgba(251, 70, 108, .8); }
.tiny { padding: 8px 12px; border-radius: 12px; font-size: 12px; }

.alert {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.7;
}
.error { background: rgba(251, 70, 108, .16); border: 1px solid rgba(251, 70, 108, .35); }
.success { background: rgba(52, 211, 153, .14); border: 1px solid rgba(52, 211, 153, .35); }

.topbar {
  position: sticky;
  top: 16px;
  z-index: 5;
  width: min(1160px, calc(100% - 32px));
  margin: 16px auto 0;
  padding: 14px 18px;
  border-radius: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar p { margin: 0; line-height: 1.4; }

.player-stage {
  width: min(980px, 100%);
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.hero-card {
  width: min(760px, 100%);
  min-height: 410px;
  border-radius: 42px;
  padding: clamp(28px, 6vw, 64px);
  text-align: center;
  display: grid;
  place-items: center;
  align-content: center;
  transition: opacity .16s ease, transform .16s ease;
}

.hero-card.is-updating { opacity: .25; transform: scale(.98); }

.pulse-orb {
  width: 112px;
  height: 112px;
  margin-bottom: 26px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 28%, #fff, var(--primary-2) 28%, var(--primary) 70%);
  box-shadow: 0 0 0 0 rgba(139, 92, 246, .55);
  animation: pulse 1.7s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 32px rgba(139, 92, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

.start-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding: 12px 18px;
  border-radius: 999px;
  color: #06101b;
  background: linear-gradient(135deg, #fef08a, #67e8f9);
  font-weight: 900;
}

.admin-shell { padding-bottom: 36px; }
.dashboard-grid {
  width: min(1160px, calc(100% - 32px));
  margin: 24px auto;
  display: grid;
  grid-template-columns: 1.4fr .8fr;
  gap: 18px;
}

.panel {
  padding: 24px;
  border-radius: 28px;
}

.panel.wide { grid-column: span 1; }
.panel-title { display: flex; justify-content: space-between; gap: 16px; align-items: start; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr 150px;
  gap: 12px;
}

.word-row { grid-template-columns: 1fr 1fr 150px; }
.custom-word-row { grid-template-columns: 1fr 1.3fr 1fr; align-items: end; }
.custom-word-row.is-hidden { display: none; }
.bank-note {
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(52, 211, 153, .28);
  border-radius: 18px;
  color: #bfffe8;
  background: rgba(52, 211, 153, .1);
  line-height: 1.7;
  font-size: 13px;
}

label { color: var(--muted); font-weight: 700; }
label input { margin-top: 8px; }

.player-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 8px 0;
}

.player-check {
  display: grid;
  gap: 3px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.07);
  cursor: pointer;
}

.player-check input { width: auto; margin: 0; }
.player-check span { color: var(--text); font-weight: 900; }
.player-check small, .user-row small { color: var(--muted); }
.muted { opacity: .45; }

.role-list, .user-table { display: grid; gap: 10px; }
.role-list div, .user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.07);
}

.role-list b { color: #fef08a; }
.reveal-list { margin-top: 16px; width: min(520px, 100%); }
.user-row > div { display: grid; gap: 2px; }
.inline-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

@media (max-width: 860px) {
  .dashboard-grid, .field-row { grid-template-columns: 1fr; }
  .panel.wide { grid-column: auto; }
  .topbar { width: calc(100% - 20px); top: 10px; }
}
