/*!
 * Tabletop game - tabletopgame.homes
 * Core stylesheet (mobile-first, max-width 430px reference)
 * All custom classes use the ui87- prefix.
 * Palette: primary #0000CD (royal blue), dark #3A3A3A, with gold #FFD24A accent.
 * Root font-size: 62.5% so 1rem == 10px for predictable rem sizing.
 * Comments in English per project convention.
 */

:root {
  --ui87-blue: #0000CD;
  --ui87-blue-dark: #000099;
  --ui87-blue-bright: #3a3aff;
  --ui87-dark: #3A3A3A;
  --ui87-darker: #1d1d22;
  --ui87-darkest: #121217;
  --ui87-gold: #FFD24A;
  --ui87-gold-soft: #ffe79a;
  --ui87-bg: #0b0b14;
  --ui87-surface: #181826;
  --ui87-surface-2: #20203a;
  --ui87-text: #f4f5fb;
  --ui87-text-dim: #b6b9cc;
  --ui87-border: #2c2c44;
  --ui87-green: #2fd27a;
  --ui87-red: #ff5d6c;
  --ui87-radius: 1.2rem;
  --ui87-shadow: 0 1.2rem 3rem rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html { font-size: 62.5%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", system-ui, -apple-system, "Arial", sans-serif;
  background: radial-gradient(circle at 20% 0, #15173a 0%, var(--ui87-bg) 55%) fixed;
  color: var(--ui87-text);
  line-height: 1.5;
  font-size: 1.6rem;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--ui87-gold-soft); text-decoration: none; }
a:hover { color: var(--ui87-gold); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 1rem; line-height: 1.25; color: #fff; }
h1 { font-size: 2.6rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.9rem; }
p { margin: 0 0 1.2rem; color: var(--ui87-text-dim); }

.ui87-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.4rem; }
.ui87-no-scroll { overflow: hidden; }

/* ===== Header ===== */
.ui87-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(8,8,20,.96), rgba(8,8,20,.88));
  border-bottom: 1px solid var(--ui87-border);
  backdrop-filter: blur(10px);
}
.ui87-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 6rem;
}
.ui87-logo {
  display: flex;
  align-items: center;
  gap: .8rem;
  color: #fff;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: .3px;
}
.ui87-logo-mark {
  width: 3.6rem; height: 3.6rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--ui87-blue), var(--ui87-blue-bright));
  display: flex; align-items: center; justify-content: center;
  color: var(--ui87-gold);
  box-shadow: 0 .4rem 1.2rem rgba(0,0,205,.45);
}
.ui87-logo-mark i { font-size: 2rem; }
.ui87-logo-text span { color: var(--ui87-gold); }

