/* Fenomen — outbid.lol inspired design */

:root {
    --bg: #fefbf8;
    --bg-card: #ffffff;
    --bg-muted: #f5f1ec;
    --bg-hover: #faf7f4;
    --text: #1c1917;
    --text-muted: #78716c;
    --text-soft: #a8a29e;
    --border: #e7e0d8;
    --border-strong: #d6d0c8;
    --accent: #e85d4a;
    --accent-hover: #d14a38;
    --accent-soft: #fdeee9;
    --accent-text: #c2410c;
    --green: #22c55e;
    --shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 4px 16px rgba(28, 25, 23, 0.04);
    --radius: 999px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --max: 720px;
}

[data-theme="dark"] {
    --bg: #141210;
    --bg-card: #1c1917;
    --bg-muted: #292524;
    --bg-hover: #231f1d;
    --text: #fafaf9;
    --text-muted: #a8a29e;
    --text-soft: #78716c;
    --border: #3f3a36;
    --border-strong: #57534e;
    --accent: #f07159;
    --accent-hover: #e85d4a;
    --accent-soft: #3b2520;
    --accent-text: #fdba74;
    --shadow: 0 1px 2px rgba(0,0,0,0.2), 0 4px 16px rgba(0,0,0,0.25);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.site-header {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    margin-right: auto;
}

.brand-bars {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bar {
    display: block;
    height: 3px;
    border-radius: 2px;
    background: var(--text);
}

.bar-1 { width: 18px; background: var(--accent); }
.bar-2 { width: 14px; }
.bar-3 { width: 10px; }

.brand-name { text-transform: lowercase; }

.nav {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    transition: color 0.15s, background 0.15s;
}

.nav-link:hover { color: var(--text); background: var(--bg-muted); }
.nav-link.active { color: var(--text); font-weight: 600; }

.theme-toggle {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Live pill */
.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 1.25rem auto 0;
    padding: 0.45rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.78rem;
    color: var(--text-muted);
    box-shadow: var(--shadow);
    width: fit-content;
    left: 50%;
    transform: translateX(-50%);
    position: relative;
}

.live-dot {
    width: 7px;
    height: 7px;
    background: var(--green);
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* Claim section */
.claim-section {
    text-align: center;
    padding: 2rem 0 1.5rem;
}

.claim-title {
    font-size: clamp(1.75rem, 5vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.75rem;
}

.amount-stepper {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.step-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, color 0.15s;
}

.step-btn:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.step-btn:disabled,
.step-btn.is-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.claim-amount {
    color: var(--accent);
    font-weight: 800;
    min-width: 5rem;
    text-align: center;
}

.claim-hint,
.claim-subhint {
    font-size: 0.875rem;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto 1.25rem;
    line-height: 1.55;
}

.claim-subhint { margin-top: 0.75rem; margin-bottom: 0; font-size: 0.8rem; }

/* Bid bar — outbid style single row */
.bid-bar { margin-top: 0.5rem; }

.bid-bar-main {
    display: flex;
    align-items: stretch;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.field-group {
    display: flex;
    align-items: center;
    border-right: 1px solid var(--border);
    min-width: 0;
}

.handle-group {
    flex: 1.2;
    padding: 0 0.85rem;
}

.field-icon {
    color: var(--text-soft);
    font-weight: 600;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.handle-group input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 1rem 0.5rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    outline: none;
    min-width: 0;
}

.handle-group input::placeholder { color: var(--text-soft); }

.select-group { flex: 1; }

.select-group select {
    width: 100%;
    border: none;
    background: transparent;
    padding: 1rem 0.85rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-muted);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2rem;
}

.outbid-submit {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0 1.75rem;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
}

.outbid-submit:hover { background: var(--accent-hover); }
.outbid-submit:disabled { opacity: 0.65; cursor: not-allowed; }

.bid-bar-extra {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.bid-bar-extra input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
    font-family: inherit;
    color: var(--text);
    outline: none;
}

.bid-bar-extra input:focus { border-color: var(--accent); }
.bid-bar-extra input::placeholder { color: var(--text-soft); }

.btn-loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-loader.hidden, .btn-text.hidden { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Activity strip */
.activity-strip {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.65rem 0.85rem;
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.activity-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.activity-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.activity-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 0.15rem;
}

.activity-scroll::-webkit-scrollbar { display: none; }

.activity-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    font-size: 0.78rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.35rem 0.65rem;
    flex-shrink: 0;
}

.activity-handle { font-weight: 600; }
.activity-meta { color: var(--accent-text); font-weight: 600; }
.activity-time { color: var(--text-soft); }

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
    scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    font-size: 0.78rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.filter-pill:hover { border-color: var(--border-strong); color: var(--text); }
.filter-pill.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-text);
    font-weight: 600;
}

/* Board */
.board { padding-bottom: 3rem; }

.board-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.board-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: border-color 0.15s;
}

.board-card:hover { border-color: var(--border-strong); }

.board-card.rank-1 {
    background: var(--accent-soft);
    border-color: rgba(232, 93, 74, 0.35);
}

.board-card.rank-2,
.board-card.rank-3 {
    border-color: var(--border-strong);
}

.board-card.hidden { display: none; }

.card-rank {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    z-index: 2;
}

.board-card.rank-1 .card-rank {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.card-link {
    display: block;
    padding: 1rem 1rem 0.85rem 3.75rem;
    color: inherit;
}

.card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.65rem;
}

.card-identity {
    display: flex;
    gap: 0.75rem;
    min-width: 0;
}

.card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
    word-break: break-word;
}

.card-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-soft);
}

.meta-dot { opacity: 0.6; }

.card-outbid {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    z-index: 3;
}

.board-card:hover .card-outbid { opacity: 1; }
.card-outbid:hover { background: var(--accent); border-color: var(--accent); color: white; }

.empty-board {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0 2rem;
    text-align: center;
}

.footer-stat {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.footer-stat strong { color: var(--text); }

.footer-links {
    font-size: 0.78rem;
    color: var(--text-soft);
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Rules page */
.rules-page { padding: 2rem 0 3rem; }

.rules-page h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.rules-lead {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.rules-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.35rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.rules-block h2 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.65rem;
}

.rules-block ul {
    padding-left: 1.15rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.rules-block li { margin-bottom: 0.4rem; line-height: 1.5; }

.back-link {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
}

/* Result pages */
.result-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 2rem 1rem;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow);
}

.result-icon { font-size: 3rem; margin-bottom: 0.75rem; }

.result-card h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.result-handle {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.35rem;
}

.result-rank { margin-bottom: 0.5rem; }
.result-rank strong { color: var(--accent); font-size: 1.2rem; }

.result-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.btn-primary:hover { background: var(--accent-hover); }

/* Toast */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--text);
    color: var(--bg);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 1000;
    transition: transform 0.25s ease;
    box-shadow: var(--shadow);
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* Mobile */
@media (max-width: 640px) {
    .nav { display: none; }

    .bid-bar-main {
        flex-direction: column;
        border-radius: var(--radius-md);
    }

    .field-group {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .outbid-submit {
        padding: 1rem;
        border-radius: 0;
    }

    .bid-bar-extra { grid-template-columns: 1fr; }

    .card-outbid {
        opacity: 1;
        position: static;
        transform: none;
        margin: 0 1rem 1rem 3.75rem;
        width: fit-content;
    }

    .card-link { padding-bottom: 0.5rem; }
}
