/* Shared responsive layer: compact <=480, phone <=768, navigation <=1200.
   Keep intrinsic content shrinkable instead of masking overflow on the page. */
html, body { overflow-x: visible; }
[hidden] { display: none !important; }
body { --page-gutter: clamp(16px, 4vw, 64px); }
section[id] { scroll-margin-top: 100px; }
main, section, form, .input-group, .header-brand, .header-actions,
.account-page-content, .profile-editor-info, .ai-upload, .ai-feedback,
.converter-form > *, .stats-form > *, .plans-grid > *, .social-person > div {
    min-width: 0;
}
input, select, textarea { min-width: 0; max-width: 100%; }
button, summary { overflow-wrap: anywhere; }
img, video, canvas { max-width: 100%; }
p, h1, h2, h3, .social-person small, .account-overview, .ai-result {
    overflow-wrap: anywhere;
}
/* Mobile hero rules must not override the router's inline display:none. */
body[data-active-area]:not([data-active-area="inicio"]) .hero { display: none !important; }
header { gap: clamp(12px, 2vw, 32px); padding-inline: var(--page-gutter); }
.desktop-nav { gap: clamp(12px, 1.5vw, 24px); }
.desktop-nav a { flex-shrink: 0; white-space: nowrap; }
.header-actions { justify-self: end; }
header .header-actions button { height: auto; min-height: 44px; white-space: nowrap; }
.menu-button { flex: 0 0 44px; width: 44px; height: 44px; }
.side-menu { width: min(300px, 100%); left: 0; height: 100vh; height: 100dvh;
    transform: translateX(-100%); visibility: hidden; overflow-y: auto;
    overscroll-behavior: contain; padding-bottom: max(25px, env(safe-area-inset-bottom));
    transition: transform .25s ease; }
.side-menu.active { transform: translateX(0); visibility: visible; }
.menu-close { min-width: 44px; min-height: 44px; }
body.menu-open { overflow: hidden; }
.account-dropdown { max-width: calc(100vw - 32px); }
.hero { padding-inline: max(var(--page-gutter), calc((100% - 1600px) / 2)); }
.hero-content h1 { font-size: clamp(2.5rem, 5.3vw, 5.5rem); line-height: 1.04; }
.hero-showcase.game-showcase { justify-self: end; }
.plans-grid, .ai-workspace { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.converter::before { right: 0; max-width: 100%; }
#clipPreview { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.clip-fields input, .clip-fields select, .clip-search { max-width: 100%; }
.clip-fields .clip-tag-menu { width: 100%; }
/* Keep menus above video cards, including while the pointer crosses the panel edge. */
#clipUploadPanel { z-index: 2; overflow: visible;
    transition: border-color .3s ease, box-shadow .3s ease; }
