/* ===== DESIGN TOKENS ===== */
:root {
    --color-bg:      #0E0C0A;
    --color-surface: #1A1612;
    --color-accent:  #C8872A;
    --color-text:    #F0E8D5;
    --color-muted:   #A89880;
    --color-pop:     #FF6B3D;
    --color-danger:  #8C3A2E;

    --font-display: "Bebas Neue", sans-serif;
    --font-accent:  "Cinzel", serif;
    --font-body:    "Inter", system-ui, -apple-system, sans-serif;
}

/* ===== GLOBAL ===== */
html {
    overflow-x: clip;  /* clip (not hidden) — avoids creating a scroll container that breaks position:sticky */
}

body {
    min-height: 100vh;
    width: 100%;         /* 100% excludes scrollbar; 100vw does not */
    font-family: var(--font-body);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    background-color: var(--color-bg);
    overflow-x: clip;
}

body::before {
    content: '';
    position: fixed;
    height: 100%;
    width: 100%;
    background: url('/images/brick-wall.jpg') center / cover;
    opacity: 0.3;
    z-index: -1;
}

h1 {
    font-family: var(--font-display);
    letter-spacing: 0.06em;
    color: var(--color-text);
}

h2, h3, h4, h5, h6 {
    font-family: var(--font-body);
    color: var(--color-text);
}

/* ===== LAYOUT ===== */
/*
 * Sticky-footer contract:
 *   body          → flex column, min-height 100vh
 *   .page-content → flex: 1 0 auto  (grows to fill gap, never shrinks below content height)
 *   footer        → flex-shrink: 0  (never compressed)
 *
 * .page is kept for any scaffold-generated views that use it as a wrapper;
 * we intentionally do NOT set justify-content: center here so it doesn't
 * fight the sticky-footer layout.
 */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100%;      /* relative to page-content, not the viewport */
}

.layout {
    flex: 1 0 auto;
}

/* Nav is top-fixed; height defined in navbar.css via --nav-height */
.page-content {
    flex: 1 0 auto;        /* grow to fill remaining space; never shrink below content */
    margin-left: 0;
    padding-top: var(--nav-height, 104px);
    padding-bottom: 2.5rem; /* breathing room — content never jams against the footer */
    width: 100%;
}

/* ===== BUTTONS ===== */
.btn-card {
    border-color: var(--color-accent) !important;
    background-color: unset !important;
    color: var(--color-accent) !important;
    font-family: var(--font-body);
    font-weight: 600;
    transition: filter 0.18s ease, box-shadow 0.18s ease;
}

.btn-card:hover {
    filter: brightness(1.15);
    box-shadow: 0 0 14px rgba(200, 135, 42, 0.45);
}

/* ===== NEON / DISPLAY TEXT ===== */
.neon-text {
    font-family: var(--font-display);
    color: var(--color-accent);
    text-shadow: 0 0 8px rgba(200, 135, 42, 0.5);
    letter-spacing: 0.06em;
}


/* ===== FORM CONTROLS ===== */
.form-control {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text);
    border-radius: 999px;
    caret-color: var(--color-accent);
    background-color: unset !important;
    border-color: var(--color-accent) !important;
}

.form-control:focus {
    background-color: unset !important;
    border-color: var(--color-accent) !important;
    outline: none;
    box-shadow: 0 0 5px rgba(200, 135, 42, 0.6) !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .page-content {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-bottom: 2rem;
        padding-top: var(--nav-height, 104px); /* keep nav clearance */
    }
}

/* ===== FOCUS RING (WCAG 2.4.7) ===== */
:focus-visible {
    outline: 2px solid var(--color-pop);
    outline-offset: 3px;
    border-radius: 3px;
}

.form-control:focus-visible {
    outline: none;
    box-shadow: 0 0 5px rgba(200, 135, 42, 0.6) !important;
}

.font-cinzel {
    font-family: var(--font-accent);
}


/* ===== ACCESSIBILITY ===== */
.skip-nav {
    position: absolute;
    left: -9999px;
    top: 1rem;
    z-index: 9999;
    padding: 0.5rem 1rem;
    background: var(--color-bg);
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
    font-weight: bold;
    text-decoration: none;
    font-family: var(--font-body);
}
.skip-nav:focus {
    left: 1rem;
    outline: 2px solid var(--color-accent);
}

::placeholder {
    color: var(--color-muted) !important;
    opacity: 1;
}

/* ===== LINK UNDERLINE (WCAG 1.4.1) ===== */
a:not(.btn):not(.nav-link):not(.account-link):not(.cart-icon-link):not(.skip-nav):not(.sidebar-menu a):not([class*="carousel"]):not(.product-link):not(.breadcrumb-nav a):not(.home-hero-games a):not(.product-card):not(.hero-game-logo):not(.btn-tile-action):not(.deck-new-cta):not(.filter-chip):not(.pm-card):not(.opt-back) {
    text-decoration: underline;
}
a:not(.btn):not(.nav-link):not(.account-link):not(.cart-icon-link):not(.skip-nav):not(.sidebar-menu a):not([class*="carousel"]):not(.product-link):not(.breadcrumb-nav a):not(.home-hero-games a):not(.product-card):not(.hero-game-logo):not(.btn-tile-action):not(.deck-new-cta):not(.filter-chip):not(.pm-card):not(.opt-back):hover {
    text-decoration: none;
}

