:root {
  --bg: #11100f;
  --surface: #1a1816;
  --surface-2: #24211e;
  --text: #f4efe8;
  --muted: #9c948a;
  --accent: #e57145;
  --accent-soft: #3a231a;
  --line: rgba(255, 255, 255, .09);
  --radius: 20px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 70% -20%, #38251d 0, transparent 38rem), var(--bg); }
button, input { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.login-page { display: grid; place-items: center; padding: 24px; }
.login-shell { width: min(100%, 440px); }
.login-card { border: 1px solid var(--line); border-radius: 28px; background: rgba(26, 24, 22, .94); padding: 36px; box-shadow: 0 30px 90px rgba(0, 0, 0, .35); }
.brand-mark { width: 50px; height: 50px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 12px; border-radius: 16px; background: var(--accent); margin-bottom: 30px; transform: rotate(8deg); }
.brand-mark span { display: block; border-radius: 99px; background: #1c1512; }
.eyebrow { color: var(--accent); letter-spacing: .18em; font-size: .72rem; font-weight: 800; }
h1 { font-size: clamp(2.15rem, 8vw, 4.7rem); line-height: .96; letter-spacing: -.055em; margin: 10px 0 14px; }
.login-card h1 { font-size: clamp(2rem, 9vw, 3.2rem); }
.login-copy { color: var(--muted); line-height: 1.55; margin: 0 0 28px; }
.login-form { display: grid; gap: 12px; }
.login-form label { font-size: .83rem; color: #d2cbc2; font-weight: 700; }
.login-form input { width: 100%; color: var(--text); background: #100f0e; border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; outline: none; }
.login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(229, 113, 69, .13); }
.captcha-wrap { min-height: 65px; margin: 4px 0; }
.primary-button, .load-more { border: 0; border-radius: 14px; padding: 15px 18px; background: var(--accent); color: #1b110d; font-weight: 850; cursor: pointer; }
.primary-button:disabled { opacity: .45; cursor: wait; }
.alert { color: #ffb49c; background: #361d18; border: 1px solid #643024; border-radius: 12px; padding: 12px 14px; margin: 18px 0; font-size: .9rem; }
.microcopy { color: #756e66; text-align: center; font-size: .75rem; margin: 20px 0 0; }

.topbar { height: 70px; padding: 0 clamp(18px, 5vw, 64px); display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); background: rgba(17, 16, 15, .82); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; gap: 9px; align-items: center; color: var(--text); font-weight: 900; letter-spacing: .13em; font-size: .8rem; text-decoration: none; }
.brand-dot { width: 19px; height: 19px; border-radius: 7px 3px 7px 3px; background: var(--accent); transform: rotate(10deg); }
.security-status { margin-left: auto; color: #aaa299; font-size: .76rem; display: flex; align-items: center; gap: 7px; }
.security-status span { width: 7px; height: 7px; border-radius: 50%; background: #69ba7f; box-shadow: 0 0 0 4px rgba(105, 186, 127, .1); }
.icon-button { border: 1px solid var(--line); background: var(--surface); width: 38px; height: 38px; border-radius: 12px; cursor: pointer; }
.catalog-shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 64px 0 90px; }
.hero { max-width: 700px; margin-bottom: 46px; }
.hero p:last-child { color: var(--muted); font-size: 1.05rem; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: min(100%, 420px); padding: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 17px; margin-bottom: 28px; }
.tab { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; color: var(--muted); border-radius: 12px; padding: 12px 15px; cursor: pointer; font-weight: 750; }
.tab.active { background: var(--surface-2); color: var(--text); box-shadow: 0 5px 20px rgba(0, 0, 0, .18); }
.tab b { color: var(--accent); margin-left: auto; font-size: .78rem; }
.tab-icon { color: var(--accent); }
.media-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; min-height: 240px; }
.media-card { min-width: 0; border: 0; padding: 0; text-align: left; background: transparent; cursor: pointer; }
.media-visual { position: relative; display: grid; place-items: center; overflow: hidden; aspect-ratio: 4 / 5; border-radius: var(--radius); background: linear-gradient(145deg, #2b2723, #171513); border: 1px solid var(--line); }
.media-card.video .media-visual { aspect-ratio: 16 / 10; background: radial-gradient(circle at 50% 40%, #403028, #171513 68%); }
.media-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.25)); pointer-events: none; }
.media-visual img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, opacity .2s; user-select: none; }
.media-card:hover img { transform: scale(1.035); }
.play-mark { width: 54px; height: 54px; display: grid; place-items: center; padding-left: 3px; background: var(--accent); color: #23140f; border-radius: 50%; box-shadow: 0 12px 38px rgba(0,0,0,.3); }
.media-label { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #cdc6bd; padding: 10px 3px 2px; font-size: .86rem; }
.load-more { display: block; margin: 38px auto 0; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.notice { color: var(--muted); padding: 32px 0; }

.viewer { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 56px 18px 24px; background: rgba(5, 5, 5, .94); backdrop-filter: blur(22px); }
.viewer-stage { min-height: 0; width: 100%; height: 100%; display: grid; place-items: center; }
.viewer-stage img, .viewer-stage video { display: block; max-width: 100%; max-height: 78vh; border-radius: 12px; box-shadow: 0 20px 80px rgba(0,0,0,.45); user-select: none; }
.viewer-title { margin: 16px 0 0; color: #c4bdb5; }
.viewer-close { position: fixed; top: 16px; right: 16px; z-index: 2; border: 1px solid var(--line); width: 42px; height: 42px; border-radius: 50%; background: #24211e; font-size: 1.55rem; cursor: pointer; }
.viewer-open { overflow: hidden; }
.device-gate { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; background: var(--bg); transition: opacity .25s; }
.device-gate span { max-width: 310px; color: var(--muted); font-size: .9rem; }
.device-gate.done { opacity: 0; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--accent); animation: spin .7s linear infinite; margin-bottom: 8px; }
.noscript { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--bg); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) { .media-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) {
  .topbar { height: 62px; padding: 0 16px; }
  .security-status { font-size: 0; }
  .catalog-shell { width: min(100% - 24px, 1180px); padding-top: 42px; }
  .hero { margin-bottom: 32px; }
  .hero h1 { font-size: 3.3rem; }
  .tabs { width: 100%; position: sticky; top: 72px; z-index: 10; }
  .media-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .media-visual { border-radius: 15px; }
  .media-label { font-size: .78rem; }
  .login-card { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
