/* Espace Aventurier — shell Phase 0 (fantasy Atlanta, pas SaaS) */

.app-page {
  min-height: 100vh;
}

.app-login {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.app-login-card {
  width: min(420px, 100%);
  text-align: center;
  padding: 2rem 1.5rem;
}

.app-login-card h1 {
  font-family: var(--font-display);
  margin: 0.4rem 0 0.6rem;
}

.app-login-links {
  margin-top: 1.25rem;
}

.app-login-links a {
  color: var(--accent);
}

.app-error {
  color: #f0b4a8;
  background: rgba(196, 92, 74, 0.18);
  border: 1px solid rgba(196, 92, 74, 0.35);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  margin: 0.8rem 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  padding-bottom: 0;
}

.app-nav {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(28, 21, 16, 0.95), rgba(18, 14, 11, 0.92));
  padding: 1.1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.app-brand {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  padding: 0.35rem 0.5rem 0.8rem;
}

.app-brand strong {
  display: block;
  font-family: var(--font-display);
  letter-spacing: 0.03em;
}

.app-brand .muted {
  font-size: 0.82rem;
}

.app-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.app-nav-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  font: inherit;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.app-nav-item:hover {
  background: rgba(212, 181, 106, 0.1);
  transform: translateX(2px);
}

.app-nav-item.is-active {
  background: rgba(212, 181, 106, 0.18);
  color: var(--accent);
  box-shadow: inset 2px 0 0 var(--accent);
}

.app-logout {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  font: inherit;
}

.app-logout:hover {
  color: var(--ink);
  border-color: var(--accent);
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  padding: 1rem 1.25rem 0.5rem;
}

.app-menu-btn {
  display: none;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--ink);
  border-radius: 10px;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
}

.app-hero {
  flex: 1;
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(42, 33, 28, 0.9), rgba(24, 18, 14, 0.88));
  box-shadow: var(--shadow);
  transition: border-color 180ms ease;
}

.app-hero:hover {
  border-color: rgba(212, 181, 106, 0.35);
}

.app-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(212, 181, 106, 0.45);
  background: #2a211c;
}

.app-hero-meta h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.app-hero-meta .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.app-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.app-chip strong {
  color: var(--accent);
  font-weight: 600;
}

.app-xp {
  margin-top: 0.55rem;
  max-width: 280px;
}

.app-xp-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.app-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  transition: width 400ms ease;
}

.app-content {
  padding: 0.75rem 1.25rem 2rem;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.app-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 1rem 1.05rem;
  cursor: default;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.app-card.is-clickable {
  cursor: pointer;
}

.app-card.is-clickable:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 181, 106, 0.4);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.app-card h2 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.app-card .muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.app-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.app-list li {
  display: grid;
  gap: 0.2rem;
  padding: 0.45rem 0.2rem;
  border-bottom: 1px solid rgba(196, 163, 90, 0.08);
}

.app-list li:last-child {
  border-bottom: 0;
}

.app-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.app-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.app-progress > span {
  display: block;
  height: 100%;
  background: var(--ok);
}

.app-badge-done {
  color: var(--ok);
  font-size: 0.8rem;
}

.app-empty {
  padding: 1.2rem 0.4rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
}

.app-state-error {
  color: #f0b4a8;
}

.skeleton-block {
  min-height: 88px;
  position: relative;
  overflow: hidden;
}

.skeleton-block::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(243, 231, 211, 0.08), transparent);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-60%); }
  to { transform: translateX(60%); }
}

.app-bottom-nav {
  display: none;
}

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(8, 6, 4, 0.72);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.app-modal-card {
  width: min(560px, 100%);
  max-height: min(80vh, 720px);
  overflow: auto;
  padding: 1.25rem 1.25rem 1.5rem;
  position: relative;
}

.app-modal-close {
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.relic-serial {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--accent);
}

.timeline {
  border-left: 2px solid var(--line);
  margin: 0.8rem 0 0 0.4rem;
  padding-left: 0.9rem;
  display: grid;
  gap: 0.7rem;
}

.timeline-item strong {
  display: block;
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding-bottom: 4.5rem;
  }

  .app-nav {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 86vw);
    z-index: 30;
    transform: translateX(-105%);
    transition: transform 200ms ease;
    box-shadow: var(--shadow);
  }

  .app-page.nav-open .app-nav {
    transform: translateX(0);
  }

  .app-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }

  .app-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    background: rgba(18, 14, 11, 0.96);
    border-top: 1px solid var(--line);
    padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom));
  }

  .app-bottom-nav button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 1.2rem;
    padding: 0.55rem 0.2rem;
    border-radius: 10px;
    cursor: pointer;
  }

  .app-bottom-nav button.is-active {
    color: var(--accent);
    background: rgba(212, 181, 106, 0.12);
  }
}
