/* ALL WIN PLAY – responsive landing page */

:root {
  --bg-primary: #241311;
  --bg-header: #050204;
  --bg-section: #302018;
  --bg-section-dark: #1a0e0c;
  --bg-banner-overlay: rgba(0, 0, 0, 0.41);
  --color-gold: #ffd700;
  --color-gold-text: #241311;
  --color-text: #ffffff;
  --color-accent: #f5d78e;
  --color-muted: #ab826d;
  --color-border: #4a3028;
  --font-display: "Anton", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --container-max: 1100px;
  --header-height: 72px;
  --space-section: clamp(48px, 8vw, 80px);
  --space-inline: clamp(16px, 5vw, 80px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-inline);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-gold);
  color: var(--color-gold-text);
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.15s ease;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn:active {
  transform: scale(0.98);
}

.btn--sm {
  padding: 12px 28px;
  font-size: 14px;
}

.btn--primary {
  padding: 16px 40px;
  font-size: 16px;
}

.btn--favorites {
  gap: 8px;
}

.btn__icon {
  flex-shrink: 0;
  width: 1.25em;
  height: 1.25em;
}

.btn--lg {
  padding: 16px 48px;
  font-size: 16px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding-inline: var(--space-inline);
  background: var(--bg-header);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.brand__name {
  font-family: var(--font-display);
  font-size: clamp(18px, 4vw, 22px);
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--color-text);
}

/* Header PLAY NOW – sized for 320px → desktop */
.site-header .btn--header {
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 32px;
  padding: 8px 12px;
  font-size: 11px;
  letter-spacing: 0.04em;
}

/* 375px+ typical phones (iPhone SE 2nd gen, etc.) */
@media (min-width: 375px) {
  .site-header .btn--header {
    padding: 9px 16px;
    font-size: 12px;
    min-height: 34px;
  }
}

/* 414px+ common mobile (iPhone Plus / Pro Max class) */
@media (min-width: 414px) {
  .site-header .btn--header {
    padding: 10px 20px;
    font-size: 13px;
    min-height: 36px;
  }
}

/* Tablet and up – match Pencil header button */
@media (min-width: 768px) {
  .site-header .btn--header {
    padding: 12px 28px;
    font-size: 14px;
    min-height: 41px;
    letter-spacing: 0.02em;
  }
}

/* 320px minimum width – tighten header spacing */
@media (max-width: 374px) {
  .site-header {
    padding-inline: 12px;
    gap: 8px;
  }

  .brand {
    gap: 8px;
    min-width: 0;
  }

  .brand__icon {
    width: 36px;
    height: 36px;
  }

  .brand__name {
    font-size: 15px;
    letter-spacing: 0.03em;
  }
}

/* Hero */
.hero {
  position: relative;
  min-height: min(512px, auto);
  background:
    linear-gradient(var(--bg-banner-overlay), var(--bg-banner-overlay)),
    url("../image/BG.jpg") center / cover no-repeat;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  max-width: 1440px;
  margin-inline: auto;
  /*padding: clamp(32px, 6vw, 48px) var(--space-inline);*/
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
  max-width: 560px;
}

.hero__logo {
  width: min(194px, 50vw);
  height: auto;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 48px);
  font-weight: 400;
  line-height: 1.1;
  color: var(--color-text);
}

.hero__subtitle {
  font-size: clamp(14px, 2.5vw, 16px);
  line-height: 1.5;
  color: var(--color-accent);
  max-width: 480px;
}

.hero__visual {
  width: 100%;
  max-width: 430px;
  display: flex;
  justify-content: center;
}

.hero__character {
  width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: bottom center;
}

/* Banner – mobile: hide character, center content */
@media (max-width: 899px) {
  .hero__visual {
    display: none;
  }

  .hero__content {
    align-items: center;
    max-width: 100%;
    text-align: center;
    padding: clamp(32px, 8vw, 56px) var(--space-inline);
  }

  .hero__logo {
    margin-inline: auto;
  }

  .hero__title,
  .hero__subtitle {
    text-align: center;
  }

  .hero__subtitle {
    max-width: 100%;
  }
}

