/* ==========================================================================
   العيان والميت - Two-Player Conversation Game Stylesheet
   Strict rule: NO EMOJIS ANYWHERE.
   Aesthetic: Dark, mysterious, deep burgundy & charcoal, warm off-white, gold line accents.
   ========================================================================== */

:root {
  --bg-primary: #0e0a0d;
  --bg-secondary: #171115;
  --bg-card: #20161b;
  --bg-card-hover: #291d23;
  --burgundy-deep: #3d0c18;
  --burgundy-main: #681126;
  --burgundy-bright: #941837;
  --burgundy-glow: rgba(148, 24, 55, 0.4);
  --gold-accent: #c89d56;
  --gold-soft: #e5c38c;
  --gold-glow: rgba(200, 157, 86, 0.25);
  --text-main: #f5ece7;
  --text-muted: #bdaaa0;
  --text-dark: #705e56;
  --border-subtle: rgba(200, 157, 86, 0.18);
  --border-focus: rgba(200, 157, 86, 0.6);
  --danger-color: #8a1f29;
  --success-color: #2e6243;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 12px 35px -8px rgba(0, 0, 0, 0.7), 0 0 1px 1px var(--border-subtle);
  --shadow-glow: 0 0 25px var(--burgundy-glow);
}

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

body {
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(61, 12, 24, 0.5) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(32, 22, 27, 0.8) 0%, transparent 50%),
    linear-gradient(180deg, #0a0709 0%, #130d11 100%);
  background-attachment: fixed;
  color: var(--text-main);
  direction: rtl;
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Background Atmosphere Grid Texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(200, 157, 86, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* --------------------------------------------------------------------------
   Typography & Headers
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.brand-header {
  text-align: center;
  margin-bottom: 24px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(200, 157, 86, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--gold-soft);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.game-title {
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 900;
  background: linear-gradient(135deg, #fff 20%, var(--gold-soft) 60%, var(--gold-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.15;
  margin-bottom: 10px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.tagline {
  color: var(--text-muted);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  max-width: 580px;
  margin: 0 auto 16px;
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Buttons & Interactive Elements
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  user-select: none;
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--burgundy-bright) 0%, var(--burgundy-main) 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(104, 17, 38, 0.45);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #b01f43 0%, var(--burgundy-bright) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(148, 24, 55, 0.55);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(32, 22, 27, 0.8);
  color: var(--gold-soft);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(45, 30, 38, 0.95);
  border-color: var(--gold-accent);
  color: #fff;
  transform: translateY(-2px);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-soft) 0%, var(--gold-accent) 100%);
  color: #12090d;
  font-weight: 700;
  box-shadow: 0 4px 16px var(--gold-glow);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(200, 157, 86, 0.45);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.btn-outline:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

.btn-danger {
  background: rgba(138, 31, 41, 0.2);
  color: #f7a8b0;
  border: 1px solid rgba(138, 31, 41, 0.5);
}

.btn-danger:hover {
  background: rgba(138, 31, 41, 0.45);
  color: #fff;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.15rem;
  border-radius: var(--radius-lg);
}

.btn-full {
  width: 100%;
}

/* --------------------------------------------------------------------------
   Cards & Containers
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.card-glowing {
  border-color: rgba(200, 157, 86, 0.35);
  box-shadow: var(--shadow-card), 0 0 30px rgba(104, 17, 38, 0.3);
}

/* Subtle corner ornament */
.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, rgba(200, 157, 86, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Landing Screen Components
   -------------------------------------------------------------------------- */
.landing-view {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.4s ease-out;
}

.landing-hero {
  text-align: center;
  padding: 24px 12px;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.rule-box {
  background: rgba(23, 17, 21, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rule-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(200, 157, 86, 0.12);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-soft);
}

.rule-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.rule-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Player Setup Screen
   -------------------------------------------------------------------------- */
.setup-view {
  max-width: 540px;
  margin: 20px auto;
  width: 100%;
}

.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-sublabel {
  font-size: 0.8rem;
  color: var(--text-dark);
}

.form-input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(14, 10, 13, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1.05rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--gold-accent);
  box-shadow: 0 0 0 3px rgba(200, 157, 86, 0.15);
  background: rgba(20, 14, 18, 0.95);
}

/* --------------------------------------------------------------------------
   Active Game Screen Layout
   -------------------------------------------------------------------------- */
.game-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.35s ease-out;
}

/* Top Status Bar: Turns & Controls */
.game-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: rgba(23, 17, 21, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
}

.turn-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-avatar-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--burgundy-bright), var(--burgundy-deep));
  border: 2px solid var(--gold-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 0 14px rgba(200, 157, 86, 0.3);
}

.turn-meta {
  display: flex;
  flex-direction: column;
}

.turn-subtitle {
  font-size: 0.78rem;
  color: var(--gold-soft);
  font-weight: 600;
}

.turn-player-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
}

