/* Browse by category — homepage, full-width grid (no sidebar) */

/* Survey CTA — between game grid and category browse */
.survey-cta-wrap {
    width: 100%;
    padding: 0 0 28px;
    box-sizing: border-box;
}

.survey-cta-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

.survey-cta {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    border-radius: 18px;
    background: linear-gradient(165deg, #2a1f18 0%, #1a1512 100%);
    border: 3px solid rgba(255, 106, 0, 0.85);
    box-shadow:
        0 5px 0 rgba(0, 0, 0, 0.45),
        0 10px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 180, 120, 0.08);
}

.survey-cta__copy {
    min-width: 0;
    flex: 1;
}

.survey-cta__headline {
    font-family: "Fredoka", system-ui, sans-serif;
    font-weight: 700;
    font-size: clamp(1.05rem, 2.4vw, 1.35rem);
    letter-spacing: 0.02em;
    margin: 0 0 6px;
    color: #fff7ed;
    line-height: 1.25;
    paint-order: stroke fill;
    -webkit-text-stroke: 1.5px rgba(0, 0, 0, 0.35);
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

.survey-cta__sub {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: #d4a574;
    max-width: 42ch;
}

.survey-cta__btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 14px;
    font-family: "Fredoka", system-ui, sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(180deg, #ff6a00 0%, #e55f00 100%);
    border: 3px solid #2d1004;
    box-shadow:
        0 4px 0 #1a0a04,
        0 6px 18px rgba(255, 106, 0, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.survey-cta__btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 5px 0 #1a0a04,
        0 8px 22px rgba(255, 106, 0, 0.55);
    filter: brightness(1.06);
}

.survey-cta__btn:active {
    transform: translateY(2px);
    box-shadow:
        0 2px 0 #1a0a04,
        0 3px 12px rgba(255, 106, 0, 0.35);
}

.survey-cta__btn:focus-visible {
    outline: 2px solid #fdba74;
    outline-offset: 3px;
}

body.light .survey-cta {
    background: linear-gradient(165deg, #fff7ed 0%, #ffedd5 100%);
    border: 3px solid rgba(234, 88, 12, 0.65);
    box-shadow:
        0 4px 0 rgba(124, 45, 18, 0.2),
        0 8px 22px rgba(255, 106, 0, 0.12);
}

body.light .survey-cta__headline {
    color: #7c2d12;
    -webkit-text-stroke: 1.5px rgba(124, 45, 18, 0.15);
    text-shadow: 0 1px 0 rgba(124, 45, 18, 0.2);
}

body.light .survey-cta__sub {
    color: #9a3412;
}

body.light .survey-cta__btn {
    border-color: #7c2d12;
    box-shadow:
        0 3px 0 rgba(124, 45, 18, 0.4),
        0 5px 14px rgba(255, 106, 0, 0.22);
}

/* Play page: same CTA button when used outside .survey-cta strip */
body.light-play .survey-cta__btn {
    border-color: #7c2d12;
    box-shadow:
        0 3px 0 rgba(124, 45, 18, 0.4),
        0 5px 14px rgba(255, 106, 0, 0.22);
}

button.survey-cta__btn {
    font: inherit;
    font-family: "Fredoka", system-ui, sans-serif;
    cursor: pointer;
    border: none;
    margin: 0;
}

/* Tally “mini browser” popup (homepage suggest-a-game) */
.tally-game-request-layer {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    box-sizing: border-box;
    pointer-events: none;
}

.tally-game-request-layer:not([hidden]) {
    pointer-events: auto;
}

.tally-game-request-layer[hidden] {
    display: none !important;
}

.tally-game-request-layer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    pointer-events: auto;
}

body.light .tally-game-request-layer__backdrop {
    background: rgba(20, 24, 40, 0.35);
}

.tally-mini-browser {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    width: min(460px, calc(100vw - 40px));
    height: min(720px, calc(100vh - 40px));
    max-height: 92vh;
    border-radius: 10px;
    overflow: hidden;
    box-shadow:
        0 22px 50px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    background: #1e1f26;
    pointer-events: auto;
    touch-action: none;
}

.tally-mini-browser--dragging {
    cursor: grabbing;
    box-shadow:
        0 28px 60px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.tally-mini-browser__chrome {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: linear-gradient(180deg, #3a3d4a 0%, #2d3038 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.35);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.tally-mini-browser--dragging .tally-mini-browser__chrome {
    cursor: grabbing;
}

.tally-mini-browser__traffic {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.tally-mini-browser__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: inset 0 -1px 1px rgba(0, 0, 0, 0.35);
}

.tally-mini-browser__dot--r {
    background: #ff5f57;
}

.tally-mini-browser__dot--y {
    background: #febc2e;
}

.tally-mini-browser__dot--g {
    background: #28c840;
}

.tally-mini-browser__title {
    flex: 1;
    min-width: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #e8e8ef;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tally-mini-browser__close {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    line-height: 1;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.tally-mini-browser__close:hover {
    background: rgba(255, 95, 87, 0.85);
}

.tally-mini-browser__close:focus-visible {
    outline: 2px solid #ff6a00;
    outline-offset: 2px;
}

.tally-mini-browser__urlbar {
    flex-shrink: 0;
    padding: 5px 10px 7px;
    background: #252830;
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
}

.tally-mini-browser__url {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
    color: #9aa3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tally-mini-browser__frame-wrap {
    flex: 1;
    min-height: 0;
    background: #fff;
    position: relative;
}

.tally-mini-browser__frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Draggable Tally panel without fake browser chrome (traffic lights / URL bar) */
.tally-mini-browser--plain .tally-mini-browser__chrome {
    padding-left: 12px;
}

/* Issue form: height follows Tally embed.js + dynamicHeight; no tall empty iframe area */
.tally-mini-browser--plain {
    height: auto;
    max-height: 92vh;
}

.tally-mini-browser--plain .tally-mini-browser__frame-wrap {
    flex: 0 0 auto;
    min-height: 0;
    background: #0a0a0b;
}

.tally-mini-browser--plain .tally-mini-browser__frame {
    position: relative;
    display: block;
    width: 100%;
    height: 200px;
    min-height: 120px;
    border: 0;
}

body.light .tally-mini-browser {
    background: #f0f2f7;
    box-shadow:
        0 22px 50px rgba(15, 23, 42, 0.25),
        0 0 0 1px rgba(15, 23, 42, 0.08);
}

body.light .tally-mini-browser__chrome {
    background: linear-gradient(180deg, #e4e6ed 0%, #d8dbe6 100%);
    border-bottom-color: rgba(15, 23, 42, 0.12);
}

body.light .tally-mini-browser__title {
    color: #1e293b;
}

body.light .tally-mini-browser__urlbar {
    background: #eef0f6;
}

body.light .tally-mini-browser__url {
    color: #64748b;
}

body.light-play .tally-game-request-layer__backdrop {
    background: rgba(20, 24, 40, 0.35);
}

body.light-play .tally-mini-browser {
    background: #f0f2f7;
    box-shadow:
        0 22px 50px rgba(15, 23, 42, 0.25),
        0 0 0 1px rgba(15, 23, 42, 0.08);
}

body.light-play .tally-mini-browser__chrome {
    background: linear-gradient(180deg, #e4e6ed 0%, #d8dbe6 100%);
    border-bottom-color: rgba(15, 23, 42, 0.12);
}

body.light-play .tally-mini-browser__title {
    color: #1e293b;
}

body.light-play .tally-mini-browser__urlbar {
    background: #eef0f6;
}

body.light-play .tally-mini-browser__url {
    color: #64748b;
}

@media (prefers-reduced-motion: reduce) {
    .tally-game-request-layer__backdrop {
        backdrop-filter: none;
    }
}

/* Brand / ads promo — below category browse (compact strip) */
.home-promo-wrap {
    width: 100%;
    padding: 0 0 24px;
    box-sizing: border-box;
}

.home-promo-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px 24px;
    box-sizing: border-box;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-radius: 18px;
    background: linear-gradient(165deg, #2a1f18 0%, #1a1512 100%);
    border: 3px solid rgba(255, 106, 0, 0.85);
    box-shadow:
        0 5px 0 rgba(0, 0, 0, 0.45),
        0 10px 32px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 180, 120, 0.08);
}

.home-promo__headline {
    font-family: "Fredoka", system-ui, sans-serif;
    font-weight: 700;
    font-size: clamp(1.05rem, 2.4vw, 1.35rem);
    letter-spacing: 0.02em;
    margin: 0 0 6px;
    color: #fff7ed;
    line-height: 1.25;
    paint-order: stroke fill;
    -webkit-text-stroke: 1.5px rgba(0, 0, 0, 0.35);
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
}

.home-promo__sub {
    margin: 0;
    max-width: 42ch;
    font-size: 14px;
    line-height: 1.45;
    color: #d4a574;
}

.home-promo__btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 14px;
    font-family: "Fredoka", system-ui, sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(180deg, #ff6a00 0%, #e55f00 100%);
    border: 3px solid #2d1004;
    box-shadow:
        0 4px 0 #1a0a04,
        0 6px 18px rgba(255, 106, 0, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.home-promo__btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 5px 0 #1a0a04,
        0 8px 22px rgba(255, 106, 0, 0.55);
    filter: brightness(1.06);
}

.home-promo__btn:active {
    transform: translateY(2px);
    box-shadow:
        0 2px 0 #1a0a04,
        0 3px 12px rgba(255, 106, 0, 0.35);
}

.home-promo__btn:focus-visible {
    outline: 2px solid #fdba74;
    outline-offset: 3px;
}

body.light .home-promo-inner {
    background: linear-gradient(165deg, #fff7ed 0%, #ffedd5 100%);
    border: 3px solid rgba(234, 88, 12, 0.65);
    box-shadow:
        0 4px 0 rgba(124, 45, 18, 0.2),
        0 8px 22px rgba(255, 106, 0, 0.12);
}

body.light .home-promo__headline {
    color: #7c2d12;
    -webkit-text-stroke: 1.5px rgba(124, 45, 18, 0.15);
    text-shadow: 0 1px 0 rgba(124, 45, 18, 0.2);
}

body.light .home-promo__sub {
    color: #9a3412;
}

body.light .home-promo__btn {
    border-color: #7c2d12;
    box-shadow:
        0 3px 0 rgba(124, 45, 18, 0.4),
        0 5px 14px rgba(255, 106, 0, 0.22);
}

.home-browse-wrap {
    width: 100%;
    padding: 8px 0 32px;
    box-sizing: border-box;
}

.home-browse-wrap--after-survey {
    padding-top: 20px;
    padding-bottom: 36px;
}

.home-browse-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

.home-browse-heading {
    font-family: "Fredoka", system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 0.02em;
    margin: 0 0 6px;
    color: var(--text);
    paint-order: stroke fill;
    -webkit-text-stroke: 1.5px var(--clip-ink-soft, rgba(8, 6, 12, 0.4));
    text-shadow: 0 2px 0 var(--clip-ink, rgba(8, 6, 12, 0.65));
}

body.light .home-browse-heading {
    -webkit-text-stroke: 1.5px rgba(55, 40, 30, 0.18);
    text-shadow: 0 1px 0 rgba(55, 40, 30, 0.18);
}

.home-browse-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 18px;
    max-width: 56ch;
    line-height: 1.45;
}

.home-browse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

@media (min-width: 900px) {
    .home-browse-grid--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.home-browse-card {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 18px;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(145deg, #222636 0%, #1a1d2a 100%);
    border: 3px solid #343a52;
    border-left: 7px solid #ff6a00;
    box-shadow:
        0 4px 0 rgba(0, 0, 0, 0.4),
        0 8px 22px rgba(0, 0, 0, 0.35);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-browse-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 6px 0 rgba(0, 0, 0, 0.35),
        0 14px 36px rgba(0, 0, 0, 0.45),
        0 0 0 2px rgba(255, 106, 0, 0.45);
    border-color: rgba(255, 106, 0, 0.5);
}

body.light .home-browse-card {
    background: linear-gradient(145deg, #fff 0%, #f4f6fc 100%);
    border: 3px solid #c8cedd;
    border-left: 7px solid #ea580c;
    box-shadow:
        0 3px 0 rgba(30, 35, 50, 0.12),
        0 6px 18px rgba(0, 0, 0, 0.08);
}

.home-browse-card-thumb {
    width: 88px;
    height: 88px;
    border-radius: 14px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    box-shadow:
        inset 0 0 0 2px rgba(0, 0, 0, 0.35),
        0 2px 0 rgba(0, 0, 0, 0.25);
}

.home-browse-card-title {
    font-family: "Fredoka", system-ui, sans-serif;
    font-weight: 700;
    font-size: 15px;
    margin: 0 0 6px;
    color: var(--text);
    line-height: 1.25;
}

.home-browse-card-desc {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-muted);
    margin: 0;
}

@media (max-width: 520px) {
    .home-browse-inner {
        padding: 0 16px;
    }

    .home-promo-wrap {
        padding: 0 16px 20px;
    }

    .home-promo-inner {
        margin: 0;
        padding: 18px 18px;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .home-promo__sub {
        margin: 0 auto 12px;
        max-width: 42ch;
    }

    .home-promo__btn {
        width: auto;
        box-sizing: border-box;
    }

    .survey-cta-inner {
        padding: 0 16px;
    }

    .survey-cta {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 18px 18px;
    }

    .survey-cta__sub {
        max-width: none;
    }

    .survey-cta__btn {
        width: 100%;
        box-sizing: border-box;
    }

    .home-browse-grid {
        grid-template-columns: 1fr;
    }
}

/* First-visit welcome (homepage only; see js/tubzi-welcome-first-visit.js) */
.welcome-first-layer {
    position: fixed;
    inset: 0;
    z-index: 4600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    box-sizing: border-box;
}

.welcome-first-layer[hidden] {
    display: none !important;
}

.welcome-first-layer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
}

body.light .welcome-first-layer__backdrop {
    background: rgba(15, 23, 42, 0.4);
}

.welcome-first-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    padding: 24px 22px 20px;
    border-radius: var(--card-radius, 18px);
    background: var(--header-bg);
    border: 1px solid var(--header-border);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    text-align: left;
}

body.light .welcome-first-card {
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.welcome-first-card__title {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    margin: 0 0 14px;
    color: var(--text);
    line-height: 1.3;
}

.welcome-first-card__text {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-muted);
    text-align: left;
}

.welcome-first-card__text:last-of-type {
    margin-bottom: 18px;
}

.welcome-first-card__link {
    color: var(--brand);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.welcome-first-card__link:hover {
    color: var(--brand-hover);
}

.welcome-first-card__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.welcome-first-card__btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    background: var(--brand);
    border: 1px solid var(--brand-hover);
    cursor: pointer;
    transition: background 0.15s ease, filter 0.15s ease;
}

.welcome-first-card__btn:hover {
    background: var(--brand-hover);
    filter: brightness(1.03);
}

.welcome-first-card__btn:active {
    filter: brightness(0.95);
}

.welcome-first-card__btn:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.welcome-first-card__btn--secondary {
    text-decoration: none;
    box-sizing: border-box;
    color: var(--text);
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
}

.welcome-first-card__btn--secondary:hover {
    background: var(--btn-bg-hover);
    filter: none;
}

.welcome-first-card__btn--secondary:active {
    filter: brightness(0.97);
}

.welcome-first-card__btn--secondary:focus-visible {
    outline-color: var(--btn-border);
}

@media (prefers-reduced-motion: reduce) {
    .welcome-first-layer__backdrop {
        backdrop-filter: none;
    }

    .welcome-first-card__btn {
        transition: none;
    }

    .welcome-first-card__btn:hover {
        transform: none;
    }

    .welcome-first-card__btn--secondary:hover {
        transform: none;
    }
}
