/* Games index / dashboard — parchment manuscript style */

/* ── Parchment body ── */
body:has(.dashboard) {
  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;
}

/* Hide the dark theme background-image overlay */
body:has(.dashboard)::before { display: none; }

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

/* ── Flash overrides ── */
body:has(.dashboard) .flash-notice {
  background: rgba(106, 138, 120, 0.12);
  border-color: #8a7354;
  color: #3a2a14;
}
body:has(.dashboard) .flash-alert {
  background: rgba(138, 64, 64, 0.1);
  border-color: #9a6040;
  color: #6a3020;
}

/* ── Dashboard layout ── */
.dashboard {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem 0;
  animation: dashReveal 0.8s ease-out both;
}

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

/* ── Header ── */
.dashboard-header {
  display: flex;
  justify-content: center;
  align-items: baseline;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: none;
  position: relative;
}
.dashboard-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;
}
.dashboard-title {
  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);
}

/* ── Section labels ── */
.dashboard-section-label {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  color: #9a8568;
  text-transform: uppercase;
  margin: 2rem 0 0.75rem;
}

/* ── Game cards ── */
.game-card {
  border: 1px solid rgba(138, 115, 84, 0.3);
  background: rgba(239, 227, 205, 0.35);
  padding: 0.85rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.game-card:hover {
  background: rgba(239, 227, 205, 0.55);
  border-color: rgba(138, 115, 84, 0.5);
}

.game-card-info { flex-basis: 100%; min-width: 0; }
.game-card-scenario {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: #3a2a14;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-card-meta {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  font-size: 0.72rem;
  color: #8a7354;
  margin-top: 0.2rem;
}

.game-card-status {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  padding: 0.15rem 0.5rem;
  border: 1px solid rgba(138, 115, 84, 0.3);
  color: #9a8568;
  flex-shrink: 0;
}
.game-card-status.completed { color: #5a7a60; border-color: rgba(90, 122, 96, 0.4); }
.game-card-status.failed    { color: #8a4a3a; border-color: rgba(138, 74, 58, 0.3); }

.game-card-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

/* ── Button overrides for parchment ── */
body:has(.dashboard) .btn {
  border-color: #b5a382;
  color: #5a4a30;
  background: transparent;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  padding: 0.45rem 1rem;
  transition: all 0.3s ease;
}
body:has(.dashboard) .btn:hover {
  background: rgba(138, 115, 84, 0.12);
  border-color: #8a7354;
  color: #3a2a14;
}
body:has(.dashboard) .btn-primary {
  background: rgba(90, 74, 48, 0.1);
  border-color: #8a7354;
  color: #3a2a14;
}
body:has(.dashboard) .btn-primary:hover {
  background: rgba(90, 74, 48, 0.2);
}
body:has(.dashboard) .btn-danger {
  border-color: rgba(138, 74, 58, 0.3);
  color: #9a5a4a;
  font-size: 0.65rem;
  padding: 0.3rem 0.7rem;
}
body:has(.dashboard) .btn-danger:hover {
  background: rgba(138, 64, 58, 0.1);
  color: #7a3a2a;
}
body:has(.dashboard) .btn-subtle {
  border-color: rgba(138, 115, 84, 0.2);
  color: #9a8568;
  font-size: 0.65rem;
  padding: 0.3rem 0.7rem;
}
body:has(.dashboard) .btn-subtle:hover {
  color: #5a4a30;
  border-color: rgba(138, 115, 84, 0.4);
}

.game-card-actions { margin-left: auto; }

/* ── Empty state ── */
.dashboard-empty {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  color: #8a7354;
  font-size: 0.85rem;
  padding: 2rem 0;
  text-align: center;
}

/* ── AI content notice ── */
.dashboard-notice {
  border: 1px solid rgba(138, 115, 84, 0.3);
  background: rgba(239, 227, 205, 0.35);
  padding: 1.5rem 1.5rem;
  margin-top: 1.5rem;
  text-align: center;
}
.dashboard-notice p {
  font-family: 'Lora', Georgia, serif;
  font-size: 0.78rem;
  line-height: 1.6;
  color: #5a4a30;
  margin: 0 0 0.75rem;
}
.dashboard-notice p:last-child { margin-bottom: 0; }
.dashboard-notice-heading {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #3a2a14;
  margin-bottom: 1rem;
}
.dashboard-notice-consent {
  font-style: italic;
  font-size: 0.72rem;
  color: #8a7354;
}
.dashboard-notice-consent a {
  color: #5a4a30;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.dashboard-notice-consent a:hover {
  color: #3a2a14;
}

/* ── Actions footer ── */
.dashboard-actions {
  margin-top: 2rem;
  text-align: center;
}

/* ── Saves page (inherits parchment when inside dashboard context) ── */
.saves-page { max-width: 600px; margin: 3rem auto; }
.saves-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(138, 115, 84, 0.3);
}
.saves-title {
  font-family: 'Cinzel', 'Palatino Linotype', serif;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: #3a2a14;
}
.save-card {
  border: 1px solid rgba(138, 115, 84, 0.3);
  background: rgba(239, 227, 205, 0.35);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}
.save-card-info { flex: 1; min-width: 0; }
.save-card-label {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: #3a2a14;
}
.save-card-meta {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  font-size: 0.72rem;
  color: #8a7354;
  margin-top: 0.15rem;
}