.ui87-header-actions { display: flex; align-items: center; gap: .8rem; }
.ui87-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  border: none;
  border-radius: 999px;
  padding: 1rem 1.8rem;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  text-decoration: none;
  min-height: 4.4rem;
}
.ui87-btn:hover { transform: translateY(-1px); text-decoration: none; }
.ui87-btn-primary {
  background: linear-gradient(135deg, var(--ui87-gold), #ff9f1c);
  color: #1a1a1a;
  box-shadow: 0 .6rem 1.6rem rgba(255,210,74,.35);
}
.ui87-btn-secondary {
  background: linear-gradient(135deg, var(--ui87-blue), var(--ui87-blue-bright));
  color: #fff;
  box-shadow: 0 .6rem 1.6rem rgba(0,0,205,.4);
}
.ui87-btn-ghost {
  background: transparent;
  border: 1px solid var(--ui87-border);
  color: var(--ui87-text);
}
.ui87-menu-toggle {
  background: transparent;
  border: 1px solid var(--ui87-border);
  color: #fff;
  width: 4.4rem; height: 4.4rem;
  border-radius: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}

/* ===== Mobile slide-in menu ===== */
.ui87-mobile-menu {
  position: fixed;
  top: 0; right: -86%;
  width: 86%; max-width: 360px;
  height: 100%;
  background: var(--ui87-surface);
  z-index: 9999;
  padding: 2.4rem 1.8rem;
  overflow-y: auto;
  transition: right .28s ease;
  border-left: 1px solid var(--ui87-border);
}
.ui87-mobile-menu.ui87-menu-open { right: 0; }
.ui87-menu-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease;
}
.ui87-menu-mask.ui87-mask-visible { opacity: 1; visibility: visible; }
.ui87-menu-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2.4rem;
  cursor: pointer;
  float: right;
}
.ui87-menu-title { font-size: 2rem; color: #fff; margin: 1rem 0 1.4rem; }
.ui87-menu-list { list-style: none; padding: 0; margin: 0; }
.ui87-menu-list li { border-bottom: 1px solid var(--ui87-border); }
.ui87-menu-list a {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.4rem .4rem;
  color: var(--ui87-text);
  font-size: 1.5rem;
}
.ui87-menu-list a i { color: var(--ui87-gold); width: 2rem; text-align: center; }

/* ===== Hero carousel ===== */
.ui87-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--ui87-radius);
  margin: 1.6rem 0;
  box-shadow: var(--ui87-shadow);
}
.ui87-hero-slide {
  display: none;
  position: relative;
  min-height: 28rem;
  background-size: cover;
  background-position: center;
}
.ui87-hero-slide.ui87-slide-active { display: block; }
.ui87-hero-slide::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(8,8,20,.92) 0%, rgba(8,8,20,.55) 50%, rgba(8,8,20,.2) 100%);
}
.ui87-hero-content {
  position: relative;
  z-index: 2;
  padding: 2.6rem 2rem;
  max-width: 38rem;
}
.ui87-hero-eyebrow {
  display: inline-block;
  background: rgba(0,0,205,.7);
  color: var(--ui87-gold);
  padding: .5rem 1.2rem;
  border-radius: 999px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .5px;
  margin-bottom: 1rem;
}
.ui87-hero-title { font-size: 3rem; color: #fff; margin-bottom: .8rem; }
.ui87-hero-title span { color: var(--ui87-gold); }
.ui87-hero-text { font-size: 1.5rem; color: var(--ui87-text); margin-bottom: 1.6rem; }
.ui87-hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.ui87-hero-dots {
  position: absolute;
  bottom: 1.4rem; left: 0; right: 0;
  display: flex; justify-content: center; gap: .8rem;
  z-index: 3;
}
.ui87-hero-dot {
  width: 1rem; height: 1rem; border-radius: 50%;
  background: rgba(255,255,255,.4); cursor: pointer; border: none;
}
.ui87-hero-dot.ui87-dot-active { background: var(--ui87-gold); width: 2.4rem; border-radius: 999px; }
.ui87-hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 4rem; height: 4rem; border-radius: 50%;
  background: rgba(0,0,0,.45); color: #fff; border: none;
  cursor: pointer; z-index: 3; font-size: 1.8rem;
}
.ui87-hero-arrow.ui87-prev { left: 1rem; }
.ui87-hero-arrow.ui87-next { right: 1rem; }

