/* ══════════════════════════════════════════════════════
   مشنص — STYLESHEET
   Aesthetic: Dark Arabian Night — Gold on Obsidian
   ══════════════════════════════════════════════════════ */

:root {
  --bg:           #080810;
  --surface:      #0f0f1a;
  --surface2:     #181826;
  --surface3:     #20202e;
  --surface4:     #282838;
  --border:       #2a2a3e;
  --border-mid:   #3e3e58;
  --border-hi:    #5a5a7a;

  --gold:         #c9a84c;
  --gold-light:   #e8c96a;
  --gold-glow:    rgba(201,168,76,0.25);
  --gold-dim:     #7a6030;
  --gold-bg:      rgba(201,168,76,0.07);

  --crimson:      #8b1a1a;
  --crimson-mid:  #c0392b;
  --crimson-bg:   rgba(139,26,26,0.15);

  --emerald:      #1a4a2e;
  --emerald-mid:  #27ae60;
  --emerald-bg:   rgba(26,74,46,0.2);

  --sapphire:     #1a2a4a;
  --sapphire-mid: #2980b9;
  --sapphire-bg:  rgba(26,42,74,0.25);

  --purple-bg:    rgba(80,40,120,0.2);
  --purple-mid:   #9b59b6;

  --text:         #ece4d4;
  --text-mid:     #a8a090;
  --text-dim:     #68607a;
  --text-faint:   #3a3650;

  --coin:         #f0c040;
  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    18px;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* Geometric bg pattern */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 90% 50% at 50% -10%, rgba(201,168,76,.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 70% at -10% 50%, rgba(139,26,26,.06) 0%, transparent 50%),
    radial-gradient(ellipse 60% 70% at 110% 50%, rgba(26,42,74,.07) 0%, transparent 50%);
  pointer-events: none; z-index: 0;
}

body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M40 0L80 40L40 80L0 40Z' fill='none' stroke='%23c9a84c' stroke-opacity='0.025' stroke-width='1'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0;
}

#app { position: relative; z-index: 1; min-height: 100vh; }

/* ── Typography ── */
.amiri { font-family: 'Amiri', serif; }

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.75); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 6px var(--gold-glow); }
  50%       { box-shadow: 0 0 20px var(--gold-glow), 0 0 40px rgba(201,168,76,.1); }
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%       { transform: translateY(-18px) rotate(3deg); }
}
@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: .7; }
  50%       { transform: scale(1.5); opacity: 0; }
}
@keyframes wdot {
  0%,80%,100% { transform: scale(0); }
  40%         { transform: scale(1); }
}

.animate-in {
  animation: fadeUp .5s ease both;
}

/* ── Shared ── */
.hidden { display: none !important; }

.center-page {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100vh; gap: 1.5rem;
}

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border-mid);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.error-box {
  background: var(--crimson-bg);
  border: 1px solid var(--crimson);
  color: #ffb0b0;
  padding: 1.2rem 1.6rem;
  border-radius: var(--radius);
  text-align: center;
  line-height: 1.7;
}

.error-msg {
  background: var(--crimson-bg);
  border: 1px solid var(--crimson);
  color: #ffb0b0;
  padding: .6rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  margin-top: .5rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; border: none; cursor: pointer;
  font-family: 'Cairo', sans-serif; font-weight: 700;
  border-radius: var(--radius-sm);
  padding: .75rem 1.25rem; font-size: .9rem;
  transition: all .15s; user-select: none;
  position: relative; overflow: hidden;
}
.btn:active:not(:disabled) { transform: scale(.96); }
.btn:disabled { opacity: .35; cursor: not-allowed; }

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #9a7030);
  color: #1a0f00;
  box-shadow: 0 3px 16px rgba(201,168,76,.3);
}
.btn-gold:hover:not(:disabled) {
  box-shadow: 0 3px 24px rgba(201,168,76,.5);
  filter: brightness(1.08);
}
.btn-lg { padding: 1rem 1.75rem; font-size: 1rem; border-radius: var(--radius); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--text-mid);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--border-hi); color: var(--text); }

.btn-sm { padding: .45rem .8rem; font-size: .8rem; }
.btn-xs { padding: .3rem .55rem; font-size: .75rem; }