.status-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Category Filter Tabs */
.categories-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.categories-tabs::-webkit-scrollbar {
  display: none;
}

.cat-tab {
  flex-shrink: 0;
  padding: 10px 18px;
  background: rgba(23, 17, 21, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-tab:hover {
  color: var(--text-main);
  background: rgba(35, 25, 31, 0.9);
  border-color: rgba(200, 157, 86, 0.3);
}

.cat-tab.active {
  background: linear-gradient(135deg, rgba(104, 17, 38, 0.6) 0%, rgba(61, 12, 24, 0.8) 100%);
  border-color: var(--gold-accent);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(104, 17, 38, 0.35);
}

.cat-badge-counter {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--gold-soft);
}

/* --------------------------------------------------------------------------
   Daring Mode Banner & Special Trigger
   -------------------------------------------------------------------------- */
.daring-mode-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(148, 24, 55, 0.25) 0%, rgba(20, 14, 18, 0.6) 100%);
  border: 1px solid rgba(148, 24, 55, 0.4);
  transition: all var(--transition-smooth);
}

.daring-mode-box.active {
  background: linear-gradient(90deg, rgba(148, 24, 55, 0.6) 0%, rgba(61, 12, 24, 0.85) 100%);
  border-color: var(--burgundy-bright);
  box-shadow: 0 0 25px rgba(148, 24, 55, 0.45);
}

.daring-info {
  display: flex;
  flex-direction: column;
}

.daring-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.daring-level-pill {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--burgundy-main);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.daring-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Main Question Card
   -------------------------------------------------------------------------- */
.question-card-container {
  perspective: 1000px;
  margin: 8px 0;
}

.question-card {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 34px 28px;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 0%, rgba(61, 12, 24, 0.35) 0%, var(--bg-card) 70%);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  position: relative;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s;
}

.question-card.anim-shuffle {
  animation: cardShuffle 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.question-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(200, 157, 86, 0.1);
  padding-bottom: 12px;
}

.card-category-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-counter {
  font-size: 0.8rem;
  color: var(--text-dark);
}

.question-text {
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 700;
  line-height: 1.5;
  color: #ffffff;
  text-align: center;
  margin: auto 0;
  padding: 16px 8px;
}

.question-card-footer {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

/* Question Action Buttons */
.game-actions-bar {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Answer & Counter-Question Views
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 7, 9, 0.88);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.modal-content {
  width: 100%;
  max-width: 600px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.modal-title {
  font-size: 1.35rem;
  color: var(--gold-soft);
}

.text-area-box {
  width: 100%;
  min-height: 110px;
  padding: 14px 18px;
  background: rgba(14, 10, 13, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
}

.text-area-box:focus {
  border-color: var(--gold-accent);
  box-shadow: 0 0 0 3px rgba(200, 157, 86, 0.15);
}

/* --------------------------------------------------------------------------
   Turn Shift Transition Overlay
   -------------------------------------------------------------------------- */
.turn-shift-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 10, 13, 0.95);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

.turn-shift-title {
  font-size: 1.1rem;
  color: var(--gold-soft);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.turn-shift-name {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 900;
  color: #fff;
  margin-bottom: 14px;
}

/* --------------------------------------------------------------------------
   Private Questions Section (أسئلتنا الخاصة)
   -------------------------------------------------------------------------- */
.private-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.player-selector-tabs {
  display: flex;
  border-radius: var(--radius-md);
  background: rgba(14, 10, 13, 0.8);
  border: 1px solid var(--border-subtle);
  padding: 4px;
  gap: 4px;
}

.player-tab-btn {
  flex: 1;
  padding: 12px;
  text-align: center;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.player-tab-btn.active {
  background: var(--burgundy-main);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.privacy-shield-banner {
  background: rgba(61, 12, 24, 0.3);
  border: 1px solid rgba(148, 24, 55, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.privacy-shield-text {
  font-size: 0.88rem;
  color: var(--gold-soft);
}

.private-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 8px 0;
}

.private-item {
  background: rgba(23, 17, 21, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all var(--transition-fast);
}

.private-item:hover {
  background: rgba(32, 22, 27, 0.9);
  border-color: rgba(200, 157, 86, 0.3);
}

.private-item-text {
  font-size: 1rem;
  color: var(--text-main);
  flex: 1;
}

.private-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Simple Line Icons (SVG replacement)
   -------------------------------------------------------------------------- */
.icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: middle;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes cardShuffle {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  50% { transform: translateY(-12px) scale(0.98); opacity: 0.7; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* --------------------------------------------------------------------------
   Media Queries & Responsiveness
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  #app {
    padding: 16px 12px 36px;
  }

  .card {
    padding: 20px 16px;
  }

  .question-card {
    padding: 24px 18px;
    min-height: 240px;
  }

  .game-actions-bar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .game-status-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .turn-indicator {
    justify-content: flex-start;
  }

  .status-actions {
    justify-content: space-between;
  }
}
