/* ========================
   Reset & Base
   ======================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1e1e1e;
  --text: #f0f0f0;
  --text-muted: #888;
  --accent: #e0a050;
  --accent-dim: rgba(224, 160, 80, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  /* Prevent image saving on mobile */
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ========================
   Image Protection
   ======================== */
img,
.gallery__item-img,
.lightbox__image {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* ========================
   Disclaimer Modal
   ======================== */
.disclaimer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(12px);
}

.disclaimer.hidden {
  display: none;
}

.disclaimer__box {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  padding: 32px 28px;
  text-align: center;
}

.disclaimer__title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 20px;
}

.disclaimer__body {
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.disclaimer__body p {
  margin-bottom: 12px;
}

.disclaimer__body ul {
  list-style: none;
  padding: 0;
  margin-bottom: 12px;
}

.disclaimer__body ul li {
  padding: 4px 0 4px 20px;
  position: relative;
}

.disclaimer__body ul li::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: var(--accent);
}

.disclaimer__body strong {
  color: var(--text);
}

.disclaimer__actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.disclaimer__btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.disclaimer__btn:active {
  opacity: 0.8;
}

.disclaimer__btn--exit {
  background: var(--surface-2);
  color: var(--text-muted);
}

.disclaimer__btn--enter {
  background: var(--accent);
  color: var(--bg);
}

/* ========================
   Header
   ======================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--surface-2);
}

.header__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ========================
   Category Tabs
   ======================== */
.categories {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  position: sticky;
  top: 57px;
  z-index: 99;
}

.categories::-webkit-scrollbar {
  display: none;
}

.categories__tab {
  flex-shrink: 0;
  padding: 8px 18px;
  border: 1px solid var(--surface-2);
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.categories__tab.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.categories__tab:not(.active):active {
  background: var(--surface-2);
}

/* ========================
   Gallery Grid
   ======================== */
.gallery {
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  min-height: 50vh;
}

.gallery__empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 20px;
  color: var(--text-muted);
}

.gallery__item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 832 / 1216;
  background: var(--surface);
  cursor: pointer;
  animation: fadeIn 0.3s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.gallery__item-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.3s;
}

.gallery__item-img.loaded {
  animation: imgFade 0.4s ease;
}

@keyframes imgFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.gallery__item:active .gallery__item-img {
  transform: scale(1.03);
}

.gallery__item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px 10px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  pointer-events: none;
}

.gallery__item-title {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
}

.gallery__item-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========================
   Loader / Spinner
   ======================== */
.gallery__loader {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--surface-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================
   Lightbox
   ======================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 1);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox.open {
  display: flex;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 201;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 201;
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  cursor: pointer;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}

.lightbox__nav--prev {
  left: 8px;
}

.lightbox__nav--next {
  right: 8px;
}

.lightbox__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  max-height: 100%;
  padding: 60px 16px 24px;
  touch-action: pan-y;
}

.lightbox__image {
  width: 90vw;
  max-width: 832px;
  aspect-ratio: 832 / 1216;
  max-height: 75vh;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: var(--radius-sm);
}

/* ========================
   Rating Stars
   ======================== */
.rating {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}

.rating__stars {
  display: flex;
  gap: 4px;
  pointer-events: auto;
}

.rating__star {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  transition: transform 0.15s;
  pointer-events: auto;
}

.rating__star svg {
  width: 28px;
  height: 28px;
  fill: #333;
  stroke: #555;
  stroke-width: 1;
  transition: fill 0.2s, stroke 0.2s;
  pointer-events: none;
}

.rating__star.active svg {
  fill: var(--accent);
  stroke: var(--accent);
}

.rating__star.hover svg {
  fill: #c8943f;
  stroke: #c8943f;
}

.rating__star:active {
  transform: scale(1.2);
}

.rating__avg {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.lightbox__counter {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.lightbox__title {
  margin-top: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

.lightbox__info {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* ========================
   Desktop enhancements
   ======================== */
@media (min-width: 768px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 12px;
  }
}

@media (min-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(4, 1fr);
    max-width: 1200px;
    margin: 0 auto;
    gap: 16px;
    padding: 16px;
  }

  .header, .categories {
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* ========================
   Visually Hidden (SEO)
   ======================== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========================
   Footer
   ======================== */
.footer {
  padding: 32px 20px;
  text-align: center;
  border-top: 1px solid var(--surface-2);
  margin-top: 40px;
}

.footer__text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer__disclaimer {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 8px;
}

.footer__seo {
  font-size: 0.7rem;
  color: #444;
  max-width: 600px;
  margin: 12px auto 0;
  line-height: 1.5;
}