.btn-rb-challenge {
  background: var(--crimson-bg);
  border: 1px solid var(--crimson);
  color: #ffb0b0;
}
.btn-rb-challenge:hover { background: rgba(139,26,26,.35); }

.btn-rb-block {
  background: var(--gold-bg);
  border: 1px solid var(--gold-dim);
  color: var(--gold-light);
}
.btn-rb-block:hover { background: rgba(201,168,76,.18); }

.btn-rb-accept {
  background: var(--emerald-bg);
  border: 1px solid var(--emerald);
  color: #a0ffb0;
}
.btn-rb-accept:hover { background: rgba(26,74,46,.45); }

.btn-modal-take {
  background: var(--gold-bg); border: 1px solid var(--gold-dim);
  color: var(--gold-light); flex: 1; flex-direction: column;
  padding: .9rem .5rem; border-radius: var(--radius);
}
.btn-modal-take:hover { background: rgba(201,168,76,.18); }

.btn-modal-burn {
  background: var(--crimson-bg); border: 1px solid var(--crimson);
  color: #ffb0b0; flex: 1; flex-direction: column;
  padding: .9rem .5rem; border-radius: var(--radius);
}
.btn-modal-burn:hover { background: rgba(139,26,26,.35); }

.btn-modal-pass {
  background: var(--surface2); border: 1px solid var(--border-mid);
  color: var(--text-mid); flex: 1; flex-direction: column;
  padding: .9rem .5rem; border-radius: var(--radius);
}
.btn-modal-pass:hover { background: var(--surface3); }

/* ══════════════════════════════════════════════════════
   LOBBY
   ══════════════════════════════════════════════════════ */
.lobby {
  display: flex; flex-direction: column;
  align-items: center; padding: 2rem 1rem 3rem;
  min-height: 100vh; gap: 0;
}

/* Logo */
.logo-wrap { text-align: center; margin-bottom: 2rem; }

.logo-arabic {
  font-family: 'Amiri', serif;
  font-size: clamp(4.5rem, 14vw, 9rem);
  font-weight: 700; color: var(--gold); line-height: 1;
  text-shadow: 0 0 60px rgba(201,168,76,.5), 0 0 120px rgba(201,168,76,.15);
  letter-spacing: -.02em;
}

.logo-divider {
  display: flex; align-items: center; gap: 1rem;
  color: var(--gold-dim); margin: .5rem 0;
}
.logo-divider::before, .logo-divider::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  max-width: 100px;
}
.divider-gem { font-size: 1rem; }

.logo-tagline {
  font-family: 'Tajawal', sans-serif; font-size: .9rem;
  font-weight: 300; color: var(--text-dim);
  letter-spacing: .25em;
}

/* Lobby card */
.lobby-card {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  padding: 2rem; width: 100%; max-width: 440px;
  position: relative; overflow: hidden;
}
.lobby-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.lobby-tabs {
  display: flex; gap: .4rem; margin-bottom: 1.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .3rem;
}
.tab-btn {
  flex: 1; padding: .55rem; font-family: 'Cairo', sans-serif;
  font-size: .85rem; font-weight: 600;
  background: transparent; border: none;
  color: var(--text-dim); cursor: pointer;
  border-radius: 6px; transition: all .15s;
}
.tab-btn.active {
  background: var(--surface3); color: var(--gold-light);
}

.tab-panel { display: flex; flex-direction: column; gap: 1rem; }

.field-wrap { display: flex; flex-direction: column; gap: .35rem; }

.field-label {
  font-size: .72rem; font-weight: 700;
  color: var(--text-dim); letter-spacing: .18em;
  text-transform: uppercase;
}

.field-input {
  width: 100%;
  background: var(--surface2); border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: .8rem 1rem; color: var(--text);
  font-family: 'Cairo', sans-serif; font-size: 1rem;
  outline: none; text-align: right;
  transition: border-color .2s, box-shadow .2s;
}
.field-input:focus {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(201,168,76,.1);
}
.field-input::placeholder { color: var(--text-faint); }

