/* منصة ناموس — هوية بصرية تطابق الشعار */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

:root {
  /* النفسجي الأساسي - من الشعار */
  --primary: #4F3CD9;
  --primary-deep: #3525A3;
  --primary-light: #6B5BE8;
  --primary-soft: #8C7FF0;
  --primary-pale: #EBE8FB;
  --primary-paler: #F5F3FD;

  /* اللون التراثي المساعد */
  --gold: #C9A961;
  --gold-light: #E0C887;
  --gold-deep: #9A7E3F;

  /* الحالات */
  --green: #10B981;
  --green-deep: #047857;
  --green-pale: #D1FAE5;
  --red: #DC2626;
  --red-pale: #FEE2E2;
  --amber: #F59E0B;

  /* الخلفيات والنصوص */
  --bg: #FAFAFA;
  --bg-warm: #F7F5FF;
  --surface: #FFFFFF;
  --surface-2: #F4F3FA;
  --text: #1A1A2E;
  --text-2: #4B4B6B;
  --text-dim: #8A8AA0;
  --border: #E5E5EE;
  --border-dark: #D4D4DC;

  /* أبعاد */
  --radius: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 3px rgba(79, 60, 217, 0.06);
  --shadow: 0 4px 16px rgba(79, 60, 217, 0.08);
  --shadow-lg: 0 8px 32px rgba(79, 60, 217, 0.16);
  --shadow-glow: 0 8px 32px rgba(79, 60, 217, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(circle at 0% 0%, var(--primary-paler) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, #FFF7E8 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

.bg-decor { display: none; }

/* ============ LOGO ============ */
.logo-img {
  display: block;
  height: 44px;
  width: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.logo-img.lg { height: 72px; }
.logo-img.xl { height: 110px; }
.logo-img.sm { height: 32px; }

/* ============ HOME PAGE ============ */
.home-header {
  padding: 28px 24px 16px;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1280px; margin: 0 auto;
}
.logo-wrap { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  background: var(--primary-pale);
  color: var(--primary-deep);
  border: 1px solid var(--primary-soft);
  padding: 8px 14px; border-radius: var(--radius-full); font-size: 12px; font-weight: 600;
}

.home-main {
  max-width: 1100px; margin: 0 auto; padding: 20px 24px 60px;
}

.hero-section { text-align: center; margin: 30px 0 30px; }
.hero-title {
  font-size: 30px; font-weight: 800; margin-bottom: 8px;
  color: var(--text);
}
.hero-sub { font-size: 16px; color: var(--text-2); }

.modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px; margin-top: 24px;
}

.mode-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column; align-items: flex-start;
  position: relative; overflow: hidden;
  transition: all .25s ease;
  min-height: 230px;
  box-shadow: var(--shadow-sm);
}
.mode-card:hover, .mode-card:active {
  transform: translateY(-4px);
  border-color: var(--primary-soft);
  box-shadow: var(--shadow);
}
.mode-card::before {
  content: ''; position: absolute; top: 0; right: 0; left: 0; height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}
.mode-card.mode-solo::before { background: linear-gradient(90deg, var(--primary), var(--gold)); }

.mode-num {
  position: absolute; top: 16px; left: 16px;
  background: var(--primary-pale);
  color: var(--primary);
  font-weight: 800; font-size: 13px;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: monospace;
}

.mode-icon {
  background: var(--primary-pale);
  color: var(--primary);
  width: 60px; height: 60px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.mode-icon svg { width: 32px; height: 32px; }

.mode-card h3 { font-size: 19px; font-weight: 800; margin-bottom: 6px; color: var(--text); }
.mode-card p { font-size: 14px; color: var(--text-2); margin-bottom: 16px; flex: 1; line-height: 1.6; }

.mode-cta {
  background: var(--primary);
  color: #fff;
  padding: 9px 18px; border-radius: var(--radius);
  font-size: 14px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .15s;
}
.mode-card:hover .mode-cta { background: var(--primary-deep); }

.home-footer {
  margin-top: 50px; padding-top: 28px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-features {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 22px;
  margin-bottom: 18px;
}
.feat {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2);
}
.feat svg { width: 18px; height: 18px; color: var(--primary); }
.footer-copy { font-size: 12px; color: var(--text-dim); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius);
  font-family: inherit; font-size: 16px; font-weight: 700;
  border: none; cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 60, 217, 0.3);
}
.btn-primary:hover, .btn-primary:active {
  background: var(--primary-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 60, 217, 0.4);
}
.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--primary-soft); }
.btn-large { padding: 17px 30px; font-size: 17px; border-radius: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ============ HOST SCREEN ============ */
.page-host {
  background: linear-gradient(135deg, var(--primary-paler) 0%, #FFF 60%, #FFF7E8 100%);
}
.host-app {
  min-height: 100vh;
  display: flex; flex-direction: column;
  padding: 24px; gap: 24px;
}

.host-setup {
  max-width: 760px; margin: auto; width: 100%;
  text-align: center;
}
.host-setup .logo-wrap-center {
  display: flex; justify-content: center; margin-bottom: 22px;
}

.setup-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.setup-step h3 { font-size: 18px; margin-bottom: 14px; text-align: right; font-weight: 800; color: var(--text); }

.topic-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px; margin-top: 10px;
}
.topic-btn {
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 16px 14px;
  border-radius: var(--radius);
  font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-height: 88px; justify-content: center;
}
.topic-btn:hover:not(:disabled) {
  background: var(--primary-paler);
  border-color: var(--primary-soft);
}
.topic-btn.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary-deep);
  box-shadow: 0 4px 14px rgba(79, 60, 217, 0.3);
}
.topic-btn .topic-count {
  font-size: 11px; color: var(--text-2); font-weight: 500;
}
.topic-btn.selected .topic-count { color: rgba(255,255,255,0.85); }
.topic-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.config-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.config-btn {
  flex: 1; min-width: 70px;
  background: var(--surface); border: 2px solid var(--border);
  color: var(--text); padding: 13px;
  border-radius: var(--radius);
  cursor: pointer; font-family: inherit; font-size: 15px; font-weight: 700;
  transition: all .15s;
}
.config-btn:hover:not(.selected) { border-color: var(--primary-soft); background: var(--primary-paler); }
.config-btn.selected { background: var(--primary); color: #fff; border-color: var(--primary-deep); }

/* Host lobby */
.host-lobby {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  flex: 1;
}
.lobby-left, .lobby-right {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.code-display {
  font-size: 80px; font-weight: 900; letter-spacing: 10px;
  color: var(--primary);
  font-family: monospace;
  margin: 14px 0;
  line-height: 1;
}
.code-label { color: var(--text-2); font-size: 16px; margin-bottom: 8px; font-weight: 600; }
.qr-wrap {
  background: #fff;
  padding: 14px;
  border-radius: var(--radius);
  margin: 20px 0;
  border: 2px solid var(--border);
}
.qr-wrap img, .qr-wrap canvas, .qr-wrap svg { display: block; }
.join-url {
  background: var(--primary-paler);
  padding: 10px 16px; border-radius: var(--radius);
  font-family: monospace; font-size: 13px; color: var(--primary-deep);
  margin-top: 10px;
  border: 1px solid var(--primary-pale);
}

.players-list { width: 100%; }
.players-list h3 {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 18px; margin-bottom: 18px; font-weight: 800;
}
.player-count {
  background: var(--primary);
  color: #fff;
  padding: 4px 14px; border-radius: var(--radius-full); font-size: 14px;
}
.player-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-pale);
  border: 1px solid var(--primary-soft);
  color: var(--primary-deep);
  padding: 8px 8px 8px 14px; border-radius: var(--radius-full);
  margin: 4px; font-size: 15px; font-weight: 600;
  animation: fadeIn .3s;
}
.kick-btn {
  background: rgba(220, 38, 38, 0.12);
  border: none;
  color: var(--red);
  width: 22px; height: 22px; border-radius: 50%;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
  padding: 0;
}
.kick-btn:hover { background: var(--red); color: #fff; transform: scale(1.1); }
.kick-btn svg { width: 12px; height: 12px; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.9);} to { opacity: 1; transform: scale(1);} }
.empty-players { color: var(--text-dim); font-size: 14px; text-align: center; padding: 30px; }

