/* ============================================================
   MAIN.CSS — Selection Screen Styles
   Optimised for iPad Safari Portrait (768 × 1024+)
   Theme: Premium / Luxury Dark
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg-deep:        #07071a;
  --bg-mid:         #0f0f2d;
  --accent-gold:    #d4af37;
  --accent-gold-lt: #f4d03f;
  --accent-gold-dk: #a07d1a;
  --glass-bg:       rgba(255, 255, 255, 0.055);
  --glass-border:   rgba(255, 255, 255, 0.10);
  --glass-hover:    rgba(255, 255, 255, 0.10);
  --text-primary:   #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-muted:     rgba(255, 255, 255, 0.35);
  --shadow-lg:      0 20px 60px rgba(0, 0, 0, 0.55);
  --radius-card:    20px;
  --radius-btn:     14px;
  --transition:     0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  background: linear-gradient(160deg, #07071a 0%, #130d28 45%, #0a1830 100%);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

/* Subtle animated background particles */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 10%, rgba(212,175,55,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 80% 90%, rgba(79,172,254,0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Header ───────────────────────────────────────────────── */
.app-header {
  position: relative;
  z-index: 1;
  padding: 50px 28px 24px;
  text-align: center;
}

.header-crown {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(212,175,55,0.1);
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: 30px;
  padding: 6px 18px;
  margin-bottom: 16px;
}

.header-crown svg {
  width: 16px;
  height: 16px;
  color: var(--accent-gold);
}

.header-crown span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.app-title {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 30%, var(--accent-gold-lt) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 8px;
}

.app-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  position: relative;
  z-index: 1;
  padding: 0 20px 40px;
}

/* ── Section Labels ───────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  margin-top: 32px;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(212,175,55,0.35), transparent);
}

/* ── CEO Grid ─────────────────────────────────────────────── */
.ceo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Product Grid ─────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  position: relative;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  user-select: none;
}

.card:active {
  transform: scale(0.96);
}

.card.selected {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px rgba(212,175,55,0.35), var(--shadow-lg);
}

.card.selected::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  background: var(--accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #0a0a1a;
  z-index: 5;
  line-height: 26px;
  text-align: center;
}

/* CEO card image — tall portrait */
.card.ceo-card .card-img-wrap {
  height: 260px;
  background: rgba(0,0,0,0.3);
}

/* Product card image — square */
.card.product-card .card-img-wrap {
  height: 160px;
  background: rgba(0,0,0,0.15);
}

.card-img-wrap {
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transition: transform var(--transition);
  padding: 10px;
}

.card:active .card-img-wrap img {
  transform: scale(0.97);
}

/* CEO images: object-cover for realistic portrait crop */
.card.ceo-card .card-img-wrap img {
  object-fit: cover;
  object-position: center top;
  padding: 0;
}

.card-body {
  padding: 12px 14px 14px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ceo-card .card-name {
  font-size: 15px;
}

.btn-select {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-btn);
  background: linear-gradient(135deg, var(--accent-gold-dk), var(--accent-gold));
  color: #0a0a1a;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}

.btn-select:active {
  opacity: 0.8;
  transform: scale(0.97);
}

.card.selected .btn-select {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-lt));
}

/* ── Scroll hint ──────────────────────────────────────────── */
.scroll-hint {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ── Sticky footer CTA ────────────────────────────────────── */
#start-btn-wrap {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 24px calc(env(safe-area-inset-bottom, 0px) + 16px);
  background: linear-gradient(0deg, rgba(7,7,26,0.97) 0%, rgba(7,7,26,0.85) 70%, transparent 100%);
  z-index: 100;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#start-btn-wrap.visible {
  transform: translateY(0);
}

#start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 20px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent-gold-dk) 0%, var(--accent-gold-lt) 100%);
  color: #0a0a1a;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(212,175,55,0.45);
  transition: transform 0.15s, box-shadow 0.2s;
}

#start-btn:active {
  transform: scale(0.97);
  box-shadow: 0 4px 16px rgba(212,175,55,0.3);
}

#start-btn svg {
  width: 22px;
  height: 22px;
}

/* Selected name badge in start button */
#selected-label {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.75;
  display: block;
  margin-top: 2px;
}

/* ── Loading State ────────────────────────────────────────── */
.loading-spinner {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  gap: 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.loading-spinner .spinner-ring {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(212,175,55,0.2);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Safe-area padding at bottom of scrollable content ─────── */
.scroll-pad {
  height: 110px;
}

/* Prevent double-tap zoom on iOS */
button, a, .card {
  touch-action: manipulation;
}