/* ===== Trust strip ===== */
.ui87-trust {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.6rem 0 2rem;
}
.ui87-trust-item {
  background: var(--ui87-surface);
  border: 1px solid var(--ui87-border);
  border-radius: 1rem;
  padding: 1.4rem;
  text-align: center;
}
.ui87-trust-item i { color: var(--ui87-gold); font-size: 2.2rem; margin-bottom: .4rem; }
.ui87-trust-item strong { display: block; color: #fff; font-size: 1.5rem; }
.ui87-trust-item span { font-size: 1.2rem; color: var(--ui87-text-dim); }

/* ===== Filter chips ===== */
.ui87-filters {
  display: flex; gap: .8rem; overflow-x: auto;
  padding: 1rem 0 1.4rem;
  -webkit-overflow-scrolling: touch;
}
.ui87-filter-chip {
  background: var(--ui87-surface);
  border: 1px solid var(--ui87-border);
  color: var(--ui87-text-dim);
  padding: .8rem 1.4rem;
  border-radius: 999px;
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
}
.ui87-filter-chip:hover { color: #fff; }
.ui87-filter-chip.ui87-chip-active {
  background: linear-gradient(135deg, var(--ui87-blue), var(--ui87-blue-bright));
  color: #fff; border-color: transparent;
}

/* ===== Section heading ===== */
.ui87-section { padding: 2rem 0; }
.ui87-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.4rem;
}
.ui87-section-head h2 {
  font-size: 2rem; color: #fff;
  display: flex; align-items: center; gap: .8rem;
}
.ui87-section-head h2 i { color: var(--ui87-gold); }
.ui87-section-head a { font-size: 1.3rem; color: var(--ui87-gold); }
.ui87-section-hidden { display: none; }

/* ===== Game grid ===== */
.ui87-game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.ui87-game-card {
  background: var(--ui87-surface);
  border: 1px solid var(--ui87-border);
  border-radius: 1rem;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  position: relative;
}
.ui87-game-card:hover {
  transform: translateY(-3px);
  border-color: var(--ui87-blue-bright);
  box-shadow: 0 .8rem 2rem rgba(0,0,205,.35);
}
.ui87-game-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #0c0c18;
  overflow: hidden;
}
.ui87-game-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ui87-game-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,205,.85));
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .18s ease;
  padding: 1rem;
}
.ui87-game-card:hover .ui87-game-overlay { opacity: 1; }
.ui87-game-play {
  background: var(--ui87-gold);
  color: #1a1a1a;
  border: none;
  border-radius: 999px;
  padding: .7rem 1.4rem;
  font-weight: 800;
  font-size: 1.2rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.ui87-game-tag {
  position: absolute;
  top: .6rem; left: .6rem;
  background: rgba(255,93,108,.92);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: .25rem .6rem;
  border-radius: 999px;
  text-transform: uppercase;
}
.ui87-game-name {
  padding: .7rem .6rem;
  text-align: center;
  font-size: 1.2rem;
  color: var(--ui87-text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Featured banner ===== */
.ui87-feature {
  background: linear-gradient(135deg, var(--ui87-blue-dark), var(--ui87-blue-bright));
  border-radius: var(--ui87-radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin: 2rem 0;
  border: 1px solid rgba(255,210,74,.3);
}
.ui87-feature-title { color: var(--ui87-gold); font-size: 2.2rem; }
.ui87-feature-text { color: #fff; }
.ui87-feature-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ===== Promo CTA strip ===== */
.ui87-cta-strip {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 1px solid var(--ui87-gold);
  border-radius: var(--ui87-radius);
  padding: 2rem 1.6rem;
  text-align: center;
  margin: 2rem 0;
}
.ui87-cta-strip h3 { color: var(--ui87-gold); font-size: 2rem; }
.ui87-cta-strip p { color: var(--ui87-text); }
.ui87-cta-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }

/* ===== Editorial / SEO content ===== */
.ui87-editorial {
  background: var(--ui87-surface);
  border: 1px solid var(--ui87-border);
  border-radius: var(--ui87-radius);
  padding: 2rem 1.8rem;
  margin: 2rem 0;
}
.ui87-editorial h2 { color: #fff; font-size: 2.2rem; }
.ui87-editorial h3 { color: var(--ui87-gold); font-size: 1.8rem; margin-top: 1.6rem; }
.ui87-editorial p { color: var(--ui87-text-dim); font-size: 1.5rem; }
.ui87-editorial ul { color: var(--ui87-text-dim); padding-left: 1.6rem; }
.ui87-editorial li { margin-bottom: .6rem; }
.ui87-editorial a { color: var(--ui87-gold); }

/* ===== FAQ ===== */
.ui87-faq-list { margin: 2rem 0; }
.ui87-faq-item {
  background: var(--ui87-surface);
  border: 1px solid var(--ui87-border);
  border-radius: 1rem;
  margin-bottom: 1rem;
  overflow: hidden;
}
.ui87-faq-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.4rem 1.6rem;
  cursor: pointer;
  font-weight: 700;
  color: #fff;
  font-size: 1.5rem;
}
.ui87-faq-head i { color: var(--ui87-gold); transition: transform .2s ease; }
.ui87-faq-open .ui87-faq-head i { transform: rotate(45deg); }
.ui87-faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  padding: 0 1.6rem;
  color: var(--ui87-text-dim);
}
.ui87-faq-open .ui87-faq-body { max-height: 600px; padding: 0 1.6rem 1.4rem; }

/* ===== Footer ===== */
.ui87-footer {
  background: var(--ui87-darkest);
  border-top: 1px solid var(--ui87-border);
  padding: 3rem 0 8rem;
  margin-top: 2rem;
}
.ui87-footer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}
.ui87-footer-col h4 { color: var(--ui87-gold); font-size: 1.5rem; margin-bottom: 1rem; }
.ui87-footer-col ul { list-style: none; padding: 0; margin: 0; }
.ui87-footer-col li { margin-bottom: .6rem; }
.ui87-footer-col a { color: var(--ui87-text-dim); font-size: 1.3rem; }
.ui87-footer-col p { color: var(--ui87-text-dim); font-size: 1.3rem; }
.ui87-footer-bottom {
  text-align: center;
  border-top: 1px solid var(--ui87-border);
  padding-top: 1.6rem;
  margin-top: 2rem;
  font-size: 1.2rem;
  color: var(--ui87-text-dim);
}

/* ===== Bottom nav (mobile only) ===== */
.ui87-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 6.4rem;
  background: linear-gradient(180deg, rgba(20,20,38,.98), rgba(10,10,20,.99));
  border-top: 1px solid var(--ui87-border);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.ui87-bottom-nav-btn {
  flex: 1;
  min-width: 6rem;
  min-height: 6rem;
  background: transparent;
  border: none;
  color: var(--ui87-text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color .15s ease;
}
.ui87-bottom-nav-btn i { font-size: 2.2rem; }
.ui87-bottom-nav-btn .material-icons-outlined { font-size: 2.4rem; }
.ui87-bottom-nav-btn:hover { color: #fff; }
.ui87-bottom-nav-btn.ui87-nav-current { color: var(--ui87-gold); }
.ui87-bottom-nav-btn.ui87-nav-current::before {
  content: "";
  position: absolute; top: 0;
  width: 2.6rem; height: .3rem;
  border-radius: 999px;
  background: var(--ui87-gold);
}
.ui87-nav-promo {
  background: linear-gradient(135deg, var(--ui87-gold), #ff9f1c);
  color: #1a1a1a;
  border-radius: 50%;
  width: 4.8rem; height: 4.8rem;
  margin-top: -1.6rem;
  box-shadow: 0 .4rem 1.2rem rgba(255,210,74,.4);
  border: 3px solid var(--ui87-darkest);
}
.ui87-nav-promo i { font-size: 2.2rem; }

/* ===== Back-to-top ===== */
.ui87-to-top {
  position: fixed;
  bottom: 7.6rem; right: 1.4rem;
  width: 4.6rem; height: 4.6rem;
  border-radius: 50%;
  background: var(--ui87-blue-bright);
  color: #fff; border: none;
  font-size: 2rem;
  cursor: pointer;
  z-index: 999;
  opacity: 0; visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
  box-shadow: var(--ui87-shadow);
}
.ui87-to-top.ui87-to-top-visible { opacity: 1; visibility: visible; }

/* ===== Desktop nav (hidden on mobile) ===== */
.ui87-desktop-nav { display: none; }

/* ===== Responsive: tablet+ ===== */
@media (min-width: 768px) {
  .ui87-bottom-nav { display: none; }
  .ui87-menu-toggle { display: none; }
  .ui87-desktop-nav {
    display: flex;
    align-items: center;
    gap: 1.6rem;
  }
  .ui87-desktop-nav a {
    color: var(--ui87-text-dim);
    font-size: 1.4rem;
    font-weight: 600;
  }
  .ui87-desktop-nav a:hover { color: var(--ui87-gold); }
  .ui87-game-grid { grid-template-columns: repeat(5, 1fr); }
  .ui87-trust { grid-template-columns: repeat(4, 1fr); }
  .ui87-footer-grid { grid-template-columns: repeat(4, 1fr); }
  .ui87-hero-slide { min-height: 36rem; }
  .ui87-hero-title { font-size: 3.6rem; }
  .ui87-footer { padding-bottom: 3rem; }
  body main.ui87-main { padding-bottom: 0 !important; }
}

@media (min-width: 992px) {
  .ui87-game-grid { grid-template-columns: repeat(6, 1fr); }
  .ui87-hero-content { max-width: 52rem; padding: 4rem; }
}

/* Mobile content clearance so bottom nav never covers content */
@media (max-width: 767px) {
  main.ui87-main { padding-bottom: 8rem; }
}
