:root {
    --ctg-vitrine-background:
        radial-gradient(ellipse at 18% 0,rgba(39,207,235,.15),transparent 40%),
        radial-gradient(ellipse at 100% 100%,rgba(196,46,226,.14),transparent 44%),
        linear-gradient(145deg,#10142b,#17112f 58%,#0e1a31);
}

.gl-cup,.ctg-vitrine-summary .ctg-vitrine-stat-art.trophy,.ctg-vitrine-empty .ctg-vitrine-empty-cup {width:42px;height:42px;flex:0 0 42px;object-fit:contain;vertical-align:middle}
body.gl-app-active::after{display:none!important}
body.gl-app-active #socialApp::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;background:url('assets/ui/feed-waves.svg?v=16') center / cover;opacity:.88}
body.gl-app-active .content-area{touch-action:auto}
#nav-ctg .ctg-icon-wrap { width:42px;height:42px;flex:0 0 42px;background:transparent!important;border:0;box-shadow:none; }
#contentArea:has(> #feedCommunity) > :not(#feedCommunity) { display:none !important; }
#feedCommunity {
    display:flex;
    flex-direction:column;
    min-width:0;
    height:calc(100dvh - var(--header-height) - 44px);
    min-height:260px;
    border:1px solid #6485b980;
    border-radius:18px;
    overflow:hidden;
    color:#f3f6ff;
    background:var(--ctg-vitrine-background);
    box-shadow:inset 0 1px 0 #bcddff24,0 12px 28px #04081947;
}
.feed-community-header {
    display:flex;
    gap:10px;
    justify-content:space-between;
    align-items:center;
    padding:10px 14px;
    border-bottom:1px solid #7096c053;
}
.feed-community-header button {
    flex:none;
    min-height:44px;
    padding:8px 13px;
    border:1px solid #6a88b9;
    border-radius:11px;
    color:inherit;
    background:#1c2d4d;
    font:inherit;
    font-size:14px;
    font-weight:600;
    cursor:pointer;
}
.feed-community-header button i { margin-right:5px; }
.feed-community-header h2 { margin:0; color:#c8e5ff; font-size:14px; text-align:right; }
.feed-community-content { flex:1; min-height:0; display:flex; flex-direction:column; }
.feed-community-status { padding:22px; font:inherit; }
.feed-community-portal { position:relative; z-index:12000; }
@media (max-width:860px) {
    #socialApp > #appMain:has(#feedCommunity) { flex:1 1 0;min-width:0; }
    #feedCommunity {
        height:calc(100dvh - var(--header-height) - var(--mobile-nav-height) - env(safe-area-inset-bottom) - 42px);
    }
    .feed-community-header { padding:7px 9px; }
}