@media (min-width: 900px) {
  .hero__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
    min-height: 512px;
    padding-inline: clamp(40px, 11vw, 160px);
  }

  .hero__content {
    align-items: flex-start;
    text-align: left;
  }

  .hero__title,
  .hero__subtitle {
    text-align: left;
  }

  .hero__visual {
    display: flex;
    flex-shrink: 0;
    max-width: 430px;
  }
}

/* Section titles */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 400;
  text-align: center;
  line-height: 1.15;
  margin-bottom: clamp(32px, 5vw, 48px);
}

.section-title--lg {
  font-size: clamp(28px, 5.5vw, 40px);
}

.section-cta {
  display: flex;
  justify-content: center;
  margin-top: clamp(32px, 5vw, 40px);
}

/* Games */
.games {
  padding-block: var(--space-section);
  background: var(--bg-section);
}

.games__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.game-card {
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 240 / 160;
  transition: transform 0.2s ease;
}

.game-card:hover {
  transform: translateY(-4px);
}

.game-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 600px) {
  .games__grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
}

@media (min-width: 900px) {
  .games__grid {
    gap: 20px;
  }
}

/* Reasons */
.reasons {
  padding-block: var(--space-section);
  background: var(--bg-section-dark);
}

.reasons__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.reason-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 24px;
  background: var(--bg-section);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-align: center;
}

.reason-card__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.reason-card__title {
  font-family: var(--font-display);
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 400;
  color: var(--color-gold);
}

.reason-card__text {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--color-muted);
  max-width: 320px;
}

@media (min-width: 768px) {
  .reasons__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .reason-card {
    max-width: 350px;
    margin-inline: auto;
    width: 100%;
  }
}

/* Free play */
.free-play {
  padding-block: var(--space-section);
  background: var(--bg-section);
}

.free-play__desc {
  max-width: 700px;
  margin-inline: auto;
  margin-bottom: 32px;
  font-size: clamp(14px, 2.5vw, 16px);
  line-height: 1.6;
  text-align: center;
  color: var(--color-muted);
}

.free-play__preview {
  border-radius: var(--radius-lg);
  overflow: hidden;
  line-height: 0;
}

.free-play__preview img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Footer */
.site-footer {
  background: var(--bg-section-dark);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-block: clamp(40px, 6vw, 60px);
}

.site-footer__logo {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-nav a {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-accent);
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: var(--color-gold);
}

/* Footer Frame 1 – 18+ disclaimer (synced from Pencil RVIms) */
.footer-frame-1 {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 1280px;
  min-height: 20px;
}

.footer-frame-1__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.footer-frame-1__text {
  flex: 0 1 auto;
  max-width: 559px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  color: #ffffff;
}

@media (max-width: 640px) {
  .footer-frame-1 {
    flex-wrap: wrap;
    padding-inline: 4px;
  }

  .footer-frame-1__text {
    max-width: 100%;
  }
}

.copyright-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  background: var(--bg-section);
}

.copyright-bar p {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-muted);
  text-align: center;
  padding: 12px 16px;
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
  .site-header {
    padding-left: max(var(--space-inline), env(safe-area-inset-left));
    padding-right: max(var(--space-inline), env(safe-area-inset-right));
  }

  .copyright-bar {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}

/* Back to top – all pages */
.back-to-top {
  position: fixed;
  right: clamp(16px, 4vw, 28px);
  bottom: clamp(20px, 4vw, 28px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--color-gold);
  color: var(--color-gold-text);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.92);
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease,
    transform 0.25s ease,
    filter 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  filter: brightness(1.08);
}

.back-to-top:active {
  transform: translateY(0) scale(0.96);
}

.back-to-top svg {
  display: block;
  width: 22px;
  height: 22px;
}

/* Favorites modal */
.favorites-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.favorites-modal[hidden] {
  display: none;
}

.favorites-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.favorites-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 400px);
  overflow: hidden;
  padding: 24px 18px 20px;
  background: #ffffff;
  border: 1px solid #e8e0d8;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}

.favorites-modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #8a7a6e;
  cursor: pointer;
  outline: none;
  box-shadow: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.favorites-modal__close:hover {
  color: #2a1a14;
  background: rgba(0, 0, 0, 0.06);
}

.favorites-modal__close:focus,
.favorites-modal__close:focus-visible,
.favorites-modal__close:active {
  outline: none;
  box-shadow: none;
  border: none;
}

.favorites-modal__panel[hidden] {
  display: none;
}

