:root {
  --bg: #120a06;
  --panel: #1b100a;
  --accent: #d99b3f;
  --accent-dim: #8a6428;
  --text: #f1e3c9;
  --text-dim: #b8a586;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overscroll-behavior: none;
}

.app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100vw;
}

/* ---------- Top bar ---------- */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent);
  position: relative;
  z-index: 5;
}

.brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.counter {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  flex: 0 0 auto;
  margin-left: 12px;
  background: rgba(0,0,0,0.35);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(217,155,63,0.3);
}

/* ---------- Viewer ---------- */
.viewer {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  touch-action: none;
  background: var(--bg);
}

.track {
  position: absolute;
  inset: 0;
  display: flex;
  height: 100%;
  will-change: transform;
}

.slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-inner {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
  background: #1a1a1a;
}

/* ---------- Nav buttons ---------- */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(217,155,63,0.35);
  background: rgba(0,0,0,0.4);
  color: var(--accent);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  z-index: 4;
  transition: opacity 0.2s;
}
.nav-btn:active { transform: translateY(-50%) scale(0.92); }
.nav-btn:disabled { opacity: 0; pointer-events: none; }
.nav-prev { left: 12px; }
.nav-next { right: 12px; }

@media (hover: none) {
  .nav-btn { display: none; }
}

/* ---------- Zoom hint ---------- */
.zoom-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(0,0,0,0.45);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(217,155,63,0.25);
  opacity: 1;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 4;
  white-space: nowrap;
}
.zoom-hint.hidden { opacity: 0; }

/* ---------- Bottom bar ---------- */
.bottombar {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px max(8px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
}

.dots {
  display: flex;
  gap: 8px;
}

.credit {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text-dim);
}

.credit a {
  color: var(--accent);
  text-decoration: none;
}

.credit a:hover {
  text-decoration: underline;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.dot.active {
  background: var(--accent);
  transform: scale(1.3);
}
