/* Mode selection page — parchment manuscript style */

/* ── Parchment body ── */
body:has(.mode-select) {
  background:
    repeating-conic-gradient(
      rgba(120, 90, 50, 0.03) 0% 25%,
      transparent 0% 50%
    ) 0 0 / 4px 4px,
    radial-gradient(ellipse at 0% 0%, rgba(90, 60, 30, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 0%, rgba(100, 65, 25, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 0% 100%, rgba(95, 60, 30, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 100% 100%, rgba(90, 55, 25, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 40%, #efe3cd 0%, #e2d3b8 40%, #d4c4a4 80%);
  color: #3a2a14;
}
body:has(.mode-select)::before { display: none; }

/* ── Nav overrides ── */
body:has(.mode-select) .app-nav { border-bottom: 1px solid rgba(138, 115, 84, 0.3); }
body:has(.mode-select) .app-nav-home { color: #7a6548; }
body:has(.mode-select) .app-nav-home:hover { color: #3a2a14; }
body:has(.mode-select) .app-nav-user { color: #7a6548; }
body:has(.mode-select) .app-nav-tokens { color: #9a8568; }
body:has(.mode-select) .app-nav-signout { border-color: #b5a382; color: #7a6548; }
body:has(.mode-select) .app-nav-signout:hover { color: #3a2a14; border-color: #8a7354; }
body:has(.mode-select) .app-nav-locale { border-color: #b5a382; color: #7a6548; }
body:has(.mode-select) .app-nav-locale:hover { color: #3a2a14; border-color: #8a7354; }

/* ── Header ── */
.mode-select {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  animation: modeReveal 0.8s ease-out both;
}

@keyframes modeReveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mode-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  position: relative;
}
.mode-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    #a0895e 20%,
    #8a7354 50%,
    #a0895e 80%,
    transparent 100%
  );
  opacity: 0.5;
}
.mode-header h1 {
  font-family: 'Cinzel', 'Palatino Linotype', serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #3a2a14;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 245, 220, 0.5);
}
.mode-header p {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  color: #7a6548;
  font-size: 0.88rem;
  margin-top: 0.5rem;
  letter-spacing: 0.04em;
}

/* ── Cards container ── */
.mode-cards {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* ── Individual card — 3:1 aspect ratio ── */
.mode-card {
  flex: 1;
  max-width: 220px;
  aspect-ratio: 1 / 3;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(138, 115, 84, 0.35);
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: flex-end;
  transition: border-color 0.4s ease, transform 0.4s ease;
}
.mode-card:hover {
  border-color: rgba(138, 115, 84, 0.7);
  transform: translateY(-4px);
}

/* ── Background images via CSS gradients ── */
.mode-card-overlay {
  position: absolute;
  inset: 0;
  transition: opacity 0.4s ease;
}

/* Scenarios */
.mode-card--scenarios .mode-card-overlay {
  background:
    linear-gradient(180deg, transparent 0%, rgba(30, 20, 10, 0.8) 75%),
    url("/scenarios_button.jpg") center / cover no-repeat;
}

/* Random */
.mode-card--random .mode-card-overlay {
  background:
    linear-gradient(180deg, transparent 0%, rgba(15, 10, 25, 0.8) 75%),
    url("/random_button.jpg") center / cover no-repeat;
}

/* Custom */
.mode-card--custom .mode-card-overlay {
  background:
    linear-gradient(180deg, transparent 0%, rgba(40, 35, 30, 0.8) 75%),
    url("/custom_button.jpg") center / cover no-repeat;
}

.mode-card:hover .mode-card-overlay {
  opacity: 0.85;
}

/* ── Card content ── */
.mode-card-content {
  position: relative;
  z-index: 1;
  padding: 1.2rem;
  width: 100%;
}

.mode-card-label {
  display: block;
  font-family: 'Cinzel', 'Palatino Linotype', serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #f0e8d8;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  margin-bottom: 0.3rem;
}

.mode-card-desc {
  display: block;
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  font-size: 0.7rem;
  color: rgba(240, 232, 216, 0.6);
  line-height: 1.4;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ── Disabled state ── */
.mode-card--disabled {
  cursor: default;
  opacity: 0.5;
}
.mode-card--disabled:hover {
  border-color: rgba(138, 115, 84, 0.35);
  transform: none;
}
.mode-card--disabled:hover .mode-card-overlay {
  opacity: 1;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .mode-cards {
    flex-direction: row;
    gap: 0.75rem;
  }
  .mode-card {
    max-width: none;
  }
  .mode-card-label {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
  }
  .mode-card-desc {
    font-size: 0.62rem;
  }
  .mode-card-content {
    padding: 0.8rem;
  }
}