.ctg-guide-dialog {
    box-sizing:border-box;
    width:min(580px,calc(100% - 24px));
    max-height:calc(100dvh - 24px);
    margin:auto;
    padding:clamp(16px,4vw,28px);
    overflow:auto;
    overscroll-behavior:contain;
    background:linear-gradient(150deg,#121d3b,#19112e);
    color:#f4f7ff;
    border:1px solid #64cde2;
    border-radius:18px;
    box-shadow:0 20px 64px #010515a8;
}
.ctg-guide-dialog::backdrop {background:#050816b8;}
.ctg-guide-top {display:flex;justify-content:flex-end;}
.ctg-guide-dialog button {
    min-height:44px;padding:8px 14px;border:1px solid #4f648a;border-radius:11px;
    background:#232c50;color:#fff;font:inherit;cursor:pointer;touch-action:manipulation;
}
.ctg-guide-dialog .ctg-guide-primary {width:100%;background:linear-gradient(120deg,#125c8a,#632b9a);}
.ctg-guide-dialog h2,.ctg-guide h2 {margin:10px 0;}
.ctg-guide-dialog ol {padding-inline-start:23px;}
.ctg-guide-dialog li {padding:8px 0;}
.ctg-guide {padding:clamp(8px,3vw,18px);color:#f4f7ff;}
.ctg-guide p,.ctg-guide-dialog p {line-height:1.55;color:#d6dfef;}
.ctg-guide details {margin-top:10px;border:1px solid #455779;border-radius:12px;background:#182540;}
.ctg-guide details[open] {border-color:#64cde2;}
.ctg-guide summary {padding:14px;cursor:pointer;font-weight:700;touch-action:manipulation;}
.ctg-guide details p {margin:0;padding:0 14px 14px;overflow-wrap:anywhere;}
.ctg-guide a {color:#91edff;}

.ctg-guide-dialog {
    width:min(680px,calc(100% - 22px));
    padding:clamp(16px,4vw,30px);
    background:
        radial-gradient(ellipse at 4% 2%, #12567780, transparent 50%),
        radial-gradient(ellipse at 98% 98%, #7e2cb658, transparent 55%),
        linear-gradient(144deg,#13264bee,#0b1730f5 55%,#2a1a4aed);
    border:1px solid #81d9fb;
    box-shadow:inset 0 0 24px #66c7ff29,0 0 25px #23c8ff40,0 24px 72px #000b;
    backdrop-filter:blur(18px);
    color-scheme:dark;
}
.ctg-guide-top {position:absolute;inset:12px 12px auto auto;z-index:1;}
.ctg-guide-top button {font-size:25px;line-height:1;background:#142345bf;}
.ctg-info-hero {
    display:flex;align-items:center;gap:clamp(12px,4vw,28px);
    padding:12px 44px 14px 0;
    background:url('assets/ui/feed-waves.svg?v=16') center 54% / 135% auto no-repeat;
}
.ctg-info-hero img {
    width:clamp(62px,20vw,144px);aspect-ratio:1;object-fit:contain;flex:none;
    filter:drop-shadow(0 0 12px #f4a12f85);
}
.ctg-info-hero h2 {margin:0 0 5px;font-size:clamp(24px,6vw,45px);line-height:1.04;}
.ctg-info-hero p {margin:0;font-size:clamp(13px,2.8vw,19px);}
.ctg-info-intro {margin:5px 0 16px;}
.ctg-guide-dialog .ctg-info-steps {list-style:none;display:grid;gap:9px;margin:0 0 20px;padding:0;}
.ctg-info-steps li {
    display:grid;grid-template-columns:46px minmax(0,1fr);align-items:center;gap:13px;
    padding:10px 13px;border:1px solid #91b9f73d;border-radius:14px;
    background:linear-gradient(120deg,#263d676e,#402a6b68);
    box-shadow:inset 0 1px 0 #d3e9ff17;
}
.ctg-info-steps strong {display:block;font-size:clamp(14px,3.5vw,18px);}
.ctg-info-steps p {margin:2px 0 0;font-size:13px;}
.ctg-step-icon,.ctg-rule-icon {
    display:inline-grid;place-items:center;width:42px;height:42px;border-radius:12px;flex:none;
    background:linear-gradient(145deg,#3657869c,#293b679c);border:1px solid #91bbef55;
}
.ctg-step-icon {color:var(--icon-color);box-shadow:inset 0 0 13px color-mix(in srgb,var(--icon-color) 23%,transparent);}
.ctg-step-icon--cian {--icon-color:#51f2ff;}
.ctg-step-icon--violet {--icon-color:#d8a0ff;}
.ctg-step-icon--blue {--icon-color:#71caff;}
.ctg-step-icon--pink {--icon-color:#f690ee;}
.ctg-step-icon svg,.ctg-rule-icon svg {width:25px;height:25px;}
.ctg-guide-dialog .ctg-guide-primary {
    display:block;width:min(100%,380px);margin:auto;font-weight:750;border-color:#8bf2ff;
    background:linear-gradient(180deg,#066e9e,#075084);
    box-shadow:inset 0 0 12px #36e4ff73,0 0 15px #28d6ff58;
}
.ctg-rules-heading {display:flex;align-items:center;gap:13px;line-height:1.2;}
.ctg-guide .ctg-rule-balance {color:#ffd785;background:linear-gradient(145deg,#77552b,#3c2a53);}
.ctg-guide summary {display:flex;align-items:center;gap:11px;list-style:none;}
.ctg-guide summary::-webkit-details-marker {display:none;}
.ctg-guide summary::after {
    content:'';margin-inline-start:auto;width:9px;height:9px;flex:none;
    border:solid #9fefff;border-width:0 2px 2px 0;transform:rotate(45deg);
}
.ctg-guide details[open] > summary::after {transform:rotate(225deg);}
.ctg-guide summary .ctg-rule-icon {width:35px;height:35px;font-size:18px;}
.ctg-guide-dialog button:focus-visible,.ctg-guide summary:focus-visible {outline:2px solid #88f1ff;outline-offset:2px;}
@media(max-width:460px) {
    .ctg-info-hero {background-size:165% auto;}
    .ctg-guide-dialog .ctg-info-steps li {gap:9px;padding:9px;}
}

/* Historias del Feed */
#storiesRow {
    gap:10px;
    padding-block:4px 14px;
    scroll-snap-type:x proximity;
    touch-action:pan-x pan-y;
}
#storiesRow > .feed-story-card {
    display:block;
    flex:0 0 clamp(108px,37vw,150px);
    aspect-ratio:3/4;
    min-width:0;
    padding:2px;
    border:0;
    border-radius:17px;
    background:linear-gradient(135deg,#26e8ff 4%,#8595ff 46%,#f52bda 94%);
    color:#fff;
    cursor:pointer;
    scroll-snap-align:start;
    touch-action:pan-x pan-y;
}
#storiesRow > .feed-story-card:hover { filter:brightness(1.1); }
#storiesRow > .feed-story-card:focus-visible { outline:2px solid white;outline-offset:-4px; }
#storiesRow .feed-story-cover {
    position:relative;
    display:grid;
    place-items:center;
    width:100%;
    height:100%;
    overflow:hidden;
    border-radius:15px;
    background:linear-gradient(145deg,#20314d,#11182a);
}
#storiesRow .feed-story-cover > :is(img,video) {
    position:absolute;inset:0;width:100%;height:100%;object-fit:cover;
}
#storiesRow .feed-story-placeholder {
    display:-webkit-box;
    -webkit-line-clamp:4;
    -webkit-box-orient:vertical;
    overflow:hidden;
    overflow-wrap:anywhere;
    margin:0 10px 20px;
    font-size:14px;
    font-weight:650;
}
#storiesRow .feed-story-create .feed-story-placeholder {
    display:grid;place-items:center;width:44px;height:44px;margin:0 0 14px;
    border:1px solid #7188af;border-radius:12px;background:#2a3e5b;font-size:20px;
}
#storiesRow .feed-story-caption {
    position:absolute;inset:auto 0 0;
    padding:22px 9px 10px;
    color:#fff;background:linear-gradient(transparent,#091124f2);
    font-size:13px;font-weight:700;text-align:start;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
#storiesRow .feed-story-create .feed-story-caption { text-align:center; }
#storiesRow .feed-story-count {
    position:absolute;inset:7px 7px auto auto;min-width:20px;padding:3px;
    border-radius:8px;background:#101930df;color:#fff;font-size:11px;font-weight:700;
}

.feed-story-upload {
    position:fixed;z-index:11000;inset:auto max(12px,env(safe-area-inset-right)) calc(76px + env(safe-area-inset-bottom)) auto;
    width:min(350px,calc(100% - 24px));padding:12px;
    border:1px solid transparent;border-radius:15px;
    background:linear-gradient(#15223b,#15223b) padding-box,linear-gradient(135deg,#26e8ff,#e744dc) border-box;
    color:#fff;box-shadow:0 9px 26px #0009;
}
.feed-story-upload p { margin:0;font-weight:650;font-size:14px; }
.feed-story-upload progress { width:100%;height:10px;margin-top:9px;accent-color:#39dcff; }
.feed-story-upload > div { display:flex;gap:6px; }
.feed-story-upload button,.feed-photo-editor button {
    min-height:40px;padding:5px 12px;border:1px solid #6a87af;border-radius:10px;
    color:#eef5ff;background:#203854;font:inherit;cursor:pointer;
}
.feed-story-upload button:not([hidden]) { margin-top:8px; }
.feed-story-upload [hidden],.feed-photo-editor [hidden] { display:none; }
.feed-photo-editor {
    position:fixed;inset:0;margin:auto;width:min(650px,calc(100% - 24px));max-height:90dvh;overflow:auto;
    border:1px solid #6a87af;border-radius:18px;padding:15px;color:#eef5ff;background:#101c33;
}
.feed-photo-editor::backdrop { background:#040819dd; }
.feed-photo-editor h2 { margin:0 0 12px;font-size:18px; }
.feed-photo-editor canvas { display:block;width:auto;max-width:100%;height:auto;max-height:48dvh;margin:auto;border-radius:11px;background:#0a1322; }
.feed-photo-editor canvas.is-manual { cursor:grab;touch-action:none; }
.feed-photo-editor canvas.is-manual:active { cursor:grabbing; }
.feed-photo-modes { display:grid;gap:6px;margin-block:12px; }
.feed-photo-modes label { padding:8px;border:1px solid #687fa4;border-radius:10px;background:#192941;cursor:pointer; }
.feed-photo-modes label:has(input:checked) { border-color:#6ae7ff;background:#234364; }
.feed-photo-editor input { accent-color:#54dbff; }
.feed-photo-zoom { display:flex;gap:10px;align-items:center; }
.feed-photo-zoom input { flex:1; }
.feed-photo-editor p { margin:8px 0;font-size:13px;color:#d0dceb; }
.feed-photo-actions { display:flex;gap:8px;justify-content:flex-end; }
.feed-photo-actions [data-save] { background:linear-gradient(120deg,#21597c,#694084); }
.feed-photo-actions button:disabled { opacity:.55;cursor:default; }
#profileCard .profile-pic, #profileCard .profile-pic img { border-radius:14px; }
#profileCard .profile-pic img { object-fit:contain; }

/* Editor y visor de historias */
.story-trim {
    flex:none;
    padding:8px 18px 7px;
    background:#111a2a;
    color:#f6f9ff;
}
.story-trim[hidden] { display:none; }
.story-trim-caption, .story-trim-labels {
    display:flex;
    justify-content:space-between;
    gap:8px;
    font-size:12px;
    font-variant-numeric:tabular-nums;
}
.story-trim-caption span, .story-trim-labels { color:#c5d9ee; }
.story-trim-track {
    position:relative;
    height:34px;
    margin:6px 10px 4px;
    border-radius:6px;
    background:repeating-linear-gradient(90deg,#253347 0 18px,#354962 18px 19px);
}
.story-trim-track button { position:absolute;top:0;height:100%;border:0;touch-action:none; }
.story-trim-range {
    left:var(--clip-start);
    right:calc(100% - var(--clip-end));
    border-radius:5px;
    background:linear-gradient(90deg,#14849e,#863d9b);
    cursor:grab;
}
.story-trim-range:active { cursor:grabbing; }
.story-trim-handle {
    width:20px;
    padding:0;
    transform:translateX(-50%);
    border-radius:5px;
    background:#adf2ff;
    color:#0f253b;
    cursor:ew-resize;
}
.story-trim-handle::before {
    content:"";
    display:block;
    width:5px;
    height:14px;
    margin:auto;
    border-inline:1px solid currentColor;
}
.story-trim-handle[data-trim=start] { left:var(--clip-start); }
.story-trim-handle[data-trim=end] { left:var(--clip-end);background:#fac2ff; }
.story-trim-track button:focus-visible { z-index:1;outline:2px solid #fff;outline-offset:2px; }

#storyStudio #studioCanvasWrap { min-height:0; }
#storyStudio > :nth-child(2) { background:#0a0f19; }
#storyModal { z-index:7800; }
body:has(#storyModal[style*="display: flex"]) #shareModalOverlay { z-index:7801!important; }
#storyModal .story-modal-content {
    width:min(100%,450px);
    max-width:none;
    height:min(820px,96dvh);
    background:#0a0f19;
    --story-safe-top:env(safe-area-inset-top,0px);
    --story-safe-bottom:env(safe-area-inset-bottom,0px);
    --story-footer-height:116px;
}
#storyModal .feed-story-own { --story-footer-height:48px; }
#storyModal .feed-story-bars {
    position:absolute;
    inset:calc(9px + var(--story-safe-top)) 12px auto;
    z-index:15;
    display:flex;
    gap:3px;
}
#storyModal .story-modal-header { top:calc(9px + var(--story-safe-top)); }
#storyModal .story-modal-body {
    position:absolute;
    inset:calc(67px + var(--story-safe-top)) 0 calc(var(--story-footer-height) + var(--story-safe-bottom));
    width:auto;
    height:auto;
    overflow:hidden;
    background:#080d16;
}
#storyModal .story-modal-body > .feed-story-media,
#storyModal .story-modal-body > .feed-story-overlay {
    display:block;
    width:100%;
    height:100%;
    object-fit:contain;
}
.feed-story-overlay { position:absolute;inset:0;pointer-events:none; }
#storyModal .story-modal-content > :is(#storyViewsBar,.feed-story-actions) {
    padding-bottom:calc(12px + var(--story-safe-bottom))!important;
}
#storyReplyInput { min-width:0; }
.feed-story-gesture { position:absolute;top:0;bottom:0;z-index:12;width:30%;cursor:pointer; }
.feed-story-gesture-prev { left:0; }
.feed-story-gesture-toggle { left:30%;width:40%; }
.feed-story-gesture-next { right:0; }
.feed-story-reactions { display:flex;justify-content:space-around;gap:2px;margin-bottom:8px; }
.feed-story-reactions span { font-size:clamp(15px,5.1vw,24px)!important;padding:4px!important; }
body:has(#storyModal[style*="display: flex"],#reelEditorOverlay.active:has(#storyStudio)) #sheikFab { display:none!important; }
@media (max-width:520px) {
    #storyModal .story-modal-content { width:100%;height:100dvh;border-radius:0; }
    #storyStudio { max-height:100dvh!important;border-radius:0!important; }
}

[data-story-filter=vivid] { filter:saturate(1.8) contrast(1.1); }
[data-story-filter=chrome] { filter:contrast(1.2) brightness(1.1) saturate(.8); }
[data-story-filter=fade] { filter:brightness(1.15) saturate(.7) contrast(.9); }
[data-story-filter=noir] { filter:grayscale(1) contrast(1.2); }
[data-story-filter=bw] { filter:grayscale(1); }
[data-story-filter=golden] { filter:sepia(.5) saturate(1.4) brightness(1.1); }
[data-story-filter=cool] { filter:hue-rotate(30deg) saturate(1.2); }
[data-story-filter=warm] { filter:sepia(.3) saturate(1.5) hue-rotate(-15deg); }
[data-story-filter=glitch] { filter:contrast(1.3) saturate(2) hue-rotate(90deg); }
[data-story-filter=dream] { filter:brightness(1.2) blur(.5px) saturate(1.4); }

/* Marco y tarjetas de conversaciones restringidas */
:where(#chatgRestrictedPanel,#cgApp) {
    --chatg-glass:linear-gradient(120deg,#092738,#10122c 56%,#281033);
    --chatg-edge:linear-gradient(115deg,#2bebf7,#5578cc 54%,#f24ce7);
}
#chatgRestrictedPanel {
    position:fixed;
    inset:0;
    z-index:6600;
    display:flex;
    flex-direction:column;
    overflow:hidden;
    border-radius:inherit;
    color:#f5f8ff;
    background:radial-gradient(ellipse at 88% 12%,#260e34,transparent 55%),#071020;
}
#chatgFixedWrap #chatgRestrictedPanel { position:absolute; }
.chatg-restricted-header, .chatg-restricted-entry {
    border:1px solid transparent;
    background:var(--chatg-glass) padding-box,var(--chatg-edge) border-box;
    box-shadow:inset 0 0 22px #67c3ff15;
}
.chatg-restricted-header {
    display:grid;
    grid-template-columns:42px minmax(0,1fr) 42px;
    align-items:center;
    flex:none;
    gap:5px;
    min-height:58px;
    margin:7px;
    padding:4px 8px;
    border-radius:16px;
    text-align:center;
}
.chatg-restricted-header[hidden] { display:none; }
.chatg-restricted-header h2 { margin:0;font-size:clamp(16px,4vw,20px); }
.chatg-restricted-header > i { color:#f4d6ff;font-size:17px; }
.chatg-restricted-header button {
    border:0;
    min-height:42px;
    border-radius:10px;
    color:#fff;
    background:transparent;
    font-size:18px;
    cursor:pointer;
}
.chatg-restricted-list { overflow-y:auto;overscroll-behavior:contain;padding:7px 12px; }
.chatg-restricted-entry {
    display:flex;
    width:100%;
    align-items:center;
    gap:10px;
    min-height:68px;
    margin-bottom:9px;
    padding:8px 12px;
    border-radius:14px;
    color:inherit;
    text-align:start;
    cursor:pointer;
}
.chatg-restricted-avatar { display:grid;place-items:center;width:50px;height:50px;flex:none;overflow:hidden;border-radius:12px;border:1px solid #85dcf8; }
.chatg-restricted-contact { display:grid;min-width:0;flex:1;gap:3px; }
.chatg-restricted-contact > * { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.chatg-restricted-contact strong { font-size:15px; }
.chatg-restricted-contact span { color:#ccd6ec;font-size:13px; }
.chatg-restricted-entry > i { font-size:13px;color:#d1ebfa; }
.chatg-restricted-entry:focus-visible,.chatg-restricted-header button:focus-visible {
    outline:2px solid #9de8ff;
    outline-offset:-3px;
}

.story-preview-controls {
    flex:none;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-wrap:wrap;
    gap:6px;
    padding:4px 10px;
}
.story-preview-controls[hidden] { display:none; }
.story-preview-play,
.story-modal-cancel {
    min-height:44px;
    padding:6px 15px;
    border:1px solid #55769e;
    border-radius:12px;
    color:#edf6ff;
    background:#172a43;
    font:inherit;
    cursor:pointer;
    touch-action:manipulation;
}
.story-preview-play { font-size:13px;font-weight:650; }
.story-preview-status { font-size:12px;color:#ffe1e3;text-align:center; }
.story-preview-status:empty { display:none; }
.story-modal-cancel { width:100%; margin-top:4px; }
.feed-story-close {
    display:grid;
    place-items:center;
    width:44px;
    height:44px;
    padding:0;
    border:0;
    border-radius:12px;
    background:#182940;
    color:#f6f9ff;
    font-size:26px;
    line-height:1;
    cursor:pointer;
    touch-action:manipulation;
}
body:has(#modalOverlay.active .feed-my-stories) #sheikFab { display:none!important; }
