/* ---------------------------------------------------------------------------
   TeaseMyFeet — visual identity
   Direction: "blush noir". Warm blush paper by day, deep wine-black by
   night, a soft serif wordmark, and a rose accent for actions with a muted
   gold accent for "live" signal states. Signature: fully-rounded pill
   buttons/tabs throughout and a soft bottom-edge glow on cards, rather than
   a top-bar accent stripe. No external fonts (system stack only).
--------------------------------------------------------------------------- */

:root {
    --bg: #fbf1f4;
    --bg-card: #ffffff;
    --text: #271319;
    --text-muted: #8a6570;
    --border: #f2dde3;
    --accent: #e0527e;
    --accent-hover: #c73f68;
    --accent-ink: #ffffff;
    --signal: #b9862c;
    --signal-ink: #ffffff;
    --price: #a83b62;
    --tab-bg: #f7e6ea;
    --tab-text: #8a6570;
    --badge-bg: rgba(39, 19, 25, 0.62);
    --overlay-bg: rgba(24, 10, 15, 0.76);
}

[data-theme="dark"] {
    --bg: #1a1014;
    --bg-card: #251419;
    --text: #f8ebee;
    --text-muted: #c99aa7;
    --border: #3b2129;
    --accent: #f0678f;
    --accent-hover: #ff85a5;
    --accent-ink: #1a1014;
    --signal: #dfae5a;
    --signal-ink: #1a1014;
    --price: #f5a3bc;
    --tab-bg: #35202a;
    --tab-text: #e0b9c4;
    --badge-bg: rgba(0, 0, 0, 0.6);
    --overlay-bg: rgba(10, 4, 7, 0.85);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* Signature: soft rose-to-gold glow bar across the very top of the page —
   a single blended gradient rather than a hard-edged two-color split. */
body::before {
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--signal) 100%);
}

a { color: inherit; }

/* --- Header -------------------------------------------------------------- */

.site-header {
    text-align: center;
    padding: 28px 16px 14px;
    border-bottom: 1px solid var(--border);
}

.header-top {
    display: grid;
    grid-template-columns: 1fr minmax(0, auto) 1fr;
    align-items: center;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}
.header-top h1 {
    grid-column: 2;
    min-width: 0; /* without this, a grid item's default min-width is its
                     content's natural (unwrapped) width, so a long/single-
                     word logo text can force the whole row wider than the
                     viewport — this line is what lets clamp()/ellipsis
                     below actually take effect instead of being overridden */
}

.site-header h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.4rem, 6vw, 2.2rem);
    font-weight: 700;
    font-style: italic;
    letter-spacing: 0.01em;
    line-height: 1;
}
.site-header h1 a {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
    vertical-align: bottom;
}
.site-header h1 a::after {
    content: "";
    display: block;
    width: 36px;
    height: 3px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: var(--accent);
}

.theme-toggle {
    grid-column: 3;
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    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; }

.tagline {
    margin: 14px 0 24px;
    color: var(--text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.tagline::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--signal);
}

.tabs { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.tabs a {
    padding: 8px 18px;
    border-radius: 999px;
    background: var(--tab-bg);
    color: var(--tab-text);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.tabs a.active { background: var(--signal); color: var(--signal-ink); }

/* --- Grid & sort ---------------------------------------------------------- */

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

.sort-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 16px 0;
}
.sort-row .control {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sort-row label {
    color: var(--text-muted);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.sort-row select {
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.8rem;
}

/* --- Cards ---------------------------------------------------------------- */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom: 3px solid var(--accent);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(224, 82, 126, 0.18);
}

.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;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--badge-bg);
    color: #fff;
}
.platform-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff5b5f;
}

.viewer-count {
    position: absolute; bottom: 8px; right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    background: var(--badge-bg);
    color: #fff;
}
.eye-icon { flex-shrink: 0; }

.card-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; }

.username {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 600;
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.username .name { min-width: 0; }
.username .identity {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.username .age {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}
.username .flag { font-size: 0.85rem; line-height: 1; }

.price {
    margin: 0;
    font-size: 0.8rem;
    color: var(--price);
}

.tags {
    margin: 2px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.tag-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--tab-bg);
    color: var(--tab-text);
    font-size: 0.68rem;
    letter-spacing: 0.02em;
}

.grid-note {
    max-width: 820px;
    margin: 4px auto 0;
    padding: 0 16px;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.55;
    text-align: center;
}

.cta {
    margin-top: 8px;
    display: inline-block;
    text-align: center;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.01em;
}
.cta:hover { background: var(--accent-hover); }
.cta-large { padding: 13px 26px; font-size: 0.95rem; margin-top: 0; }

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

/* --- Overlay / stream window --------------------------------------------- */

.overlay {
    position: fixed; inset: 0; background: var(--overlay-bg);
    display: flex; align-items: center; justify-content: center;
    padding: 16px; z-index: 100;
    backdrop-filter: blur(2px);
}
.overlay[hidden] { display: none; }
.overlay-window {
    width: 90vw;
    height: 90vh;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
}
.overlay-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.overlay-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}
.overlay-close {
    flex-shrink: 0;
    background: none;
    border: 0;
    color: var(--text);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.overlay-close:hover { color: var(--signal); }
.overlay-body {
    flex: 1 1 auto;
    min-height: 0; /* lets this flex child actually shrink to the space
                      that's really left, instead of forcing the window
                      to overflow past 90vh */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    overflow: hidden;
}
.overlay-body iframe {
    display: block;
    /* This is a fallback for the instant before JS measures and sets
       explicit pixel dimensions (see sizePreviewIframe() in grid.php) —
       that JS is what actually determines the real size now, since it
       measures rendered pixels directly instead of relying on percentage/
       aspect-ratio resolution through nested flex contexts. */
    width: auto;
    height: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    background: #000;
    border-radius: 8px;
}
.overlay-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    padding: 0 18px 18px;
}

