:root {
  --bg: #0a0a0a;
  --fg: #f5f5f5;
  --muted: #a3a3a3;
  --accent: #e11d48;
  --accent-hover: #be123c;
  --panel: #171717;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

body {
  position: relative;
}

.feed {
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.chrome-bar {
  position: fixed;
  top: auto;
  bottom: calc(0.4rem + var(--safe-bottom));
  left: 50%;
  z-index: 30;
  transform: translateX(-50%);
  display: grid;
  gap: 0.28rem;
  width: min(calc(100vw - 1rem), 26rem);
  padding: 0.28rem;
  border-radius: 16px;
  background: rgba(23, 23, 23, 0.92);
  border: 1px solid #303030;
  backdrop-filter: blur(8px);
}

.chrome-bar[hidden] {
  display: none;
}

.chrome-bar__row {
  display: flex;
  gap: 0.22rem;
  justify-content: stretch;
}

.chrome-bar__btn {
  flex: 1;
  min-height: 1.95rem;
  padding: 0.28rem 0.35rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.chrome-bar__btn.is-active {
  background: var(--accent);
  color: #fff;
}

.chrome-bar__row--sort .chrome-bar__btn.is-active {
  background: #334155;
}

/* ---- Site header ---- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.site-header__link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.site-header__logo {
  height: 1.6rem;
  width: auto;
  display: block;
}

.site-header__search {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f5f5f5;
  cursor: pointer;
}

.site-header__search svg {
  width: 1.1rem;
  height: 1.1rem;
}

.site-header__search.is-active {
  background: var(--accent);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.site-header__clear {
  height: 2.25rem;
  padding: 0 0.65rem;
  border: 0;
  border-radius: 999px;
  background: #334155;
  color: #f5f5f5;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.site-header__clear[hidden] {
  display: none;
}

.search-panel {
  position: fixed;
  top: calc(2.6rem + var(--safe-top));
  left: 0;
  right: 0;
  z-index: 850;
  padding: 0.6rem 0.75rem;
  background: rgba(22, 25, 46, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0.8rem 1.8rem rgba(0, 0, 0, 0.28);
}

.search-panel__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.35rem;
  max-width: 44rem;
  margin: 0 auto;
}

.search-panel__input {
  min-width: 0;
  height: 2.35rem;
  padding: 0 0.7rem;
  border: 1px solid #4b5563;
  border-radius: 0.55rem;
  background: #0d0e16;
  color: var(--fg);
  font: inherit;
  font-size: 0.84rem;
}

.search-panel__input:focus {
  outline: 2px solid #fb7185;
  outline-offset: 1px;
}

.search-panel__submit,
.search-panel__cancel {
  border: 0;
  border-radius: 0.55rem;
  color: #fff;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.search-panel__submit {
  padding: 0 0.7rem;
  background: var(--accent);
}

.search-panel__cancel {
  padding: 0 0.55rem;
  background: transparent;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Card ---- */
.card {
  position: relative;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  /* title+fav / rating / video / CTA / future slot */
  grid-template-rows: auto auto auto auto 1fr;
  gap: 0.45rem;
  align-content: start;
  padding:
    calc(3.2rem + var(--safe-top))
    1rem
    calc(5.6rem + var(--safe-bottom));
  background:
    radial-gradient(120% 80% at 50% 0%, #1a1a1a 0%, var(--bg) 55%);
}

.card.is-favorite .card__fav {
  color: #fb7185;
}

.card__header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: start;
}

.card__title {
  margin: 0;
  min-width: 0;
  font-size: clamp(0.95rem, 3.6vw, 1.1rem);
  font-weight: 700;
  line-height: 1.35;
  max-height: 2.7em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  width: 2.75rem;
}

.card__review {
  margin: 0;
  min-height: 1.15em;
  color: #fbbf24;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.card__review--empty {
  visibility: hidden;
}

.card__media {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 0;
}

.card__slot {
  min-height: 0;
  display: flex;
  align-items: stretch;
}

.card__offer {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: rgba(23, 23, 23, 0.92);
  border: 1px solid #303030;
}

.card__offer.is-sale {
  border-color: rgba(225, 29, 72, 0.55);
  background: linear-gradient(180deg, rgba(225, 29, 72, 0.14), rgba(23, 23, 23, 0.92));
}

.card__offer-price {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.card__offer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.card__offer-amount {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.card__offer-campaign {
  margin: 0.35rem 0 0;
  color: #fda4af;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__offer-note {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.card__offer-link {
  display: inline-block;
  margin-top: 0.45rem;
  color: #e5e5e5;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.card__offer-meta {
  margin: 0.35rem 0 0;
  color: #d4d4d4;
  font-size: 0.8rem;
  line-height: 1.4;
  display: flex;
  min-width: 0;
  white-space: nowrap;
}

.card__offer-actresses {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__offer-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  margin-right: 0.35rem;
  flex: 0 0 auto;
}

.card__offer-genres {
  margin: 0.35rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.card__offer-tag {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #d4d4d4;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.card__service-credit {
  margin: 0.75rem 0 0;
  color: #737373;
  font-size: 0.65rem;
  line-height: 1.35;
  text-align: center;
}

.card__service-credit a {
  color: inherit;
  text-underline-offset: 0.15em;
}

.card__seen {
  margin: 0;
  width: 100%;
  text-align: center;
  color: #94a3b8;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  visibility: hidden;
  opacity: 0;
}

.card__seen.is-on {
  visibility: visible;
  opacity: 1;
  color: #cbd5e1;
}

.card.is-viewed .card__seen.is-on {
  color: #94a3b8;
}

.card__fav {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.75);
  color: #d4d4d4;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.card__fav.is-on {
  color: #fb7185;
}

.card__fav:active {
  transform: scale(0.96);
}

.empty-state {
  height: 100dvh;
  display: grid;
  place-content: center;
  gap: 0.55rem;
  padding: 1.5rem;
  text-align: center;
}

.empty-state__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.empty-state__text {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.card__frame {
  width: min(100%, 720px);
  aspect-ratio: 720 / 480;
  background: #000;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  touch-action: none;
  overscroll-behavior: none;
}

.card__frame iframe,
.card__frame .card__player {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  overflow: hidden;
  background: #000;
  pointer-events: auto;
}

.card__frame img,
.card__frame .card__poster {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  border: 0;
}

.card__poster--empty {
  background: #111;
}

.card__video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.vid-ui {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.vid-ui.is-hidden {
  opacity: 0;
}

.vid-ui.is-visible {
  opacity: 1;
}

.vid-ui__badge {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.vid-ui__badge[hidden] {
  display: none;
}

.vid-ui__controls {
  position: absolute;
  left: 50%;
  bottom: 0.55rem;
  transform: translateX(-50%);
  display: flex;
  gap: 0.35rem;
  pointer-events: auto;
}

.vid-ui__btn {
  min-width: 2.55rem;
  height: 2.55rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.82);
  color: #e5e5e5;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vid-ui__btn--text {
  letter-spacing: 0.02em;
}

.vid-ui__icon {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}

.vid-ui__btn.is-muted {
  color: #fda4af;
}

.vid-ui__btn:active {
  transform: scale(0.96);
}

.card__play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  transform: translate(-50%, -50%);
  width: 4.25rem;
  height: 4.25rem;
  border: 0;
  border-radius: 999px;
  background: rgba(225, 29, 72, 0.92);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.card__play:active {
  transform: translate(-50%, -50%) scale(0.96);
}

.card__play[hidden] {
  display: none;
}

.card__fallback-note {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0.45rem 0.6rem;
  font-size: 0.75rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
  text-align: center;
}

.card__cta {
  display: block;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  color: #fff;
  background: var(--accent);
}

.card__cta:hover,
.card__cta:focus-visible {
  background: var(--accent-hover);
}

.card__cta[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.45;
}

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    linear-gradient(160deg, #141414 0%, #050505 100%);
}

.age-gate[hidden] {
  display: none;
}

.age-gate__panel {
  width: min(100%, 22rem);
  padding: 1.75rem 1.35rem;
  border-radius: 16px;
  background: var(--panel);
  text-align: center;
}

.age-gate__brand {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.age-gate__title {
  margin: 0 0 0.75rem;
  font-size: 1.45rem;
}

.age-gate__text {
  margin: 0 0 1.35rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.age-gate__actions {
  display: grid;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 0;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn--primary {
  color: #fff;
  background: var(--accent);
}

.btn--ghost {
  color: var(--fg);
  background: transparent;
  border: 1px solid #404040;
}

.status {
  position: fixed;
  left: 50%;
  bottom: calc(5.8rem + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 20;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(23, 23, 23, 0.92);
  color: var(--muted);
  font-size: 0.82rem;
  pointer-events: none;
}

.status[hidden] {
  display: none;
}

.status--error {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.92);
}