/* Host question display */
.host-question-screen {
  flex: 1; display: flex; flex-direction: column; padding: 20px; gap: 18px;
}
.host-q-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 16px; color: var(--text-2);
}
.q-progress {
  background: var(--surface); border: 1px solid var(--border);
  padding: 10px 18px; border-radius: var(--radius); font-weight: 600;
}
.q-timer {
  background: var(--primary);
  color: #fff;
  padding: 12px 28px; border-radius: var(--radius);
  font-size: 32px; font-weight: 800;
  font-family: monospace;
  min-width: 100px; text-align: center;
  box-shadow: 0 4px 14px rgba(79, 60, 217, 0.3);
}
.q-timer.warning { background: var(--amber); box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4); animation: pulse .5s infinite; }
.q-timer.danger { background: var(--red); box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4); }
@keyframes pulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.05);} }

.host-q-card {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  box-shadow: var(--shadow);
}
.host-q-text { font-size: 32px; font-weight: 800; line-height: 1.4; margin-bottom: 30px; color: var(--text); }
.host-options {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 800px; margin: 0 auto;
}
.host-option {
  background: var(--primary-paler);
  border: 2px solid var(--primary-pale); border-radius: var(--radius);
  padding: 22px; font-size: 20px; font-weight: 700;
  color: var(--text);
  text-align: right; display: flex; gap: 14px; align-items: center;
}
.host-option .opt-key {
  background: var(--primary); color: #fff;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; flex-shrink: 0;
}
.host-option.correct {
  border-color: var(--green); background: var(--green-pale);
  animation: correctReveal .4s;
}
.host-option.correct .opt-key { background: var(--green); }
@keyframes correctReveal {
  0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); }
}