/* ===== FOOTER ===== */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    font-family: var(--font-body);
    color: var(--color-muted);
}

/* ===== LEGAL PAGES ===== */
.legal-page {
    max-width: 860px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(26, 22, 18, 0.8);
    border: 1px solid rgba(200, 135, 42, 0.2);
    border-radius: 10px;
}

.legal-page h1 {
    margin-bottom: 0.25rem;
}

.legal-page h2 {
    color: var(--color-accent);
    font-size: 1.15rem;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(200, 135, 42, 0.2);
    padding-bottom: 0.25rem;
    font-family: var(--font-accent);
}

.legal-effective {
    color: var(--color-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.legal-notice {
    background: rgba(200, 135, 42, 0.1);
    border: 1px solid rgba(200, 135, 42, 0.4);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.legal-table th,
.legal-table td {
    text-align: left;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(200, 135, 42, 0.2);
}

.legal-table th {
    background: rgba(200, 135, 42, 0.1);
    color: var(--color-accent);
    font-weight: bold;
    font-family: var(--font-accent);
}

.legal-table tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.03);
}


/* ===== ART DECO SECTION DIVIDER ===== */
.section-divider {
    width: 100%;
    max-width: 640px;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.section-divider::before {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    background: var(--color-accent);
}
.section-divider::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: var(--color-accent);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
}

.toast {
    background: var(--color-surface);
    border-left: 4px solid var(--color-accent);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(8px);
    animation: toastIn 0.25s ease forwards;
    max-width: 320px;
}

.toast.toast-error {
    border-left-color: var(--color-danger);
}

.toast.toast-hide {
    animation: toastOut 0.3s ease forwards;
}

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

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-pop);
}

/* ===== PAGE CARD WRAPPER =====
 * A surface card that sits on top of the brick background.
 * Used on Decks, Collection, and similar app pages.
 * The brick shows as a thin border/gutter around the card.
 * ======================================================= */
.page-card {
  background: var(--color-surface);
  border: 1px solid rgba(200,135,42,0.12);
  border-radius: 12px;
  box-shadow: 0 6px 48px rgba(0,0,0,0.55);
  margin: 1.5rem auto;
  max-width: 1420px;
  width: calc(100% - 3rem);
  overflow: hidden;
}

/* Builder variant — fixed height so the two-column layout fills the card */
.builder-app-card {
  background: var(--color-surface);
  border: 1px solid rgba(200,135,42,0.12);
  border-radius: 12px;
  box-shadow: 0 6px 48px rgba(0,0,0,0.55);
  margin: 1rem auto;
  max-width: 1600px;
  width: calc(100% - 2rem);
  height: calc(100vh - var(--nav-height, 104px) - 2rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ===== PAGE FADE-IN ===== */
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}
#main-content {
    animation: pageFadeIn 250ms ease forwards;
}


/* ============================================================
   GLOBAL FORM ELEMENT THEMING — Obsidian Design System
   Overrides browser defaults for select, input[type=number],
   textarea, and plain input elements to match the dark/gold
   aesthetic across ALL pages.
   ============================================================ */

/* ── Select ── */
select:not(.form-select) {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--color-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23C8872A' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px 8px;
    border: 1px solid rgba(200,135,42,0.3);
    border-radius: 8px;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 0.5rem 2.2rem 0.5rem 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1.4;
}

select:not(.form-select):hover {
    border-color: rgba(200,135,42,0.6);
}

select:not(.form-select):focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(200,135,42,0.18);
}

select:not(.form-select) option {
    background: #1A1612;
    color: var(--color-text);
}

/* ── Number input ── */
input[type="number"] {
    background: var(--color-surface);
    border: 1px solid rgba(200,135,42,0.3);
    border-radius: 8px;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"]:hover {
    border-color: rgba(200,135,42,0.6);
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(200,135,42,0.18);
}

/* ── Text / email / password / search inputs (non-Bootstrap) ── */
input[type="text"]:not(.form-control):not([class*="form-"]),
input[type="email"]:not(.form-control):not([class*="form-"]),
input[type="password"]:not(.form-control):not([class*="form-"]),
input[type="search"]:not(.form-control):not([class*="form-"]) {
    background: var(--color-surface);
    border: 1px solid rgba(200,135,42,0.3);
    border-radius: 8px;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 0.5rem 0.85rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:not(.form-control):not([class*="form-"]):focus,
input[type="email"]:not(.form-control):not([class*="form-"]):focus,
input[type="password"]:not(.form-control):not([class*="form-"]):focus,
input[type="search"]:not(.form-control):not([class*="form-"]):focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(200,135,42,0.18);
}

/* ── Textarea (non-Bootstrap) ── */
textarea:not(.form-control):not([class*="form-"]) {
    background: var(--color-surface);
    border: 1px solid rgba(200,135,42,0.3);
    border-radius: 8px;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 0.65rem 0.85rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
}

textarea:not(.form-control):not([class*="form-"]):focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(200,135,42,0.18);
}