/* Rules */
.lobby-rules {
  margin-top: 1.75rem; width: 100%; max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.rules-title {
  font-size: .72rem; font-weight: 700;
  letter-spacing: .18em; color: var(--text-dim);
  text-transform: uppercase; margin-bottom: .85rem;
}
.rules-grid { display: flex; flex-direction: column; gap: .55rem; }
.rule-item {
  display: flex; align-items: center; gap: .75rem;
  font-size: .83rem; color: var(--text-mid); line-height: 1.4;
}
.rule-emoji { font-size: 1rem; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════
   WAITING ROOM
   ══════════════════════════════════════════════════════ */
.waiting-page {
  display: flex; flex-direction: column;
  min-height: 100vh;
}

.waiting-header {
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.room-pill {
  display: flex; flex-direction: column; align-items: flex-end; gap: .15rem;
}
.room-pill-label { font-size: .65rem; color: var(--text-dim); letter-spacing: .12em; text-transform: uppercase; }
.room-pill-code {
  font-family: monospace; font-size: 1.2rem; letter-spacing: .25em;
  color: var(--gold); cursor: pointer;
  padding: .2rem .5rem; border-radius: 6px;
  background: var(--gold-bg); border: 1px solid var(--gold-dim);
  transition: background .15s;
}
.room-pill-code:hover { background: rgba(201,168,76,.15); }

.room-name-display {
  font-family: 'Amiri', serif; font-size: 1.4rem; color: var(--text);
}

.waiting-body { flex: 1; padding: 1.5rem; max-width: 500px; margin: 0 auto; width: 100%; }

.waiting-title {
  font-size: .72rem; font-weight: 700; letter-spacing: .18em;
  color: var(--text-dim); text-transform: uppercase;
  margin-bottom: .85rem;
}

.waiting-players { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.5rem; }

.waiting-player {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); transition: border-color .2s;
}
.waiting-player.self { border-color: var(--border-hi); background: var(--surface2); }

.wp-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1rem; color: #0a0a10;
  flex-shrink: 0;
}
.wp-info { flex: 1; display: flex; align-items: center; gap: .5rem; }
.wp-name { font-weight: 700; font-size: .9rem; }
.wp-status { display: flex; align-items: center; }

.host-badge {
  font-size: .62rem; font-weight: 900;
  background: var(--gold-bg); border: 1px solid var(--gold-dim);
  color: var(--gold); padding: .15rem .45rem; border-radius: 5px;
}
.you-badge {
  font-size: .62rem; color: var(--sapphire-mid);
  background: var(--sapphire-bg); border: 1px solid var(--sapphire);
  padding: .15rem .45rem; border-radius: 5px;
}

.online-dot {
  width: 7px; height: 7px; border-radius: 50%;
}
.online-dot.on  { background: var(--emerald-mid); box-shadow: 0 0 5px rgba(39,174,96,.6); }
.online-dot.off { background: var(--text-faint); }

.waiting-actions { display: flex; flex-direction: column; gap: .75rem; }

.hint-text {
  font-size: .8rem; color: var(--text-dim); text-align: center;
}

.waiting-hint {
  display: flex; align-items: center; justify-content: center;
  gap: .75rem; padding: 1rem;
  font-size: .85rem; color: var(--text-dim);
}

.pulse-ring {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--gold-dim);
  animation: ringPulse 1.5s ease-in-out infinite;
}

.leave-btn {
  align-self: center; margin: 1rem 0 1.5rem;
}

/* ══════════════════════════════════════════════════════
   GAME BOARD
   ══════════════════════════════════════════════════════ */
.game-layout {
  display: flex; flex-direction: column;
  min-height: 100vh; overflow: hidden;
}

/* Top bar */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem 1rem;
  background: var(--surface); border-bottom: 1px solid var(--border);
  flex-shrink: 0; gap: .5rem;
}

.turn-chip {
  display: flex; align-items: center; gap: .45rem;
  font-size: .82rem; color: var(--text-mid);
  padding: .3rem .7rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px;
}
.turn-chip.my-turn {
  color: var(--gold-light);
  border-color: var(--gold-dim);
  background: var(--gold-bg);
  animation: glow 2s ease-in-out infinite;
}

.turn-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); animation: pulse 1.4s ease-in-out infinite;
}

.bank-chip {
  font-size: .82rem; color: var(--coin);
  display: flex; align-items: center; gap: .3rem;
  padding: .3rem .65rem;
  background: rgba(240,192,64,.07); border: 1px solid rgba(240,192,64,.2);
  border-radius: 20px;
}