.host-stat { text-align: center; background: var(--surface); padding: 10px 18px; border-radius: var(--radius); border: 1px solid var(--border); }
.host-stat .label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.host-stat .value { font-size: 22px; font-weight: 800; color: var(--primary); }

.host-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.host-bottom-row > * { min-height: 200px; }

.answered-status {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.answered-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
  font-weight: 800; font-size: 16px; color: var(--text-2);
}
.answered-count {
  background: var(--primary);
  color: #fff;
  padding: 4px 14px; border-radius: var(--radius-full);
  font-family: monospace; font-size: 14px;
}
.answered-list {
  display: flex; flex-wrap: wrap; gap: 8px;
  max-height: 200px; overflow-y: auto;
}
.player-tag-mini {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 700;
  border: 1px solid;
  transition: all .2s;
}
.player-tag-mini.pending {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-dim);
}
.player-tag-mini.pending svg { color: var(--text-dim); animation: spin 2s linear infinite; }
.player-tag-mini.answered {
  background: var(--green-pale);
  border-color: var(--green);
  color: var(--green-deep);
  animation: pop .25s;
}
.player-tag-mini.answered svg { color: var(--green); }
@keyframes pop {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.host-leaderboard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px; max-height: 280px; overflow-y: auto;
}
.lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.lb-row:last-child { border-bottom: none; }
.lb-rank { font-size: 18px; font-weight: 800; color: var(--text-2); min-width: 30px; font-family: monospace; }
.lb-rank.r1 { color: var(--gold); }
.lb-rank.r2 { color: #C0C0C0; }
.lb-rank.r3 { color: var(--gold-deep); }
.lb-name { flex: 1; font-size: 16px; font-weight: 600; }
.lb-score { font-family: monospace; font-size: 18px; font-weight: 700; color: var(--primary); }

.reveal-info {
  background: var(--green-pale);
  border: 1px solid var(--green);
  border-radius: var(--radius); padding: 18px;
  font-size: 16px;
  text-align: center; margin-top: 16px;
  color: var(--green-deep);
  line-height: 1.7;
}
.reveal-actions {
  display: flex; justify-content: center;
  margin-top: 14px;
}
.reveal-actions .btn { min-width: 240px; }

/* ============ PLAYER SCREEN ============ */
.page-player {
  background: linear-gradient(180deg, var(--primary-paler) 0%, #FFFFFF 100%);
}
.player-app {
  min-height: 100vh;
  max-width: 540px; margin: 0 auto;
  display: flex; flex-direction: column;
  padding: 20px; gap: 16px;
}

.player-screen {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.player-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.player-info {
  background: var(--primary-pale);
  color: var(--primary-deep);
  padding: 6px 14px; border-radius: var(--radius-full); font-size: 13px;
  font-weight: 600;
}

.input-field {
  width: 100%;
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 16px 20px;
  border-radius: var(--radius);
  font-family: inherit; font-size: 18px;
  text-align: center;
  margin: 10px 0;
  transition: border .15s;
}
.input-field:focus { outline: none; border-color: var(--primary); }
.input-code {
  font-size: 32px; font-weight: 800; letter-spacing: 8px;
  font-family: monospace; padding: 22px;
  color: var(--primary);
}

.player-q-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  box-shadow: var(--shadow-sm);
}
.player-q-meta {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--text-2);
  margin-bottom: 14px;
  font-weight: 600;
}
.player-q-text {
  font-size: 20px; font-weight: 800; line-height: 1.5;
  text-align: center; padding: 16px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  color: var(--text);
}

.player-options {
  display: flex; flex-direction: column; gap: 10px;
}
.player-option {
  background: var(--surface);
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border-dark);
  border-radius: var(--radius);
  padding: 18px 16px;
  font-family: inherit; font-size: 17px; font-weight: 700;
  color: var(--text);
  cursor: pointer;
  text-align: right;
  display: flex; gap: 14px; align-items: center;
  transition: all .15s;
  min-height: 64px;
}
.player-option:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2px; }
.player-option .opt-key {
  background: var(--primary-pale); color: var(--primary-deep);
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; flex-shrink: 0;
}
.player-option.selected {
  background: var(--primary-pale); border-color: var(--primary);
  border-bottom-color: var(--primary-deep);
}
.player-option.selected .opt-key { background: var(--primary); color: #fff; }
.player-option.correct {
  background: var(--green-pale); border-color: var(--green);
  border-bottom-color: var(--green-deep);
}
.player-option.correct .opt-key { background: var(--green); color: #fff; }
.player-option.wrong {
  background: var(--red-pale); border-color: var(--red);
  border-bottom-color: #991B1B;
}
.player-option.wrong .opt-key { background: var(--red); color: #fff; }
.player-option:disabled { cursor: default; }

.player-timer-bar {
  height: 8px; background: var(--border); border-radius: 4px; overflow: hidden;
  margin-bottom: 16px;
}
.player-timer-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green) 0%, var(--amber) 70%, var(--red) 90%);
  width: 100%; transition: width .1s linear;
  border-radius: 4px;
}

