:root {
    --bg: #f7f6f3;
    --bg-card: #ffffff;
    --text: #201f1d;
    --text-muted: #6f6d68;
    --border: #e6e3dc;
    --accent: #e8590c;
    --accent-hover: #d14d05;
    --accent-contrast: #ffffff;
    --price: #a16207;
    --tab-bg: #eceae5;
    --tab-text: #55534e;
    --badge-bg: rgba(0, 0, 0, 0.55);
    --overlay-bg: rgba(0, 0, 0, 0.85);
}

[data-theme="dark"] {
    --bg: #1b1a18;
    --bg-card: #242220;
    --text: #ece9e3;
    --text-muted: #a29e96;
    --border: #37342e;
    --accent: #e8590c;
    --accent-hover: #f07a2a;
    --accent-contrast: #ffffff;
    --price: #fbbf24;
    --tab-bg: #2a2824;
    --tab-text: #c9c5bd;
    --badge-bg: rgba(0, 0, 0, 0.6);
    --overlay-bg: rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: inherit; }

.site-header {
    position: relative;
    text-align: center;
    padding: 24px 16px 12px;
}
.theme-toggle {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
}
.theme-toggle:hover { border-color: var(--text-muted); }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.site-header h1 { margin: 0 0 4px; font-size: 1.8rem; }
.site-header h1 a { text-decoration: none; }
.tagline { margin: 0 0 16px; color: var(--text-muted); font-size: 0.95rem; }

.tabs { display: flex; justify-content: center; gap: 8px; }
.tabs a {
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--tab-bg);
    color: var(--tab-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}
.tabs a.active { background: var(--accent); color: var(--accent-contrast); }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.thumb-button {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: #000;
    cursor: pointer;
    aspect-ratio: 4 / 3;
}
.thumb-button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-placeholder {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; color: #888; font-size: 0.85rem;
}
.platform-badge {
    position: absolute; top: 8px; left: 8px;
    padding: 2px 8px; border-radius: 999px;
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    background: var(--badge-bg);
    color: #fff;
}
.viewer-count {
    position: absolute; bottom: 8px; right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px; border-radius: 999px;
    font-size: 0.72rem; background: var(--badge-bg);
    color: #fff;
}
.eye-icon { flex-shrink: 0; }

.card-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.username {
    margin: 0;
    font-size: 1.05rem;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}
.username .age { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.username .flag { font-size: 0.85rem; line-height: 1; }
.meta { margin: 0; color: var(--text-muted); font-size: 0.85rem; }
.price { margin: 0; font-size: 0.85rem; color: var(--price); }

.cta {
    margin-top: 8px;
    display: inline-block;
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--accent);
    color: var(--accent-contrast);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}
.cta:hover { background: var(--accent-hover); }
.cta-large { padding: 12px 20px; font-size: 1rem; margin-top: 16px; }

.empty-state { text-align: center; color: var(--text-muted); padding: 48px 16px; }

.overlay {
    position: fixed; inset: 0; background: var(--overlay-bg);
    display: flex; align-items: center; justify-content: center;
    padding: 16px; z-index: 100;
}
.overlay[hidden] { display: none; }
.overlay-inner {
    position: relative; max-width: 900px; width: 100%;
    display: flex; flex-direction: column; align-items: center;
}
.overlay-inner iframe { width: 100%; max-width: 850px; aspect-ratio: 16 / 9; height: auto; border: 0; }
.overlay-close {
    position: absolute; top: -40px; right: 0;
    background: none; border: 0; color: #fff; font-size: 2rem; cursor: pointer;
}

.site-footer { text-align: center; color: var(--text-muted); font-size: 0.75rem; padding: 24px 16px; }
