/* WoOOL Public Portal — customer-facing site */

.portal-site {
  --portal-gold: #c9a44a;
  --portal-gold-bright: #e8c56a;
  --portal-gold-dim: rgba(201, 164, 74, 0.18);
  --portal-ember: #8b3a12;
  --portal-center: #060b14;
  --portal-glass: rgba(8, 14, 28, 0.88);
  --portal-scene-width: min(28vw, 420px);
  min-height: 100vh;
  background: var(--portal-center);
  color: var(--text);
}

.portal-scene {
  position: fixed;
  top: 0;
  bottom: 0;
  width: var(--portal-scene-width);
  background-image: url('/portal/assets/scene.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
  opacity: 0.92;
}

.portal-scene::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(6, 11, 20, 0.15) 0%,
    rgba(6, 11, 20, 0.55) 45%,
    rgba(6, 11, 20, 0.95) 100%
  );
}

.portal-scene-right::after {
  background: linear-gradient(
    270deg,
    rgba(6, 11, 20, 0.95) 0%,
    rgba(6, 11, 20, 0.55) 55%,
    rgba(6, 11, 20, 0.15) 100%
  );
}

.portal-scene-left {
  left: 0;
}

.portal-scene-right {
  right: 0;
  background-position: center top;
}

.portal-shell {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px 48px;
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────────────── */
.portal-header {
  position: sticky;
  top: 0;
  z-index: 50;
  margin: 0 -20px 28px;
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(6, 11, 20, 0.97) 0%, rgba(6, 11, 20, 0.82) 100%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201, 164, 74, 0.15);
}

.portal-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.portal-brand img {
  height: 56px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.6));
}

.portal-brand-text {
  display: none;
}

.portal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.portal-nav a {
  display: inline-block;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: color var(--duration) var(--ease),
    background var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

.portal-nav a:hover {
  color: var(--portal-gold-bright);
  background: var(--portal-gold-dim);
  border-color: rgba(201, 164, 74, 0.25);
}

.portal-nav a.active {
  color: #1a1208;
  background: linear-gradient(180deg, var(--portal-gold-bright) 0%, var(--portal-gold) 100%);
  border-color: var(--portal-gold);
  box-shadow: 0 2px 12px rgba(201, 164, 74, 0.35);
}

/* ── Hero (home) ───────────────────────────────────────────────── */
.portal-hero {
  text-align: center;
  padding: 8px 0 32px;
}

.portal-hero-tag {
  display: inline-block;
  padding: 5px 14px;
  margin-bottom: 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--portal-gold-bright);
  background: var(--portal-gold-dim);
  border: 1px solid rgba(201, 164, 74, 0.3);
  border-radius: var(--radius-pill);
}

.portal-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1.25;
}

.portal-hero p {
  margin: 0 auto;
  max-width: 520px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.portal-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
}

.portal-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.portal-btn:hover {
  transform: translateY(-1px);
}

.portal-btn-primary {
  color: #1a1208;
  background: linear-gradient(180deg, var(--portal-gold-bright) 0%, var(--portal-gold) 55%, #a67c2e 100%);
  border-color: var(--portal-gold);
  box-shadow: 0 4px 20px rgba(201, 164, 74, 0.35);
}

.portal-btn-primary:hover {
  box-shadow: 0 6px 28px rgba(201, 164, 74, 0.45);
}

.portal-btn-ghost {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.portal-btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-bright);
}

/* ── Content card ───────────────────────────────────────────────── */
.portal-card {
  background: var(--portal-glass);
  border: 1px solid rgba(201, 164, 74, 0.12);
  border-radius: var(--radius-lg);
  padding: 24px 28px 28px;
  box-shadow:
    var(--shadow-lg),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
}

.portal-card h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}

.portal-card .portal-card-sub {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--muted);
}

/* ── Status stat grid ───────────────────────────────────────────── */
.portal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.portal-stat {
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
}

.portal-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--portal-gold-bright);
  line-height: 1.2;
}

.portal-stat-value.online {
  color: var(--success);
}

.portal-stat-value.offline {
  color: var(--muted);
}