.site-footer { text-align: center;
    color: var(--text-muted);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    padding: 28px 16px;
    border-top: 1px solid var(--border);
}

/* --- Blocked-content notice ------------------------------------------------ */

.adblock-notice {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: min(92vw, 520px);
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--signal);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.85rem;
    line-height: 1.45;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}
.adblock-notice[hidden] { display: none; }
.adblock-notice-icon { flex-shrink: 0; color: var(--signal); }
.adblock-notice button {
    flex-shrink: 0;
    background: none;
    border: 0;
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}
.adblock-notice button:hover { color: var(--text); }

/* --- Age gate ------------------------------------------------------------- */

.age-gate {
    position: fixed; inset: 0; z-index: 999;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.85);
}
.age-gate-window {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px 24px;
    text-align: center;
}
.age-gate-window h2 { margin: 0 0 12px; font-size: 1.5rem; }
.age-gate-window p { margin: 0 0 24px; color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; }
.age-gate-actions { display: flex; flex-direction: column; gap: 10px; }
.age-gate-enter {
    padding: 12px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}
.age-gate-enter:hover { background: var(--accent-hover); }
.age-gate-exit {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}
.age-gate-exit:hover { color: var(--text); }

/* --- Responsive ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    .card { transition: none; }
}

@media (min-width: 1100px) {
    .overlay-body { padding: 22px; }
    .overlay-footer { padding: 0 22px 22px; }
}

@media (max-width: 640px) {
    .site-header { padding: 20px 12px 12px; }
    .tagline { margin: 14px 0 20px; }
    .grid { padding: 14px 12px; gap: 12px; }
    .sort-row { padding: 14px 12px 0; }

    /* Stream preview: maximize it on small screens rather than treating it
       like a centered desktop dialog — full width, minimal chrome. Height
       is intentionally NOT forced to fill the screen: with the iframe now
       sized in JS to whatever a 16:9 box actually needs, forcing the
       window itself to 100% height just left dead space between the
       header/CTA and the (correctly, more compact) video. Auto height lets
       the window shrink-wrap to real content instead. */
    .overlay { padding: 4px; }
    .overlay-window {
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 96vh; /* safety ceiling, not a target */
        border-radius: 8px;
    }
    .overlay-header { padding: 8px 10px; }
    .overlay-title { font-size: 0.92rem; }
    .overlay-body { padding: 4px; }
    .overlay-footer { padding: 0 6px 6px; }
}

/* --- Informational content -------------------------------------------------- */

.info-section {
    max-width: 820px;
    margin: 24px auto 0;
    padding: 28px 16px 8px;
    border-top: 1px solid var(--border);
}
.info-section h2 {
    margin: 0 0 12px;
    font-size: 1.25rem;
}
.info-section h3 {
    margin: 20px 0 8px;
    font-size: 1rem;
}
.info-section p {
    margin: 0 0 12px;
    color: var(--text-muted);
    line-height: 1.65;
}
.info-section ul {
    margin: 0 0 12px;
    padding-left: 20px;
    color: var(--text-muted);
    line-height: 1.65;
}
.info-section li { margin-bottom: 6px; }
.info-section li strong { color: var(--text); }
.info-section .info-disclosure {
    padding-top: 12px;
    margin-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
}

/* --- Static pages (privacy / faq) ------------------------------------------ */

.page-content {
    max-width: 760px;
    margin: 0 auto;
    padding: 32px 16px 48px;
}
.page-content h1 { margin: 0 0 16px; font-size: 1.6rem; }
.page-content h2 { margin: 24px 0 8px; font-size: 1.15rem; }
.page-content p,
.page-content li {
    color: var(--text-muted);
    line-height: 1.65;
}
.page-content ul { margin: 0 0 12px; padding-left: 20px; }

/* --- Footer links ----------------------------------------------------------- */

.footer-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 12px;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: underline;
}
.footer-links a:hover { color: var(--text); }