.waiting {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 30px 20px; text-align: center;
}

/* لوحة لاعبي الـ lobby على شاشة اللاعب */
.lobby-players-panel {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
  border: 1px solid var(--border);
}
.lobby-players-panel h4 {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; font-weight: 800; color: var(--text-2);
  margin-bottom: 10px;
}
.lobby-count {
  background: var(--primary);
  color: #fff;
  padding: 2px 10px; border-radius: var(--radius-full);
  font-size: 12px; font-family: monospace;
}
.lobby-players {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.lobby-player-tag {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600;
  animation: fadeIn .3s;
}
.lobby-player-tag.me {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary-deep);
}

/* الترتيب على شاشة اللاعب */
.mini-lb-details {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.mini-lb-details summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 800; font-size: 14px; color: var(--text);
  user-select: none;
}
.mini-lb-details summary::-webkit-details-marker { display: none; }
.mini-lb-details summary::after {
  content: '▼'; font-size: 10px; color: var(--text-2);
  transition: transform .15s;
}
.mini-lb-details[open] summary::after { transform: rotate(180deg); }
.mini-lb-details[open] summary { border-bottom: 1px solid var(--border); }
.my-rank {
  background: var(--primary);
  color: #fff;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 12px; font-family: monospace;
  margin-left: 8px;
}
.player-lb {
  max-height: 240px; overflow-y: auto;
}
.player-lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.player-lb-row:last-child { border-bottom: none; }
.player-lb-row.me {
  background: var(--primary-paler);
  font-weight: 800;
}
.lb-rank-mini {
  font-size: 15px;
  min-width: 32px; text-align: center;
  font-family: monospace; font-weight: 800;
  color: var(--text-2);
}
.lb-name-mini { flex: 1; }
.player-lb-row.me .lb-name-mini { color: var(--primary-deep); }
.lb-score-mini {
  font-family: monospace; font-weight: 800;
  color: var(--primary);
  min-width: 50px; text-align: left;
}
.player-lb-row.me .lb-score-mini { color: var(--primary-deep); }
.waiting svg { width: 56px; height: 56px; color: var(--primary); animation: spin 2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.waiting h3 { font-size: 19px; font-weight: 800; }
.waiting p { color: var(--text-2); font-size: 14px; }

.feedback-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px;
  text-align: center;
  border: 2px solid;
}
.feedback-card.correct { border-color: var(--green); background: var(--green-pale); }
.feedback-card.wrong { border-color: var(--red); background: var(--red-pale); }
.feedback-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  color: #fff;
}
.feedback-card.correct .feedback-icon { background: var(--green); }
.feedback-card.wrong .feedback-icon { background: var(--red); }
.feedback-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; color: var(--text); }
.feedback-explanation { font-size: 15px; color: var(--text-2); line-height: 1.7; }