.favorites-modal__check {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
  color: #d4a017;
}

.favorites-modal__check svg {
  width: 56px;
  height: 56px;
}

.favorites-modal__title {
  margin: 0 0 8px;
  padding-inline: 20px;
  font-family: var(--font-display);
  font-size: clamp(20px, 4vw, 24px);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #241311;
  line-height: 1.2;
}

.favorites-modal__text {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.45;
  color: #5c4638;
}

.favorites-guide {
  margin: 12px 0 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.favorites-guide__item {
  padding: 10px 12px 12px;
  background: #f7f3ef;
  border: 1px solid #e8e0d8;
  border-radius: var(--radius-md);
}

.favorites-guide__label {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #b8860b;
}

.favorites-guide__desc {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.4;
  color: #6b5748;
}

.favorites-guide__hl {
  font-weight: 700;
  color: #b8860b;
}

.favorites-guide__img {
  display: block;
  width: 78%;
  max-width: 260px;
  height: auto;
  margin-inline: auto;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #ece6e0;
}

.favorites-modal__confirm-btn {
  width: 100%;
  padding: 11px 20px;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
}

.favorites-modal__game-btn {
  display: inline-flex;
  width: 100%;
  margin-top: 14px;
  padding: 12px 20px;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
}

body.favorites-modal-open {
  overflow: hidden;
}

/* iPhone 4 / short viewports: proportionally scale modal to fit readable height */
@media (max-width: 360px) and (max-height: 520px) {
  .favorites-modal {
    padding: 6px 8px;
  }

  .favorites-modal__dialog {
    width: min(100%, 304px);
    padding: 12px 10px 10px;
    border-radius: 12px;
    zoom: 0.92;
  }

  .favorites-modal__close {
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
  }

  .favorites-modal__check {
    margin-bottom: 8px;
  }

  .favorites-modal__check svg {
    width: 40px;
    height: 40px;
  }

  .favorites-modal__title {
    margin: 0 0 4px;
    padding-inline: 18px;
    font-size: 16px;
  }

  .favorites-modal__text {
    margin: 0 0 4px;
    font-size: 11px;
    line-height: 1.35;
  }

  .favorites-guide {
    margin: 8px 0 10px;
    gap: 6px;
  }

  .favorites-guide__item {
    padding: 6px 8px 8px;
    border-radius: 8px;
  }

  .favorites-guide__label {
    margin: 0 0 2px;
    font-size: 11px;
  }

  .favorites-guide__desc {
    margin: 0 0 5px;
    font-size: 10px;
    line-height: 1.35;
  }

  .favorites-guide__img {
    width: 68%;
    max-width: 180px;
    border-radius: 6px;
  }

  .favorites-modal__confirm-btn,
  .favorites-modal__game-btn {
    margin-top: 0;
    padding: 8px 12px;
    font-size: 12px;
  }

  .favorites-modal__game-btn {
    margin-top: 10px;
  }
}

/* Extra-tight for classic 320×480 (iPhone 4) */
@media (max-width: 320px) and (max-height: 480px) {
  .favorites-modal {
    padding: 4px 6px;
  }

  .favorites-modal__dialog {
    width: min(100%, 308px);
    padding: 10px 8px 8px;
    zoom: 0.84;
  }

  .favorites-modal__title {
    font-size: 15px;
  }

  .favorites-guide {
    margin: 6px 0 8px;
    gap: 5px;
  }

  .favorites-guide__img {
    width: 62%;
    max-width: 150px;
  }
}

/* Landscape / very short height */
@media (max-height: 360px) {
  .favorites-modal {
    padding: 4px;
    align-items: flex-start;
    overflow-y: auto;
  }

  .favorites-modal__dialog {
    margin-block: auto;
    zoom: 0.78;
  }
}

@media (max-width: 899px) {
  .back-to-top {
    width: 44px;
    height: 44px;
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
  }

  .back-to-top svg {
    width: 20px;
    height: 20px;
  }
}

@supports (padding: max(0px)) {
  .back-to-top {
    right: max(clamp(16px, 4vw, 28px), env(safe-area-inset-right));
    bottom: max(clamp(20px, 4vw, 28px), env(safe-area-inset-bottom));
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .game-card,
  .back-to-top {
    transition: none;
  }
}
