/* ═══════════════════════════════════════════════════════
   Design tokens
   ═══════════════════════════════════════════════════════ */
:root {
    --bg-primary:    #0f172a;
    --bg-surface:    #1e293b;
    --bg-card:       #1e293b;
    --bg-alt:        #0d1526;
    --accent:        #6366f1;
    --accent-hover:  #4f46e5;
    --accent-light:  #818cf8;
    --text-primary:  #f1f5f9;
    --text-muted:    #94a3b8;
    --border:        #334155;
    --radius:        12px;
    --radius-sm:     8px;
    --shadow:        0 4px 24px rgba(0,0,0,0.4);
}

/* ═══════════════════════════════════════════════════════
   Base
   ═══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.25;
}

a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover { color: #fff; }

kbd {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.78em;
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
    background: var(--border);
    border: 1px solid #4b5563;
    border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════
   Bootstrap overrides
   ═══════════════════════════════════════════════════════ */
.btn-primary {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s, border-color 0.2s, transform 0.1s;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline-light {
    border-color: rgba(255,255,255,0.3);
    color: var(--text-primary);
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s, border-color 0.2s, transform 0.1s;
}
.btn-outline-light:hover {
    background-color: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.5);
    color: #fff;
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════
   Navbar
   ═══════════════════════════════════════════════════════ */
.site-navbar {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

.site-navbar .navbar-brand {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.site-navbar .navbar-brand:hover { color: #fff; }

.brand-icon { font-size: 1.25rem; }

.site-navbar .nav-link {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background-color 0.2s;
}
.site-navbar .nav-link:hover {
    color: var(--text-primary);
    background-color: rgba(255,255,255,0.06);
}

.site-navbar .navbar-toggler {
    border-color: var(--border);
    padding: 0.35rem 0.6rem;
}
.site-navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(148,163,184,1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ═══════════════════════════════════════════════════════
   Hero
   ═══════════════════════════════════════════════════════ */
.hero-section {
    min-height: calc(100vh - 58px);
    display: flex;
    align-items: center;
    padding: 100px 0 80px;
    background:
        radial-gradient(ellipse 80% 60% at 60% 0%, rgba(99,102,241,0.18) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 10% 80%, rgba(99,102,241,0.1) 0%, transparent 60%),
        var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.hero-badge {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.35);
    border-radius: 999px;
    color: var(--accent-light);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-title {
    font-size: clamp(2.4rem, 5vw, 3.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0.5rem 0 1rem;
    outline: none;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 480px;
    line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════
   Poker card display (hero visual)
   ═══════════════════════════════════════════════════════ */
.card-deck-display {
    position: relative;
    width: 300px;
    height: 220px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.poker-card {
    position: absolute;
    width: 90px;
    height: 130px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    transform-origin: bottom center;
    transition: transform 0.3s;
    user-select: none;
}

.card-center {
    z-index: 5;
    background: var(--accent);
    border-color: var(--accent-hover);
    color: #fff;
    box-shadow: 0 8px 40px rgba(99,102,241,0.45);
    transform: translateY(-12px);
}

.card-tilt-slight-left  { z-index: 4; transform: rotate(-6deg)  translateX(-30px) translateY(-4px); }
.card-tilt-left         { z-index: 3; transform: rotate(-14deg) translateX(-60px) translateY(8px); }
.card-tilt-slight-right { z-index: 4; transform: rotate(6deg)   translateX(30px)  translateY(-4px); }
.card-tilt-right        { z-index: 3; transform: rotate(14deg)  translateX(60px)  translateY(8px); }

/* ═══════════════════════════════════════════════════════
   Sections
   ═══════════════════════════════════════════════════════ */
.content-section {
    padding: 96px 0;
}

.alt-section {
    background: var(--bg-alt);
}

.section-title {
    font-size: clamp(1.75rem, 3vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 520px;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════
   Feature cards
   ═══════════════════════════════════════════════════════ */
.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(99,102,241,0.15);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    line-height: 1;
}

.feature-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-body {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.65;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════
   Screenshots
   ═══════════════════════════════════════════════════════ */
.screenshot-img {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.screenshot-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.screenshot-body {
    color: var(--text-muted);
    line-height: 1.75;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════
   How It Works steps
   ═══════════════════════════════════════════════════════ */
.steps-list {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.step-item {
    display: flex;
    gap: 1.5rem;
    position: relative;
    padding-bottom: 2.5rem;
}

.step-item:last-child { padding-bottom: 0; }

.step-item::before {
    content: '';
    position: absolute;
    left: 21px;
    top: 44px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.step-item:last-child::before { display: none; }

.step-number {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 4px rgba(99,102,241,0.15);
    position: relative;
    z-index: 1;
}

.step-content { padding-top: 0.5rem; }

.step-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.step-body {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.65;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════
   Requirements list (self-host)
   ═══════════════════════════════════════════════════════ */
.requirements-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.requirements-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.requirements-list strong { color: var(--text-primary); }

.req-icon {
    color: #10b981;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 1px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   Code card (self-host)
   ═══════════════════════════════════════════════════════ */
.code-card {
    background: #0d1117;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.code-card-header {
    background: #161b22;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.dot-red    { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green  { background: #10b981; }

.code-card-title {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
    font-weight: 500;
}

.code-block {
    margin: 0;
    padding: 1.5rem;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    color: #e6edf3;
    overflow-x: auto;
    white-space: pre;
}

.code-block code { background: none; padding: 0; color: inherit; }

.code-comment { color: #6e7681; }

/* ═══════════════════════════════════════════════════════
   Donate cards
   ═══════════════════════════════════════════════════════ */
.donate-section .section-subtitle {
    max-width: 560px;
}

.donate-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    transition: border-color 0.2s, transform 0.2s;
}

.donate-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}

.donate-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.donate-platform {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.donate-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.55;
    margin-bottom: 1.25rem;
}

/* ═══════════════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════════════ */
.site-footer {
    background: #070d1a;
    border-top: 1px solid var(--border);
    padding: 48px 0;
}

.footer-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.footer-links {
    font-size: 0.875rem;
}

.footer-links a {
    color: var(--text-muted);
    transition: color 0.2s;
}

.footer-links a:hover { color: var(--text-primary); }

.footer-sep {
    color: var(--border);
    margin: 0 0.5rem;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════
   Blazor loading / error UI
   ═══════════════════════════════════════════════════════ */
.wasm-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.loading-progress {
    display: block;
    width: 6rem;
    height: 6rem;
}

.loading-progress circle {
    fill: none;
    stroke: var(--border);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "Loading…");
}

#blazor-error-ui {
    color-scheme: dark;
    background: #1e293b;
    color: var(--text-primary);
    border-top: 1px solid #ef4444;
    bottom: 0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.4);
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
    font-size: 0.9rem;
}

#blazor-error-ui .reload {
    color: var(--accent-light);
    margin-left: 0.5rem;
    font-weight: 600;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════
   Responsive tweaks
   ═══════════════════════════════════════════════════════ */
@media (max-width: 991px) {
    .hero-section { padding: 64px 0 48px; min-height: auto; }
    .card-deck-display { width: 240px; height: 180px; }
    .poker-card { width: 72px; height: 106px; font-size: 1.4rem; }
    .card-tilt-slight-left  { transform: rotate(-6deg)  translateX(-24px) translateY(-4px); }
    .card-tilt-left         { transform: rotate(-14deg) translateX(-48px) translateY(8px); }
    .card-tilt-slight-right { transform: rotate(6deg)   translateX(24px)  translateY(-4px); }
    .card-tilt-right        { transform: rotate(14deg)  translateX(48px)  translateY(8px); }
    .content-section { padding: 64px 0; }
}

@media (max-width: 575px) {
    .hero-section { text-align: center; }
    .hero-subtitle { margin: 0 auto; }
    .hero-section .d-flex { justify-content: center; }
}
