/* Gremlin Community — Reels (tray, creator, viewer, effects) and The RL Diaries header.
   Colours follow the community's white-label variables with the stock theme as fallback. */

/* ------------------------------------------------------------------ tray */
.gc-reels { margin: 0 0 18px; }
.gc-reels-title { color: var(--gc-heading, #c9302c); margin: 0 0 8px; font-size: 1.05rem; }
.gc-reels-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 6px 2px 10px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.gc-reels-strip > * { scroll-snap-align: start; flex: 0 0 auto; }

.gc-reel-bubble, .gc-reel-add {
    background: none;
    border: 0;
    padding: 0;
    width: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--gc-text, #e6e0e0);
}
.gc-reel-ring, .gc-reel-add-plus {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    padding: 3px;
    background: var(--gc-divider, #5a1a1a);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease;
}
.gc-reel-unseen .gc-reel-ring {
    background: conic-gradient(from 210deg, var(--gc-accent, #c9302c), #ff9a3c, #ff3cac, var(--gc-accent, #c9302c));
}
.gc-reel-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #111;
    background: #222;
}
.gc-reel-add-plus {
    font-size: 34px;
    line-height: 1;
    font-weight: 300;
    color: #fff;
    background: var(--gc-accent, #c9302c);
}
.gc-reel-bubble:hover .gc-reel-ring, .gc-reel-add:hover .gc-reel-add-plus { transform: scale(1.06); }
.gc-reel-bubble:focus-visible .gc-reel-ring, .gc-reel-add:focus-visible .gc-reel-add-plus,
.gc-reel-card:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.gc-reel-name {
    font-size: 12px;
    max-width: 76px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* list mode: one portrait card per reel */
.gc-reels-list .gc-reel-add {
    width: 118px;
    height: 210px;
    justify-content: center;
    border: 1px dashed var(--gc-card_border, #8b2e2e);
    border-radius: 12px;
    background: var(--gc-card_bg, rgba(15,12,12,.88));
}
.gc-reel-card {
    position: relative;
    width: 118px;
    height: 210px;
    border-radius: 12px;
    overflow: hidden;
    padding: 0;
    border: 2px solid transparent;
    background: #111;
    cursor: pointer;
}
.gc-reel-card.gc-reel-unseen { border-color: var(--gc-accent, #c9302c); }
.gc-reel-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.gc-reel-card-meta {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 18px 6px 6px;
    font-size: 11px;
    color: #fff;
    text-align: left;
    background: linear-gradient(transparent, rgba(0,0,0,.8));
}
.gc-reel-card-meta img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }
.gc-reel-card-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-reel-card-note {
    position: absolute; top: 6px; right: 8px;
    color: #fff; font-size: 14px; text-shadow: 0 1px 3px #000;
}

/* ------------------------------------------------------------- the stage */
.gc-reel-stage {
    position: relative;
    overflow: hidden;
    background: #000;
    isolation: isolate;
}
.gc-reel-media-wrap { position: absolute; inset: 0; will-change: transform; }
.gc-reel-media {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    background: #000;
}
.gc-reel-stage.gc-reel-cover .gc-reel-media { object-fit: cover; }
.gc-reel-tint, .gc-reel-overlay, .gc-reel-fximg, .gc-reel-particles {
    position: absolute; inset: 0; pointer-events: none;
}
.gc-reel-tint { z-index: 2; mix-blend-mode: soft-light; }
.gc-reel-overlay { z-index: 3; }
.gc-reel-fximg { z-index: 4; width: 100%; height: 100%; object-fit: cover; }
.gc-reel-particles { z-index: 5; }
.gc-reel-sample {
    background:
        radial-gradient(circle at 30% 28%, #ffd27a 0 9%, transparent 10%),
        linear-gradient(160deg, #2b5876 0%, #4e4376 45%, #c94b4b 100%);
}
.gc-reel-sample::after {
    content: '';
    position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
    background: linear-gradient(175deg, transparent 0 22%, #14202b 23% 100%);
}

/* overlays */
.gc-reel-ov-vignette { background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.72) 100%); }
.gc-reel-ov-scanlines { background: repeating-linear-gradient(to bottom, rgba(0,0,0,.28) 0 1px, transparent 1px 3px); }
.gc-reel-ov-grain {
    background-image:
        radial-gradient(rgba(255,255,255,.14) 1px, transparent 1.2px),
        radial-gradient(rgba(0,0,0,.2) 1px, transparent 1.2px);
    background-size: 3px 3px, 4px 4px;
    background-position: 0 0, 1px 2px;
    animation: gc-reel-grain .5s steps(4) infinite;
}
.gc-reel-ov-leak {
    background: linear-gradient(115deg, rgba(255,160,60,.5) 0%, rgba(255,60,172,.22) 30%, transparent 60%);
    mix-blend-mode: screen;
    animation: gc-reel-leak 7s ease-in-out infinite alternate;
}
.gc-reel-ov-letterbox { box-shadow: inset 0 60px 0 #000, inset 0 -60px 0 #000; }
.gc-reel-ov-rgb {
    background: linear-gradient(90deg, rgba(255,0,60,.16), transparent 30%, transparent 70%, rgba(0,220,255,.16));
    mix-blend-mode: screen;
    animation: gc-reel-rgb 1.4s steps(6) infinite;
}
.gc-reel-ov-frame { box-shadow: inset 0 0 0 10px #fff, inset 0 0 0 11px rgba(0,0,0,.25); }

/* movement — applied to the wrapper so it never fights the filter */
.gc-reel-stage[data-motion="zoom-in"] .gc-reel-media-wrap { animation: gc-reel-zoom-in 14s ease-out forwards; }
.gc-reel-stage[data-motion="zoom-out"] .gc-reel-media-wrap { animation: gc-reel-zoom-out 14s ease-out forwards; }
.gc-reel-stage[data-motion="pan"] .gc-reel-media-wrap { animation: gc-reel-pan 9s ease-in-out infinite alternate; }
.gc-reel-stage[data-motion="pulse"] .gc-reel-media-wrap { animation: gc-reel-pulse .6s ease-in-out infinite; }
.gc-reel-stage[data-motion="sway"] .gc-reel-media-wrap { animation: gc-reel-sway 4s ease-in-out infinite alternate; }
.gc-reel-stage[data-motion="shake"] .gc-reel-media-wrap { animation: gc-reel-shake .35s linear infinite; }
.gc-reel-stage[data-motion="glitch"] .gc-reel-media-wrap { animation: gc-reel-glitch 2.2s steps(1) infinite; }
.gc-reel-stage.gc-reel-paused .gc-reel-media-wrap,
.gc-reel-stage.gc-reel-paused .gc-reel-overlay { animation-play-state: paused; }

@keyframes gc-reel-zoom-in { from { transform: scale(1); } to { transform: scale(1.22); } }
@keyframes gc-reel-zoom-out { from { transform: scale(1.22); } to { transform: scale(1); } }
@keyframes gc-reel-pan { from { transform: scale(1.14) translateX(-5%); } to { transform: scale(1.14) translateX(5%); } }
@keyframes gc-reel-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
@keyframes gc-reel-sway { from { transform: scale(1.08) rotate(-1.6deg); } to { transform: scale(1.08) rotate(1.6deg); } }
@keyframes gc-reel-shake {
    0% { transform: translate(0, 0) scale(1.03); } 25% { transform: translate(-2px, 1px) scale(1.03); }
    50% { transform: translate(2px, -1px) scale(1.03); } 75% { transform: translate(-1px, -2px) scale(1.03); }
    100% { transform: translate(0, 0) scale(1.03); }
}
@keyframes gc-reel-glitch {
    0%, 100% { transform: none; clip-path: none; }
    8% { transform: translateX(-6px) skewX(-4deg); }
    10% { transform: translateX(5px); clip-path: inset(12% 0 58% 0); }
    12% { transform: none; clip-path: none; }
    46% { transform: translateX(4px) skewX(3deg); clip-path: inset(62% 0 8% 0); }
    48% { transform: none; clip-path: none; }
    78% { transform: translate(-3px, 2px); }
    80% { transform: none; }
}
@keyframes gc-reel-grain { to { background-position: 3px 2px, -2px 1px; } }
@keyframes gc-reel-leak { from { transform: translateX(-12%) rotate(0deg); opacity: .55; } to { transform: translateX(12%) rotate(4deg); opacity: 1; } }
@keyframes gc-reel-rgb { 0% { transform: translateX(-2px); } 50% { transform: translateX(2px); } 100% { transform: translateX(-1px); } }

@media (prefers-reduced-motion: reduce) {
    .gc-reel-stage .gc-reel-media-wrap, .gc-reel-stage .gc-reel-overlay { animation: none !important; }
}

/* ------------------------------------------------------------ the viewer */
.gc-reel-viewer, .gc-reel-creator {
    position: fixed; inset: 0;
    z-index: 100000;
    background: rgba(0,0,0,.94);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    color: #fff;
}
.gc-reel-viewer .gc-reel-stage {
    width: min(100vw, calc(100vh * 9 / 16));
    width: min(100vw, calc(100dvh * 9 / 16));
    height: 100vh;
    height: 100dvh;
    max-width: 480px;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}
@media (min-width: 600px) {
    .gc-reel-viewer .gc-reel-stage { height: min(100vh, 854px); border-radius: 14px; }
}
.gc-reel-ui { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.gc-reel-ui > * { pointer-events: auto; }
.gc-reel-bars { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 4px; pointer-events: none; }
.gc-reel-bar { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.35); overflow: hidden; }
.gc-reel-bar i { display: block; height: 100%; width: 0; background: #fff; }
.gc-reel-head {
    position: absolute; top: 18px; left: 10px; right: 10px;
    display: flex; align-items: center; gap: 8px;
    text-shadow: 0 1px 3px rgba(0,0,0,.8);
}
.gc-reel-head img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; }
.gc-reel-head-text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.25; }
.gc-reel-head-text strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-reel-head-text span { opacity: .85; font-size: 11px; }
.gc-reel-btn {
    background: rgba(0,0,0,.45);
    color: #fff;
    border: 0;
    border-radius: 50%;
    width: 38px; height: 38px;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.gc-reel-btn:hover { background: rgba(0,0,0,.7); }
.gc-reel-btn:focus-visible { outline: 2px solid #fff; }
.gc-reel-nav { position: absolute; top: 70px; bottom: 120px; width: 34%; background: none; border: 0; padding: 0; cursor: pointer; pointer-events: auto; }
.gc-reel-prev { left: 0; }
.gc-reel-next { right: 0; width: 66%; }
.gc-reel-foot {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 46px 12px 16px;
    background: linear-gradient(transparent, rgba(0,0,0,.78));
    display: flex; align-items: flex-end; gap: 10px;
    pointer-events: none;
}
.gc-reel-foot > * { pointer-events: auto; }
.gc-reel-info { flex: 1; min-width: 0; font-size: 14px; }
.gc-reel-caption { margin: 0 0 4px; overflow-wrap: anywhere; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.gc-reel-track { font-size: 12px; opacity: .9; display: flex; gap: 6px; align-items: center; }
.gc-reel-track-disc { display: inline-block; animation: gc-reel-spin 3s linear infinite; }
.gc-reel-paused .gc-reel-track-disc { animation-play-state: paused; }
@keyframes gc-reel-spin { to { transform: rotate(360deg); } }
.gc-reel-side { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 11px; }
.gc-reel-side .gc-reel-btn { width: 44px; height: 44px; font-size: 20px; }
.gc-reel-like.gc-reel-liked { color: #ff4d6d; }
.gc-reel-count { display: block; text-align: center; margin-top: -6px; text-shadow: 0 1px 2px #000; }
.gc-reel-tap-hint {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(0,0,0,.6); border-radius: 50%; width: 72px; height: 72px;
    display: none; align-items: center; justify-content: center; font-size: 30px; pointer-events: none;
}
.gc-reel-paused .gc-reel-tap-hint { display: flex; }
.gc-reel-sound-ask {
    position: absolute; left: 50%; top: 64px; transform: translateX(-50%);
    background: rgba(0,0,0,.7); color: #fff; border: 1px solid rgba(255,255,255,.5);
    border-radius: 18px; padding: 6px 14px; font-size: 13px; cursor: pointer;
}

/* ----------------------------------------------------------- the creator */
.gc-reel-creator { align-items: flex-start; overflow-y: auto; padding: 12px; }
.gc-reel-creator-box {
    box-sizing: border-box;
    width: 100%; max-width: 760px;
    margin: auto;
    background: var(--gc-card_bg, #151212);
    border: 1px solid var(--gc-card_border, #8b2e2e);
    border-radius: 12px;
    color: var(--gc-text, #e6e0e0);
    padding: 14px;
}
.gc-reel-creator-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.gc-reel-creator-head h4 { margin: 0; color: var(--gc-heading, #c9302c); font-size: 1.1rem; }
.gc-reel-creator-body { display: flex; gap: 16px; flex-wrap: wrap; }
.gc-reel-creator-preview { flex: 0 0 auto; margin: 0 auto; }
.gc-reel-creator .gc-reel-stage { width: 216px; height: 384px; border-radius: 12px; }
.gc-reel-creator-form { flex: 1 1 280px; min-width: 0; }
.gc-reel-creator-form label { display: block; font-size: 13px; margin: 10px 0 4px; }
.gc-reel-creator-form select, .gc-reel-creator-form input[type="text"], .gc-reel-creator-form textarea {
    box-sizing: border-box;
    width: 100%;
    background: var(--gc-input_bg, rgba(0,0,0,.35));
    border: 1px solid var(--gc-input_border, #5a1a1a);
    color: var(--gc-text, #e6e0e0);
    border-radius: 6px;
    padding: 7px 9px;
    font-size: 14px;
}
.gc-reel-creator-form input[type="range"] { width: 100%; }
.gc-reel-pick {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    width: 216px; height: 384px;
    border: 2px dashed var(--gc-card_border, #8b2e2e);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    padding: 12px;
    font-size: 14px;
}
.gc-reel-pick span { font-size: 40px; line-height: 1; }
.gc-reel-pick small { opacity: .75; }
.gc-reel-fx-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.gc-reel-fx-chip {
    flex: 0 0 auto;
    background: var(--gc-input_bg, rgba(0,0,0,.35));
    border: 1px solid var(--gc-input_border, #5a1a1a);
    color: var(--gc-text, #e6e0e0);
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.gc-reel-fx-chip.gc-reel-fx-on { background: var(--gc-accent, #c9302c); border-color: var(--gc-accent, #c9302c); color: #fff; }
.gc-reel-music-row { display: flex; gap: 6px; align-items: center; }
.gc-reel-music-row select { flex: 1; }
.gc-reel-mini {
    background: var(--gc-accent, #c9302c); color: #fff; border: 0; border-radius: 6px;
    padding: 7px 12px; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.gc-reel-mini[disabled] { opacity: .5; cursor: default; }
.gc-reel-mini.gc-reel-ghost { background: transparent; border: 1px solid var(--gc-input_border, #5a1a1a); color: var(--gc-text, #e6e0e0); }
.gc-reel-creator-form label.gc-reel-check { display: flex; gap: 8px; align-items: center; }
.gc-reel-check input { width: auto; }
.gc-reel-creator-actions { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.gc-reel-status { font-size: 13px; flex: 1 1 100%; min-height: 1.2em; }
.gc-reel-status.gc-reel-error { color: #ff7b7b; }
.gc-reel-progress { height: 6px; background: rgba(255,255,255,.15); border-radius: 3px; overflow: hidden; flex: 1 1 100%; display: none; }
.gc-reel-progress i { display: block; height: 100%; width: 0; background: var(--gc-accent, #c9302c); transition: width .2s; }
.gc-reel-hint { font-size: 12px; opacity: .7; margin: 2px 0 0; }

/* ------------------------------------------------------- The RL Diaries */
.gc-diaries-head { margin-bottom: 14px; }
.gc-diaries-title { color: var(--gc-heading, #c9302c); margin: 0 0 4px; }
.gc-diaries-intro { color: var(--gc-muted, #a08d8d); margin: 0 0 10px; }
.gc-diaries-intro a { color: var(--gc-link, #c9302c); }
.gc-diaries-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--gc-divider, #5a1a1a); }
.gc-diaries-tab {
    padding: 7px 14px;
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    color: var(--gc-muted, #a08d8d);
    text-decoration: none;
    font-size: 14px;
}
.gc-diaries-tab:hover { color: var(--gc-text, #e6e0e0); }
.gc-diaries-tab-active {
    color: var(--gc-text, #e6e0e0);
    border-color: var(--gc-divider, #5a1a1a);
    background: var(--gc-card_bg, rgba(15,12,12,.88));
    font-weight: 600;
}
.gc-wall-links { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.gc-wall-links a {
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 14px;
    border: 1px solid var(--gc-card_border, #8b2e2e);
    color: var(--gc-text, #e6e0e0);
    text-decoration: none;
    background: var(--gc-card_bg, rgba(15,12,12,.88));
}
.gc-wall-links a:hover { border-color: var(--gc-accent, #c9302c); }