.portal-stat-label {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.portal-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-pill);
}

.portal-status-pill.online {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.portal-status-pill.offline {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.portal-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* ── Coming soon / placeholder ──────────────────────────────────── */
.portal-coming {
  text-align: center;
  padding: 40px 20px;
}

.portal-coming-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.85;
}

.portal-coming h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: var(--text);
}

.portal-coming p {
  margin: 0 auto;
  max-width: 400px;
  color: var(--muted);
  font-size: 14px;
}

/* ── Footer ─────────────────────────────────────────────────────── */
.portal-footer {
  margin-top: 40px;
  padding-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border-dim);
}

.portal-footer a {
  color: var(--portal-gold);
  text-decoration: none;
}

.portal-footer a:hover {
  text-decoration: underline;
}

/* ── Leaderboard / tables inside portal ─────────────────────────── */
.portal-card .user-table a {
  color: var(--portal-gold-bright);
  font-weight: 500;
}

.portal-card .user-table a:hover {
  color: var(--portal-gold);
}

/* Armory inside portal card */
.portal-card #out.armory-wide {
  margin: 0 -8px;
}

/* ── Home extras ────────────────────────────────────────────────── */
.portal-home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 8px;
}

@media (max-width: 720px) {
  .portal-home-grid {
    grid-template-columns: 1fr;
  }
}

.portal-panel {
  padding: 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.portal-panel h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-family: 'Cinzel', serif;
  color: var(--portal-gold-bright);
}

.portal-feature-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.portal-feature-link {
  display: block;
  padding: 14px;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

.portal-feature-link:hover {
  color: var(--portal-gold-bright);
  border-color: rgba(201, 164, 74, 0.4);
}

.portal-feature-link strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 4px;
}

.portal-mini-table {
  width: 100%;
  font-size: 13px;
}

.portal-mini-table td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--border-dim);
}

.portal-mini-table a {
  color: var(--portal-gold-bright);
  text-decoration: none;
  font-weight: 500;
}

.portal-mini-table a:hover {
  text-decoration: underline;
}

/* ── Achievements grid ──────────────────────────────────────────── */
.portal-ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.portal-ach-card {
  padding: 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.portal-ach-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-family: 'Cinzel', serif;
  color: var(--portal-gold-bright);
}

.portal-ach-desc {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.portal-ach-table {
  margin-top: 4px;
}

.portal-ach-table th {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: left;
  padding-bottom: 6px;
}

.portal-ach-rank {
  width: 28px;
  font-weight: 700;
  color: var(--muted);
}

.portal-ach-rank-gold {
  color: #f0c14b;
}

.portal-ach-rank-silver {
  color: #c0c0c0;
}

.portal-ach-rank-bronze {
  color: #cd7f32;
}

.portal-ach-value {
  font-weight: 600;
  color: var(--portal-gold-bright);
  text-align: right;
  white-space: nowrap;
}

.portal-ach-empty {
  margin: 0;
  font-size: 13px;
}

/* ── Trust merchant grid ────────────────────────────────────────── */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.trust-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.trust-card:hover {
  border-color: rgba(201, 164, 74, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.trust-card.expired {
  opacity: 0.65;
  border-color: var(--border-dim);
}

.trust-card.expired .trust-price {
  color: var(--muted);
}

.trust-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-xs);
  cursor: default;
}

.trust-icon img {
  max-width: 40px;
  max-height: 40px;
  image-rendering: pixelated;
  object-fit: contain;
}

.trust-icon.empty {
  opacity: 0.35;
}

.trust-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.trust-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.trust-price {
  color: var(--portal-gold-bright);
  font-weight: 600;
}

/* ── Responsive: hide side art on narrow screens ────────────────── */
@media (max-width: 1100px) {
  .portal-scene {
    display: none;
  }

  .portal-shell {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .portal-brand img {
    height: 44px;
  }

  .portal-nav {
    width: 100%;
    justify-content: center;
  }

  .portal-nav a {
    padding: 6px 10px;
    font-size: 12px;
  }

  .portal-card {
    padding: 18px 16px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-scene {
    transform: none !important;
  }
}
