
:root {
  --bg: #12090b;
  --panel: #1a1014;
  --panel-2: #24151c;
  --text: #f4ecd9;
  --muted: #b39a9a;
  --gold: #c45c4a;
  --line: rgba(244, 236, 217, 0.12);
  --safe-t: env(safe-area-inset-top);
  --safe-b: env(safe-area-inset-bottom);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font-family: Georgia, "Times New Roman", serif; overflow: hidden; }
button, a, .muted, .kicker, .credit, .tabs, .toggle, .fine, .chips {
  font-family: system-ui, -apple-system, sans-serif;
}
.skip { position: absolute; left: -999px; }
.app { height: 100%; display: flex; flex-direction: column; }
.top {
  display: flex; justify-content: center;
  padding: calc(10px + var(--safe-t)) 16px 8px; z-index: 5;
}
.toggle {
  display: flex; background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px;
}
.toggle button {
  border: 0; background: transparent; color: var(--muted);
  padding: 8px 20px; border-radius: 999px; font-weight: 650; cursor: pointer;
}
.toggle button.on { background: #efe6d4; color: #1a1408; }
.feed {
  flex: 1; overflow-y: auto; scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.feed::-webkit-scrollbar { display: none; }
.slide {
  min-height: 100%; height: 100%;
  scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; flex-direction: column; position: relative; background: #000;
}
.slide img { width: 100%; height: 42vh; object-fit: cover; background: #111; cursor: pointer; }
.panel {
  flex: 1; background: linear-gradient(#151b30, #12090b);
  padding: 18px; border-top: 1px solid var(--line); overflow: auto;
}
.kicker { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 8px; }
h1 { font-size: clamp(24px, 7vw, 32px); line-height: 1.12; margin: 0 0 12px; font-weight: 500; }
.extract { font-size: 17px; line-height: 1.45; color: #e8dfcc; margin: 0 0 14px; }
.credit { font-size: 12px; color: var(--muted); margin: 0 0 14px; line-height: 1.4; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions button, .actions a, .ghost, .chips button {
  background: var(--panel-2); color: var(--text); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px;
  cursor: pointer; font-size: 14px;
}
.actions .liked { color: #ff6b7a; border-color: #ff6b7a; }
.ghost { margin: 12px 0; }
body.watch .top { position: absolute; left: 0; right: 0; }
body.watch .slide img { height: 100%; position: absolute; inset: 0; }
body.watch .panel,
body.watch .media-hint,
body.watch .yt-note,
body.watch .credit { display: none !important; }
body.watch .extract { display: none; }
body.watch .slide { background:#000; }
body.watch .tabs { background: transparent; border-color: transparent; }
.tabs {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #0e1426; border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b); z-index: 6;
}
.tabs button { background: none; border: 0; color: var(--muted); padding: 12px 0 10px; cursor: pointer; font-weight: 600; }
.tabs button.on { color: var(--gold); }
.screen { flex: 1; overflow: auto; padding: 22px 18px calc(24px + var(--safe-b)); }
.screen h2 { margin: 8px 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 12px 0; }
.card h3 { margin: 14px 0 4px; font-size: 16px; font-family: system-ui, sans-serif; }
.card h3:first-child { margin-top: 0; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.45; }
.brand-row { display: flex; gap: 12px; align-items: center; margin: 12px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chips button.on { background: #efe6d4; color: #1a1408; }
.empty { color: var(--muted); padding: 20px 0; }
.overlay {
  position: fixed; inset: 0; background: var(--bg); z-index: 30;
  display: flex; flex-direction: column;
  padding: calc(28px + var(--safe-t)) 22px calc(20px + var(--safe-b));
}
.overlay[hidden] { display: none !important; }
.overlay h2 { font-size: 34px; margin: 10px 0 12px; }
.overlay p { color: #d7ceb9; font-size: 18px; line-height: 1.4; }
.overlay-foot { margin-top: auto; }
.primary {
  width: 100%; border: 0; background: #efe6d4; color: #1a1408;
  border-radius: 999px; padding: 16px; font-size: 17px; font-weight: 700; cursor: pointer;
}
.fine { font-size: 12px; color: var(--muted); text-align: center; margin-top: 12px; }
.fine-left { text-align: left; }
.text-btn { background: none; border: 0; color: var(--muted); cursor: pointer; }
.skip-btn { align-self: flex-end; }
.brand { color: var(--gold); font-weight: 700; letter-spacing: .02em; font-family: system-ui, sans-serif; }
.point { display: grid; grid-template-columns: 36px 1fr; gap: 10px; margin: 12px 0; color: #d7ceb9; font-size: 16px; }
.point b { display: block; color: var(--text); }
.burst {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%,-50%) scale(.4);
  font-size: 84px; color: #ff6b7a; pointer-events: none; z-index: 40;
  animation: pop .55s ease-out;
}
.burst[hidden] { display: none; }
@keyframes pop {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(.3); }
  35% { opacity: 1; transform: translate(-50%,-50%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%,-60%) scale(1.3); }
}
.saved-card { cursor: pointer; }

.img-ph{width:100%;height:42vh;background:linear-gradient(180deg,#24151c,#12090b);}
body.watch .img-ph{height:100%;position:absolute;inset:0;}

.tags { display:flex; flex-wrap:wrap; gap:6px; margin: 0 0 12px; }
.tags button, .tag {
  background: transparent; color: var(--gold); border: 1px solid rgba(224,179,90,.35);
  border-radius: 999px; padding: 5px 10px; font-size: 12px; cursor: pointer;
}
.why { font-size: 12px; color: var(--muted); margin: 0 0 10px; font-family: system-ui, sans-serif; }

.feed-count{position:absolute;right:10px;top:calc(12px + var(--safe-t));font:12px system-ui;color:var(--muted);margin:0;max-width:42%;text-align:right;}
.top{position:relative;}

.search { display:flex; gap:8px; margin: 12px 0; }
.search input {
  flex:1; background: var(--panel); border:1px solid var(--line); color:var(--text);
  border-radius: 999px; padding: 12px 14px; font-size: 16px;
}
.search button { background:#efe6d4; color:#1a1408; border:0; border-radius:999px; padding:12px 16px; font-weight:700; }
.rail {
  position:absolute; right:10px; bottom: 22%; display:flex; flex-direction:column; gap:10px; z-index:4;
}
.rail button {
  width:44px; height:44px; border-radius:50%; border:1px solid var(--line);
  background: rgba(11,16,32,.55); color: var(--text); backdrop-filter: blur(8px);
  font-size:18px; cursor:pointer;
}
.rail button.liked { color: var(--gold); border-color: var(--gold); }
.rail button.kept { color: var(--gold); }
body.watch .actions { display:none; }
.burst { color: var(--gold); font-size: 92px; }
.expand {
  position:fixed; inset:0; background: rgba(6,9,18,.96); z-index:25;
  overflow:auto; padding: calc(52px + var(--safe-t)) 18px calc(24px + var(--safe-b));
}
.expand[hidden] { display:none; }
.expand img { width:100%; max-height:52vh; object-fit:cover; border-radius:12px; }
.expand-close {
  position:fixed; top: calc(10px + var(--safe-t)); right:14px; z-index:26;
  background:#efe6d4; color:#1a1408; border:0; border-radius:999px; padding:8px 14px; font-weight:700;
}
.hit { cursor:pointer; }

.rail { opacity:1; transition: opacity .35s ease; }
.rail.gone { opacity:0; pointer-events:none; }
body:not(.watch) .rail { bottom: 28%; }

.slide.twin { background: linear-gradient(#12182c,#12090b); }
.slide.twin .twin-grid { padding: 18px; display:flex; flex-direction:column; gap:12px; overflow:auto; flex:1; }
.slide.twin h1 { font-size: 22px; }
.twin-half { border:1px solid var(--line); border-radius:12px; padding:12px; background: var(--panel); }
.pack-chip { font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--gold); }

.ytwrap { position:relative; width:100%; height:42vh; background:#000; }
body.watch .ytwrap { height:100%; position:absolute; inset:0; }
.ytwrap iframe { width:100%; height:100%; border:0; }
.play-tr {
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  background:#c45c4a; color:#fff; border:0; border-radius:999px; padding:12px 18px;
  font-weight:700; z-index:3; cursor:pointer;
}
.yt-note { font-size:12px; color:var(--muted); }

.media { position:relative; width:100%; height:42vh; overflow:hidden; background:#000; touch-action:pan-y; }
body.watch .media { height:100%; position:absolute; inset:0; }
.media-track { display:flex; width:200%; height:100%; transition: transform .25s ease; }
.media-track > * { width:50%; height:100%; flex:0 0 50%; }
.media .ytwrap, .media .still, .media img { width:100%; height:100%; object-fit:cover; }
.media-hint { position:absolute; left:10px; bottom:10px; margin:0; font:11px system-ui; color:#efe6d4; text-shadow:0 1px 3px #000; pointer-events:none; }

.commons-av audio { position:absolute; left:12px; right:12px; bottom:36px; width:calc(100% - 24px); }
.commons-av video { width:100%; height:100%; object-fit:cover; background:#000; }