.score-pill {
  background: var(--primary);
  color: #fff;
  padding: 8px 14px; border-radius: var(--radius-full);
  font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
}

.alert-msg {
  background: var(--red-pale);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 12px 16px; font-size: 14px;
  color: var(--red); margin-top: 12px;
  font-weight: 600;
}
.success-msg {
  background: var(--green-pale);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 12px 16px; font-size: 14px;
  color: var(--green-deep); margin-top: 12px;
  font-weight: 600;
}

/* ============ FINAL RESULTS ============ */
.final-screen {
  text-align: center;
  padding: 30px 20px;
}
.trophy { font-size: 70px; margin-bottom: 14px; }
.final-title {
  font-size: 30px; font-weight: 800; margin-bottom: 24px;
  color: var(--primary);
}
.final-rank {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  margin-bottom: 12px;
}
.final-score-big {
  font-size: 50px; font-weight: 800;
  color: var(--primary);
  font-family: monospace;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .host-lobby { grid-template-columns: 1fr; }
  .host-bottom-row { grid-template-columns: 1fr; }
  .host-q-text { font-size: 24px; }
  .host-options { grid-template-columns: 1fr; }
  .code-display { font-size: 56px; letter-spacing: 6px; }
  .home-header { flex-direction: column; gap: 8px; align-items: flex-start; }
  .logo-img { height: 36px; }
  .logo-img.lg { height: 56px; }
}

@media (max-width: 480px) {
  .modes { grid-template-columns: 1fr; }
  .hero-title { font-size: 24px; }
  .player-option { font-size: 16px; padding: 14px; }
}

/* ============ UTILITIES ============ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.muted { color: var(--text-2); }
.spacer { flex: 1; }