#clipUploadPanel:hover { transform: none; }
#clipPreview { position: relative; z-index: 0; }
.clip-tag-menu[open] { z-index: 3; }
.clip-tag-options { width: min(280px, 100%); max-width: 100%; }
.profile-editor-main, .profile-edit-tabs, .gallery-heading, .social-post-heading,
.network-guest-composer, .public-profile-actions { flex-wrap: wrap; }
.profile-editor-info, .social-person { min-width: 0; }
.profile-editor-avatar-wrap { width: fit-content; max-width: 100%; }
.profile-banner-edit { z-index: 1; min-height: 44px; }
.free-banner-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.auth-modal { padding: 16px; overflow-y: auto; overscroll-behavior: contain; }
.auth-card { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
#cancelProDialog { margin: auto; max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px); overflow-y: auto; }
.help-panel { max-height: calc(100vh - 112px); max-height: calc(100dvh - 112px); }
.help-heading, .help-form, .help-privacy, .help-status { flex-shrink: 0; }
.help-messages { min-height: 0; }
.help-heading > div { min-width: 0; }
.help-heading button { min-width: 36px; min-height: 36px; }
:where(button, a, summary, input, select, textarea):focus-visible {
    outline: 2px solid #d6b5ff; outline-offset: 3px;
}
@media (max-width: 1200px) {
    header { grid-template-columns: minmax(0, 1fr) auto; }
    .desktop-nav { display: none; }
    .account-page-content { padding: clamp(20px, 3vw, 40px); }
}
@media (max-width: 768px) {
    header { padding-inline: 16px; gap: 8px; }
    .hero-content h1 { font-size: clamp(2.5rem, 9.5vw, 4.6rem); }
    .hero-showcase.game-showcase { align-self: center; max-width: 620px; }
    .game-picker-heading { flex-wrap: wrap; }
    .game-picker-heading h2 { font-size: clamp(1.35rem, 4vw, 1.8rem); }
    .plans-grid, .ai-workspace { grid-template-columns: minmax(0, 1fr); }
    .plan-card { padding: clamp(20px, 5vw, 32px); }
    .account-page-shell { grid-template-columns: minmax(0, 1fr); }
    .account-page-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); border-right: 0; }
    .account-page-brand { grid-column: 1 / -1; }
    .account-page-content { padding: 20px; }
    .profile-editor-main { padding-inline: 16px; }
    .profile-editor-info { flex: 1 1 150px; }
    input:not([type="checkbox"]):not([type="radio"]), select, textarea,
    .help-form textarea, .network-post-search input, .social-search input,
    .social-comments input { font-size: 16px; }
    .clips-upload .clip-fields select, .clips-toolbar select,
    .clip-tag-menu summary { font-size: 16px !important; }
    .clip-filters button, .profile-edit-tabs button { min-height: 44px; }
    .site-footer { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
}
@media (max-width: 480px) {
    header { height: auto; min-height: 68px; padding: 10px 12px; gap: 6px; }
    .header-brand { gap: 4px; }
    .header-brand .fpshub-custom-brand { gap: 4px; }
    .fpshub-wordmark { font-size: 17px; letter-spacing: -.5px; white-space: nowrap; }
    .fpshub-custom-brand img.fpshub-mark { width: 22px; height: 22px; flex-basis: 22px; }
    header .header-actions { gap: 2px; }
    header .header-actions button { padding-inline: 8px; font-size: 12px; }
    header .account-trigger { max-width: 125px; }
    #headerAccountName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .converter-section, .stats-section, .tools-section, .account-section {
        padding-inline: 16px;
    }
    .clips-section { padding: 20px 16px; }
    .plans-section { padding-inline: 16px; }
    .profile-editor-main { gap: 12px; }
    .profile-edit-tabs button { flex: 1 1 100px; }
    .free-banner-grid { grid-template-columns: minmax(0, 1fr); }
    .social-comments form { flex-wrap: wrap; }
    .social-comments input { flex-basis: 100%; }
    .help-panel { right: 12px; width: calc(100% - 24px); max-width: 370px; }
}
@media (max-width: 350px) {
    header { grid-template-columns: minmax(0, 1fr); }
    .header-actions { justify-self: stretch; justify-content: flex-end; }
}
@media (max-height: 500px) {
    .help-panel { top: 8px; bottom: 8px; height: auto; max-height: calc(100dvh - 16px); }
    .help-suggestions { display: none; }
    .auth-modal { padding: 8px; }
    .auth-card { max-height: calc(100dvh - 16px); padding: 24px; }
}
@media (prefers-reduced-motion: reduce) { .side-menu { transition: none; } }

/* Discord invitations share one visible button treatment in all three locations. */
.discord-button, .site-footer .discord-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 46px; padding: 12px 20px; border: 1px solid #8b90ff;
    border-radius: 12px; background: #5865f2; color: #fff;
    font: 700 14px/1.4 Arial, sans-serif; text-decoration: none; flex-shrink: 0;
}
.discord-button:hover, .site-footer .discord-button:hover { background: #4752c4; color: #fff; text-decoration: none; }
.discord-button img { width: 22px; height: 22px; flex: 0 0 22px; }
.community-invite-actions { display: flex; flex-direction: column; gap: 12px; flex-shrink: 0; }
.community-explore { padding: 14px 18px; border: 1px solid #9973bd; border-radius: 12px; color: #edddff; text-decoration: none; font-size: 13px; background: #382247; text-align: center; }
.footer-discord { display: flex; justify-content: center; margin-top: 24px; }
.network-heading { flex-wrap: wrap; }
@media (max-width: 480px) { .community-invite-actions { width: 100%; } }

/* Videos and available slots share one gallery above the upload form. */
.clip-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 16px; margin: 24px 0; align-items: start; }
.clip-gallery-grid #clipPreview, .clip-gallery-grid #clipInventorySlots { display: contents; }
.clip-gallery-grid > .gallery-more, .clip-gallery-grid > .inventory-expand { grid-column: 1 / -1; }
.clip-gallery-grid .inventory-slot { min-height: 190px; }
.clip-gallery-grid #clipPreview .clip-card { min-width: 0; margin: 0; transform: none; }
.clip-gallery-grid #clipPreview .clip-card video { object-fit: contain; margin: 0; }
.clip-gallery-grid .clip-info h3 { overflow-wrap: anywhere; }

.clip-gallery-details { padding: 0 12px 12px; font-size: 12px; }
.clip-gallery-details summary { cursor: pointer; color: #c99bf2; padding: 8px 0; }
.clip-gallery-details > :not(summary) { margin-top: 10px; }
.clip-gallery-grid .clip-info h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
