/* =========================================================
   DUEL.COM APP SHELL — visual system overlay
   ========================================================= */

body.duel-app {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(76, 111, 255, 0.12), transparent 55%),
    radial-gradient(900px 500px at 10% 20%, rgba(88, 40, 160, 0.08), transparent 50%),
    var(--bg);
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-w);
  transition: margin-left 0.25s ease;
}

body.sidebar-collapsed .app-main {
  margin-left: 72px;
}

/* ---- Sidebar ---- */
.duel-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1200;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, #0c101b 0%, #080a12 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0.85rem 0.75rem 1rem;
  gap: 0.75rem;
  overflow: hidden;
  transition: width 0.25s ease, transform 0.25s ease;
}

body.sidebar-collapsed .duel-sidebar {
  width: 72px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand .logo img {
  height: 24px;
  width: auto;
}

.sidebar-collapse {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sidebar-collapse:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none !important;
  transition: background 0.15s ease, color 0.15s ease;
}

.side-link:hover,
.side-link.active {
  background: rgba(76, 111, 255, 0.14);
  color: #fff;
}

.side-ico {
  width: 20px;
  height: 20px;
  display: inline-flex;
  flex-shrink: 0;
}

.side-ico svg {
  width: 20px;
  height: 20px;
}

body.sidebar-collapsed .side-link span:not(.side-ico),
body.sidebar-collapsed .sidebar-promo,
body.sidebar-collapsed .sidebar-chat,
body.sidebar-collapsed .sidebar-brand .logo {
  display: none;
}

body.sidebar-collapsed .side-link {
  justify-content: center;
  padding: 0.75rem;
}

.sidebar-promo {
  margin-top: 0.35rem;
  padding: 0.95rem;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(76, 111, 255, 0.22), rgba(20, 26, 42, 0.9));
  border: 1px solid rgba(76, 111, 255, 0.28);
}

.sidebar-promo-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.sidebar-promo p {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.btn-sm {
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  width: 100%;
}

.sidebar-chat {
  margin-top: auto;
  flex: 1;
  min-height: 140px;
  max-height: 280px;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  overflow: hidden;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.chat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2);
}

.chat-lines {
  flex: 1;
  overflow: hidden;
  padding: 0.55rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.chat-line {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.chat-line b {
  color: #c9d2ea;
  font-weight: 700;
  margin-right: 0.25rem;
}

.chat-input-fake {
  margin: 0.5rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ---- Header overrides ---- */
.duel-app .site-header {
  position: sticky;
  top: 0;
  background: rgba(8, 10, 18, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.duel-app .header-inner {
  width: min(100% - 1.5rem, var(--max));
  margin-inline: auto;
  gap: 0.75rem;
}

.duel-app .nav a {
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.88rem;
}

.duel-app .btn-login {
  background: #1a2236;
  border-radius: 10px;
  padding: 0.62rem 1.05rem;
}

.duel-app .btn-register,
.duel-app .btn-primary {
  background: var(--blue);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(76, 111, 255, 0.32);
}

.sidebar-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #151b2c;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
}

.sidebar-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.logo-mobile {
  display: none;
}

/* ---- Hero like duel.com ---- */
.duel-app .hero {
  position: relative;
  overflow: hidden;
  min-height: clamp(320px, 48vw, 520px);
  display: flex;
  align-items: flex-end;
  border-radius: 0;
  margin: 0;
}

.duel-app .hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(1.05) contrast(1.05);
}

.duel-app .hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 10, 18, 0.92) 0%, rgba(8, 10, 18, 0.55) 42%, rgba(8, 10, 18, 0.15) 70%, rgba(8, 10, 18, 0.35) 100%),
    linear-gradient(0deg, rgba(8, 10, 18, 0.85) 0%, transparent 45%);
  pointer-events: none;
}

.duel-app .hero-content {
  position: relative;
  z-index: 2;
  padding: 3.5rem 0 2.75rem;
  max-width: 640px;
}

.duel-app .hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(76, 111, 255, 0.18);
  border: 1px solid rgba(76, 111, 255, 0.35);
  color: #c9d4ff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.duel-app .hero-title,
.duel-app h1,
.duel-app h2,
.duel-app h3 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.duel-app .hero-title {
  font-size: clamp(2rem, 4.2vw, 3.35rem);
  line-height: 1.08;
  font-weight: 700;
  margin: 0 0 0.85rem;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.duel-app .hero-text {
  color: #d5dceb;
  font-size: 1.05rem;
  max-width: 36rem;
}

.originals-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.originals-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
}

.originals-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---- Originals-style game cards ---- */
.duel-app .game-card {
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #1a2236 0%, #101624 100%);
  border: 1px solid var(--border);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  transform: translateZ(0);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.duel-app .game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(76, 111, 255, 0.4);
  box-shadow: 0 18px 40px rgba(76, 111, 255, 0.18);
  text-decoration: none;
}

.duel-app .game-card img {
  aspect-ratio: 1 / 1.05;
  object-fit: cover;
  width: 100%;
}

.duel-app .game-card-body {
  padding: 0.85rem 0.95rem 1rem;
}

.duel-app .game-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}

.duel-app .mini-cta {
  color: var(--blue-hover);
  font-weight: 700;
  font-size: 0.82rem;
}

/* ---- Cards / sections ---- */
.duel-app .viz-card,
.duel-app .promo-card,
.duel-app .promo-hero,
.duel-app .wallet-demo,
.duel-app .cta-banner,
.duel-app .table-wrap,
.duel-app .knowhow-shell {
  background: rgba(20, 26, 42, 0.88);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22);
}

.duel-app section {
  padding: 2.75rem 0;
}

.duel-app .section-alt {
  background: transparent;
}

.duel-app .container {
  width: min(100% - 2rem, var(--max));
}

/* Mobile shell */
@media (max-width: 1100px) {
  .duel-app .nav {
    display: none;
  }

  .logo-mobile {
    display: flex;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .duel-sidebar {
    transform: translateX(-105%);
  }

  body.sidebar-open .duel-sidebar {
    transform: translateX(0);
    width: min(86vw, 300px);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.55);
  }

  .app-main,
  body.sidebar-collapsed .app-main {
    margin-left: 0;
  }

  body.sidebar-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1100;
  }
}

@media (max-width: 720px) {
  .duel-app .hero {
    min-height: 360px;
  }

  .duel-app .hero-content {
    padding: 2.4rem 0 1.8rem;
  }

  .duel-app .header-actions .btn-login {
    display: none;
  }
}
