/* Roleplay image and GIF gallery (gifs/index.php). Built from the tokens in hana.css. */

/* States the gallery script toggles */
.hidden{display:none!important}
.opacity-0{opacity:0!important}

/* Tools in the band */
.gf-search{position:relative;flex:0 1 380px;min-width:0}
.gf-search i{position:absolute;left:17px;top:50%;transform:translateY(-50%);color:rgba(255,245,249,.72);font-size:14px;pointer-events:none}
.gf-search input[type=text]{margin:0;padding:0 16px 0 44px;border-radius:var(--r-pill);background:rgba(20,6,14,.56);border-color:rgba(255,235,244,.2);color:#fff;font-size:16px;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.gf-search input[type=text]:focus{border-color:var(--p-300);box-shadow:0 0 0 3px rgba(245,61,146,.3)}
.gf-search input[type=text]::placeholder{color:rgba(255,245,249,.7)}
.gf-user{display:inline-flex;align-items:center;gap:9px;max-width:100%;min-height:44px;padding:4px 4px 4px 7px;border-radius:var(--r-pill);background:rgba(20,6,14,.56);border:1px solid rgba(255,235,244,.2);color:#fff;font-size:14.5px;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.gf-user img{width:30px;height:30px;border-radius:50%;object-fit:cover;flex:none}
.gf-user-name{min-width:0;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gf-logout{position:relative;display:inline-flex;align-items:center;gap:7px;flex:none;min-height:36px;padding:0 13px;border-radius:var(--r-pill);background:rgba(255,235,244,.12);color:#fff;font-weight:500}
.gf-logout::after{content:"";position:absolute;inset:-4px 0}
.gf-logout:hover{background:rgba(255,107,127,.34);color:#fff}
.gf-logout i{font-size:12px}
@media (max-width:640px){.gf-search{flex-basis:100%}}

/* Sidebar */
.gf-side{display:flex;flex-direction:column;gap:14px}
@media (min-width:901px){.gf-side{max-height:calc(100vh - 116px);max-height:calc(100dvh - 116px);overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--bg-3) transparent}}
.card h3.gf-side-title{display:flex;align-items:center;gap:9px;font-size:17px;margin-bottom:14px}
.gf-side-title i{color:var(--p-300);font-size:15px}
#navigation-sidebar{display:flex;flex-direction:column;gap:2px}
.gf-sep{height:1px;background:var(--line);margin:10px 0}
.gf-label{display:block;padding:0 12px 6px;font-size:13px;line-height:1.3;color:var(--dim)}
.gf-label-18{color:#ffb7c2}
.category-tab{display:flex;align-items:center;width:100%;min-height:44px;padding:8px 12px;border:1px solid transparent;border-radius:var(--r-sm);background:none;color:var(--muted);font:500 14.5px/1.25 var(--body);text-align:left;cursor:pointer;transition:background .15s,color .15s,border-color .15s}
.category-tab:hover{background:var(--glass-2);color:var(--ink)}
.category-tab.active{background:rgba(245,61,146,.17);border-color:rgba(255,108,174,.3);color:var(--p-100)}
@media (pointer:fine) and (min-width:901px){.category-tab{min-height:38px;padding-block:6px}}
.gf-gate{display:flex;flex-direction:column;gap:12px}
.gf-gate h3.gf-side-title{margin-bottom:0}
.gf-gate h3.gf-side-title i{color:#ffb7c2}
.gf-consent{display:flex;align-items:center;justify-content:center;gap:9px;min-height:40px;padding:6px 12px;border-radius:var(--r-sm);background:var(--glass);border:1px solid var(--line);color:var(--ink-2);font-size:14px;font-weight:500}
.gf-consent.is-on{background:rgba(95,224,163,.1);border-color:rgba(95,224,163,.28);color:#bff3d8}
.gf-consent.is-off{background:rgba(255,107,127,.1);border-color:rgba(255,107,127,.3);color:#ffc9d2}
.gf-consent.is-off .dot{animation:gf-pulse 1.6s ease-in-out infinite}
@keyframes gf-pulse{50%{opacity:.35}}
.gf-gate .btn{width:100%;min-height:40px}
@media (max-width:900px){
  #navigation-sidebar{flex-direction:row;flex-wrap:wrap;gap:6px}
  .gf-sep{display:none}
  .gf-label{flex:1 0 100%;padding:8px 2px 2px}
  .gf-label:first-of-type{padding-top:10px}
  .category-tab{width:auto;padding:6px 14px;border-color:var(--line);border-radius:var(--r-pill);background:var(--glass);color:var(--ink-2)}
  .category-tab.active{color:var(--p-100)}
}

/* Gallery */
.gf-main{min-width:0}
.gf-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 14px;margin-bottom:clamp(20px,3vw,30px)}
.gf-head h2{font-size:clamp(28px,3.4vw,40px);min-width:0;overflow-wrap:anywhere}
.gf-hint{flex:1 0 100%;color:var(--muted);font-size:14.5px}
.gf-canvas{display:flex;flex-direction:column;gap:clamp(30px,4vw,48px)}
.gf-section{min-width:0}
.gf-section-head{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding-bottom:12px;margin-bottom:16px;border-bottom:1px solid var(--line)}
.gf-section-head h3{margin-right:auto;font-size:21px;min-width:0}
/* Any media shape fits: a fixed frame, with the image contained inside it. */
.gf-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,236px),1fr));gap:14px}
.gf-card{display:flex;flex-direction:column;min-width:0;border-radius:var(--r-lg);border:1px solid var(--line);background:linear-gradient(180deg,rgba(255,235,244,.055),rgba(255,235,244,.022));overflow:hidden;cursor:pointer;transition:border-color .2s,transform .2s var(--ease)}
.gf-card:hover{border-color:rgba(255,156,199,.34);transform:translateY(-2px)}
.gf-card-ph{cursor:default}
.gf-card-ph:hover{border-color:var(--line);transform:none}
.gf-media{position:relative;display:block;width:100%;aspect-ratio:4/3;padding:0;border:0;border-bottom:1px solid var(--line);background:var(--bg-1);color:inherit;font:inherit;overflow:hidden;cursor:pointer}
.gf-media:focus-visible{outline-offset:-3px;border-radius:var(--r-lg) var(--r-lg) 0 0}
.gf-img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;user-select:none;transition:opacity .3s,transform .35s var(--ease)}
.gf-card:hover .gf-img:not(.nsfw-blurred){transform:scale(1.03)}
.gf-broken::after{content:"Preview unavailable";position:absolute;inset:0;display:grid;place-items:center;color:var(--dim);font-size:13.5px}
.skeleton{background:linear-gradient(100deg,var(--bg-2) 30%,var(--bg-3) 50%,var(--bg-2) 70%);background-size:220% 100%;animation:gf-shimmer 1.5s linear infinite}
@keyframes gf-shimmer{from{background-position:120% 0}to{background-position:-120% 0}}
.gf-ph{display:block;height:13px;border-radius:7px}
.gf-ph-short{width:56%}

/* Age-restricted previews stay blurred until the gate is approved. */
.nsfw-blurred{filter:blur(24px);transform:scale(1.15);transition:filter .3s ease,transform .3s ease,opacity .3s}
.nsfw-overlay{position:absolute;inset:0;z-index:2;display:flex;align-items:center;justify-content:center;background:rgba(11,6,9,.45);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);pointer-events:none}
.gf-lockcard{display:flex;flex-direction:column;align-items:center;gap:2px;padding:12px 18px;border-radius:var(--r);background:rgba(11,6,9,.82);border:1px solid rgba(255,108,174,.3);text-align:center}
.gf-lockcard i{margin-bottom:5px;color:var(--p-300);font-size:20px}
.gf-lockcard-title{color:var(--ink);font-size:13.5px;font-weight:600}
.gf-lockcard-sub{color:var(--p-200);font-size:12.5px}

.gf-info{display:flex;flex-direction:column;gap:7px;flex:1;min-width:0;padding:13px 14px 12px}
.gf-meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.gf-cat{color:var(--p-300);font-size:13px}
.gf-name{font-size:16.5px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gf-foot{display:flex;margin-top:auto;padding-top:9px;cursor:default}

.vote-widget{display:inline-flex;gap:2px;padding:2px;border-radius:var(--r-pill);background:var(--glass);border:1px solid var(--line)}
.vote-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:60px;min-height:40px;padding:0 13px;border:0;border-radius:var(--r-pill);background:none;color:var(--ink-2);font:500 14px/1 var(--body);font-variant-numeric:tabular-nums;cursor:pointer;transition:background .15s,color .15s}
.vote-btn::after{content:"";position:absolute;inset:-4px 0}
.vote-btn:hover{background:var(--glass-2);color:var(--ink)}
.vote-btn.upvote-btn.active{background:rgba(245,61,146,.24);color:var(--p-100)}
.vote-btn.downvote-btn.active{background:rgba(255,107,127,.2);color:#ffc9d2}

/* Dialogs */
.gf-modal{position:fixed;inset:0;z-index:5000;display:grid;place-items:center;padding:16px;background:rgba(8,3,6,.82);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);overflow-y:auto}
#chrono-loader{z-index:6000}
.gf-modal-card{width:min(540px,100%);max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);overflow-y:auto;padding:clamp(22px,3vw,32px);background:var(--bg-2);border:1px solid var(--line-2);border-radius:26px;box-shadow:var(--shadow);animation:pop .28s var(--ease)}
.gf-modal-card .eyebrow{margin-bottom:8px;color:#ffb7c2}
.gf-modal-card h2{font-size:clamp(26px,4vw,32px)}
.gf-modal-text{margin-top:12px;color:var(--ink-2)}
.gf-note{margin-top:16px;padding:12px 14px;border-radius:var(--r-sm);background:var(--glass);border:1px solid var(--line);color:var(--muted);font-size:14px;overflow-wrap:anywhere}
.gf-modal-actions{margin-top:20px}
.gf-modal-actions .btn-pink{flex:1 1 200px}
.gf-modal-actions .btn:not(.btn-pink){flex:0 1 auto}
.gf-icon-bad{background:rgba(255,107,127,.14);color:#ffb7c2}
.gf-icon-center{margin-inline:auto}
.gf-loader{width:min(420px,100%);text-align:center}
.gf-spinner{width:44px;height:44px;margin:4px auto 0;border-radius:50%;border:4px solid var(--line-2);border-top-color:var(--p-400);animation:gf-spin .8s linear infinite}
@keyframes gf-spin{to{transform:rotate(360deg)}}
.gf-loader-title{margin-top:18px;color:var(--ink);font:700 22px/1.2 var(--display);letter-spacing:-.02em}
.gf-loader .bar{margin-top:16px}
.gf-loader .bar i{transition:width .1s}
.gf-loader-status{margin-top:12px;color:var(--muted);font-size:14px}

/* Lightbox */
.gf-lb{position:fixed;inset:0;z-index:4000;display:flex;flex-direction:column;gap:12px;padding:clamp(12px,2vw,24px);background:rgba(8,3,6,.95);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);overflow-y:auto}
.gf-lb-top{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;width:100%;max-width:1380px;margin-inline:auto}
.gf-lb-top .btn{min-height:44px}
.gf-lb-top kbd{padding:1px 6px;border:1px solid var(--line-2);border-radius:6px;color:var(--muted);font-size:12px}
.gf-lb-body{flex:1 1 auto;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 350px;grid-template-rows:minmax(0,1fr);gap:14px;width:100%;max-width:1380px;margin-inline:auto}
.gf-lb-stage{position:relative;min-height:0;border-radius:var(--r-lg);border:1px solid var(--line);background:var(--bg-1);overflow:hidden}
#lightbox-image-wrapper{position:absolute;inset:12px;border-radius:var(--r-sm)}
#lightbox-image{position:absolute;inset:0;max-width:100%;max-height:100%;height:auto;margin:auto;object-fit:contain;transition:opacity .25s}
.gf-lb-nav{position:absolute;top:50%;z-index:2;display:grid;place-items:center;width:48px;height:48px;border-radius:50%;border:1px solid rgba(255,235,244,.2);background:rgba(20,6,14,.72);color:#fff;font-size:16px;cursor:pointer;transform:translateY(-50%);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);transition:background .15s}
.gf-lb-nav:hover{background:var(--p-700)}
.gf-lb-prev{left:12px}
.gf-lb-next{right:12px}
.gf-lb-panel{display:flex;flex-direction:column;gap:16px;min-width:0;padding:clamp(18px,2vw,24px);border-radius:var(--r-lg);border:1px solid var(--line);background:var(--bg-2);overflow-y:auto}
.gf-lb-panel h2{font-size:clamp(22px,2.2vw,28px);overflow-wrap:anywhere}
.gf-field-label{display:block;margin-bottom:6px;color:var(--muted);font-size:13.5px;font-weight:500}
.gf-copy{display:flex;align-items:center;gap:8px}
.gf-copy input[type=text]{flex:1;min-width:0;margin:0;font:400 13px/1.4 var(--mono)}
.gf-copy .btn{flex:none;min-height:44px}
.gf-block{width:100%}
@media (max-width:900px){
  .gf-lb-body{display:flex;flex-direction:column;flex:1 0 auto;min-height:auto}
  .gf-lb-stage{flex:1 1 auto;min-height:240px}
  .gf-lb-panel{flex:none;overflow:visible}
}
@media (max-width:640px){
  .gf-lb-nav{width:44px;height:44px}
  .gf-lb-prev{left:6px}
  .gf-lb-next{right:6px}
}

/* Toast */
.gf-toast{position:fixed;right:24px;bottom:24px;z-index:9000;display:flex;align-items:center;gap:10px;max-width:calc(100vw - 32px);padding:13px 18px;border-radius:var(--r);background:var(--bg-3);border:1px solid var(--line-2);color:var(--ink);font-size:14.5px;font-weight:500;box-shadow:var(--shadow);opacity:0;visibility:hidden;transform:translateY(16px);transition:opacity .25s,transform .25s var(--ease),visibility .25s}
.gf-toast.show{opacity:1;visibility:visible;transform:none}
.gf-toast i{color:var(--p-300)}
.gf-toast.is-error{background:#2b1218;border-color:rgba(255,107,127,.4);color:#ffc9d2}
.gf-toast.is-error i{color:var(--bad)}
@media (max-width:640px){.gf-toast{left:16px;right:16px;bottom:16px}}