.tb-right { display: flex; align-items: center; gap: .4rem; }
.room-tiny { font-size: .72rem; color: var(--text-dim); }

/* Players scroll */
.players-scroll {
  overflow-x: auto; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  scrollbar-width: none;
}
.players-scroll::-webkit-scrollbar { display: none; }

.players-row {
  display: flex; gap: .75rem;
  padding: .75rem 1rem; width: max-content;
}

.player-chip {
  display: flex; flex-direction: column; align-items: center;
  gap: .25rem; min-width: 64px; cursor: default;
  position: relative;
}

.pc-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.1rem; color: #050510;
  position: relative; transition: box-shadow .3s;
  flex-shrink: 0;
}

.pc-turn-ring {
  position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--gold);
  animation: ringPulse 1.5s ease-in-out infinite;
}

.pc-name {
  font-size: .68rem; font-weight: 700; text-align: center;
  color: var(--text-mid); max-width: 64px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.player-chip.self .pc-name { color: #80b0ff; }
.player-chip.active .pc-name { color: var(--gold-light); }
.player-chip.dead { opacity: .35; }

.pc-coins { font-size: .65rem; color: var(--coin); }

.pc-cards {
  display: flex; gap: 2px; align-items: center; justify-content: center;
}
.pc-card {
  width: 7px; height: 10px; border-radius: 2px; display: inline-block;
}
.pc-card.live { background: var(--gold-light); }
.pc-card.dead { background: var(--crimson-mid); }

.twin-badge {
  position: absolute; top: -4px; right: -8px;
  background: var(--gold); color: #0a0a00;
  font-size: .5rem; font-weight: 900;
  padding: 1px 4px; border-radius: 4px;
}

.dead-x {
  position: absolute; top: 0; left: 0; right: 0; bottom: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: var(--crimson-mid); opacity: .8;
}

/* Reaction bar */
.reaction-bar {
  background: rgba(80,20,20,.3);
  border-bottom: 1px solid rgba(139,26,26,.5);
  flex-shrink: 0;
  overflow: hidden;
}

.rb-timer {
  height: 3px; background: var(--surface3);
}
.rb-timer-fill {
  height: 100%; background: var(--gold);
  transition: width .25s linear;
}

.rb-content {
  display: flex; align-items: center; justify-content: space-between;
  padding: .65rem 1rem; gap: .75rem; flex-wrap: wrap;
}

.rb-text { font-size: .82rem; color: var(--text-mid); flex: 1; }
.rb-action { color: var(--gold-light); font-weight: 700; }

.rb-btns { display: flex; gap: .4rem; flex-wrap: wrap; }

.rb-done {
  font-size: .78rem; color: var(--emerald-mid);
  padding: .3rem .65rem; background: var(--emerald-bg);
  border-radius: 6px; border: 1px solid var(--emerald);
}
.rb-waiting { font-size: .78rem; color: var(--text-dim); }

/* Game body */
.game-body {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Section labels */
.section-label {
  font-size: .68rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: .6rem;
}

/* My hand */
.my-hand-section {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.my-hand-cards {
  display: flex; gap: .75rem; flex-wrap: wrap; align-items: stretch;
}

/* ── Card Slots ── */
.card-slots {
  display: flex; gap: .75rem;
}

@keyframes dealCard {
  0%   { opacity: 0; transform: translateY(-40px) rotate(-8deg) scale(.85); }
  60%  { transform: translateY(4px) rotate(1deg) scale(1.02); }
  80%  { transform: translateY(-2px) rotate(-.5deg) scale(1); }
  100% { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

@keyframes slotPulse {
  0%, 100% { border-color: var(--border); opacity: .5; }
  50%       { border-color: var(--border-mid); opacity: .8; }
}

@keyframes cardShine {
  0%   { left: -60%; opacity: 0; }
  20%  { opacity: .4; }
  100% { left: 120%; opacity: 0; }
}

.card-slot {
  width: 110px; min-height: 148px;
  border-radius: var(--radius);
  position: relative; flex-shrink: 0;
  transition: box-shadow .3s;
}

.card-slot.empty {
  border: 2px dashed var(--border);
  background: var(--surface2);
  animation: slotPulse 2s ease-in-out infinite;
}

.slot-pattern {
  position: absolute; inset: 0;
  border-radius: var(--radius);
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 6px,
    rgba(255,255,255,.015) 6px,
    rgba(255,255,255,.015) 12px
  );
}

.card-slot.filled {
  background: var(--surface2);
  border: 1px solid var(--border-mid);
  animation: dealCard .55s cubic-bezier(.34,1.56,.64,1) both;
  overflow: hidden;
}

.card-slot.filled:hover {
  box-shadow: 0 4px 20px rgba(201,168,76,.12);
  border-color: var(--border-hi);
}

.card-slot.filled.twins {
  border-color: var(--gold-dim);
  background: var(--gold-bg);
  box-shadow: 0 0 18px rgba(201,168,76,.12);
}

.card-slot.dead {
  border: 1px dashed var(--crimson);
  background: rgba(139,26,26,.08);
  opacity: .5;
}

.card-inner {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: .9rem .6rem; text-align: center;
  height: 100%; gap: .35rem;
}

.card-shine {
  position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  transform: skewX(-15deg);
  animation: cardShine .7s ease .3s both;
  pointer-events: none;
}

.hc-emoji { font-size: 1.6rem; line-height: 1; }
.hc-name {
  font-family: 'Amiri', serif;
  font-size: 1rem; color: var(--gold-light); font-weight: 700;
  line-height: 1.2;
}
.hc-id { font-size: .6rem; color: var(--text-faint); }

.twins-glow-badge {
  position: absolute; top: -7px; right: 50%; transform: translateX(50%);
  background: var(--gold); color: #0a0a00;
  font-size: .56rem; font-weight: 900;
  padding: 2px 7px; border-radius: 10px;
  white-space: nowrap; z-index: 2;
}

.coin-display {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  background: rgba(240,192,64,.07);
  border: 1px solid rgba(240,192,64,.2);
  border-radius: var(--radius);
  padding: .75rem .9rem; min-width: 72px;
}
.coin-big { font-size: 1.5rem; }
.coin-count { font-size: 1.3rem; font-weight: 900; color: var(--coin); }
.coin-label { font-size: .62rem; color: var(--text-dim); }

/* Actions */
.actions-section {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .5rem;
}

.action-card {
  display: flex; flex-direction: column; gap: .2rem;
  padding: .7rem .85rem;
  background: var(--surface2); border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all .15s;
  text-align: right; font-family: 'Cairo', sans-serif;
}
.action-card:hover:not(.disabled) {
  border-color: var(--border-hi);
  background: var(--surface3);
  transform: translateY(-1px);
}
.action-card.targeted { border-color: var(--sapphire-mid); }
.action-card.targeted:hover { background: rgba(26,42,74,.4); }

.ac-header {
  display: flex; align-items: center; justify-content: space-between;
}
.ac-name {
  font-family: 'Amiri', serif; font-size: 1.05rem;
  font-weight: 700; color: var(--gold-light);
}
.ac-cost { font-size: .72rem; color: var(--coin); font-weight: 700; }
.ac-desc { font-size: .7rem; color: var(--text-dim); }
.ac-role { font-size: .65rem; color: var(--text-faint); }
.ac-target-badge {
  font-size: .6rem; color: #80b0ff;
  background: var(--sapphire-bg); border: 1px solid var(--sapphire);
  padding: 1px 6px; border-radius: 5px; align-self: flex-start;
  margin-top: .2rem;
}

/* Waiting turn */
.waiting-turn {
  display: flex; align-items: center; justify-content: center;
  gap: .5rem; padding: 1rem;
  font-size: .82rem; color: var(--text-dim);
}
.wt-dots { display: flex; gap: .25rem; }
.wt-dots span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-dim);
  animation: wdot 1.4s ease-in-out infinite;
}
.wt-dots span:nth-child(2) { animation-delay: .16s; }
.wt-dots span:nth-child(3) { animation-delay: .32s; }

.eliminated-msg {
  padding: 1rem; text-align: center;
  font-size: .85rem; color: var(--crimson-mid);
}

/* Event log */
.log-section {
  padding: .85rem 1rem 1rem;
  flex: 1;
}
.event-log {
  display: flex; flex-direction: column; gap: .25rem;
  max-height: 200px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}

.log-entry {
  font-size: .78rem; color: var(--text-dim);
  padding: .3rem .5rem;
  border-bottom: 1px solid rgba(255,255,255,.03);
  display: flex; justify-content: space-between; gap: .5rem;
  line-height: 1.5;
}
.log-text { flex: 1; }
.log-time { font-size: .65rem; color: var(--text-faint); flex-shrink: 0; }

.log-gold  { color: var(--gold-light); }
.log-red   { color: #e06060; }
.log-green { color: #70d070; }
.log-blue  { color: #7090e0; }
.log-dim   { color: var(--text-faint); font-size: .72rem; }

/* ══════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.78); backdrop-filter: blur(8px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeUp .25s ease;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  max-width: 380px; width: 100%;
  position: relative;
}
.modal::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
  font-family: 'Amiri', serif; font-size: 1.4rem;
  color: var(--gold); text-align: center; margin-bottom: .4rem;
}
.modal-subtitle {
  font-size: .83rem; color: var(--text-dim);
  text-align: center; margin-bottom: 1rem;
}
.modal-question {
  font-size: .82rem; color: var(--text-dim);
  text-align: center; margin-bottom: .85rem;
}

.modal-actions {
  display: flex; gap: .5rem;
}
.modal-actions.three .btn { flex-direction: column; font-size: .78rem; }
.modal-actions.three .btn small {
  font-size: .65rem; font-weight: 400; opacity: .7;
}

/* Detective modal */
.detective-card-reveal {
  background: var(--surface2);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 1.2rem; text-align: center;
  margin-bottom: .75rem;
  animation: fadeUp .4s ease;
}
.dcr-emoji { font-size: 2.5rem; }
.dcr-name {
  font-family: 'Amiri', serif; font-size: 1.6rem;
  color: var(--gold); margin-top: .3rem;
}

/* Target list */
.target-list {
  display: flex; flex-direction: column; gap: .45rem; margin-bottom: .75rem;
}

.target-btn {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem .9rem;
  background: var(--surface2); border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all .15s; text-align: right;
  font-family: 'Cairo', sans-serif;
}
.target-btn:hover {
  border-color: var(--gold-dim);
  background: var(--surface3);
}

.tb-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: .95rem; color: #050510;
  flex-shrink: 0;
}
.tb-info { flex: 1; display: flex; flex-direction: column; gap: .1rem; }
.tb-name { font-weight: 700; font-size: .9rem; color: var(--text); }
.tb-stats { font-size: .68rem; color: var(--text-dim); }
.tb-arrow { color: var(--gold-dim); font-size: 1rem; }

/* ══════════════════════════════════════════════════════
   WIN SCREEN
   ══════════════════════════════════════════════════════ */
.win-page {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}

.win-confetti {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
}
.confetti-piece {
  position: absolute; top: -20px;
  animation: confettiFall ease-in forwards;
}

.win-content {
  display: flex; flex-direction: column; align-items: center;
  gap: 1.2rem; text-align: center;
  padding: 2rem 1rem; position: relative; z-index: 1;
  max-width: 420px; width: 100%;
}

.win-crown {
  font-size: 5rem;
  animation: float 3s ease-in-out infinite;
}
.win-title {
  font-family: 'Amiri', serif; font-size: 2.8rem;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(201,168,76,.6);
}
.win-name { font-size: 2rem; font-weight: 700; color: var(--text); }
.win-sub { font-size: .9rem; color: var(--text-mid); }

.win-log {
  width: 100%;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 180px; overflow-y: auto;
  padding: .5rem .75rem;
}

.win-actions { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }

/* ══════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════ */
.toast {
  position: fixed; top: 1rem; left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--gold-dim); color: var(--gold-light);
  padding: .6rem 1.2rem; border-radius: 10px;
  font-size: .83rem; z-index: 500;
  animation: fadeUp .3s ease;
  pointer-events: none; text-align: center; max-width: 280px;
  white-space: nowrap;
}
.toast-out { opacity: 0; transition: opacity .4s; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .actions-grid { grid-template-columns: repeat(2, 1fr); }
  .modal { padding: 1.4rem; }
  .lobby-card { padding: 1.4rem; }
}

@media (min-width: 768px) {
  .game-body { max-width: 720px; margin: 0 auto; width: 100%; }
  .waiting-body { max-width: 480px; }
}
