/* ============================================================
   tableplus-app-design-4f8a.css
   Tableplus App - shared visual system.
   All custom classes and CSS variables use the w4f8a- prefix.
   Mobile canvas: 320-430px. Wider screens keep the mobile canvas
   centered; no desktop-width layout is provided.
   ============================================================ */

:root {
  --w4f8a-bg: #0C0C0C;
  --w4f8a-bg-soft: #15110D;
  --w4f8a-surface: #1B1410;
  --w4f8a-card: #221A13;
  --w4f8a-card-2: #2A1F16;
  --w4f8a-line: #3A2D20;
  --w4f8a-text: #FAF0E6;
  --w4f8a-text-soft: #E0E0E0;
  --w4f8a-muted: #B79B7E;
  --w4f8a-accent: #DEB887;
  --w4f8a-accent-2: #CD853F;
  --w4f8a-hot: #BF360C;
  --w4f8a-hot-soft: #E25A22;
  --w4f8a-gold-grad: linear-gradient(135deg, #DEB887 0%, #CD853F 55%, #BF360C 100%);
  --w4f8a-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
  --w4f8a-radius: 14px;
  --w4f8a-radius-sm: 10px;
  --w4f8a-max-canvas: 440px;
  --w4f8a-header-h: 58px;
  --w4f8a-bottom-h: 68px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #000;
  color: var(--w4f8a-text);
  font-family: "Segoe UI", "Helvetica Neue", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(191, 54, 12, 0.18) 0%, transparent 60%),
    radial-gradient(120% 50% at 50% 110%, rgba(205, 133, 63, 0.14) 0%, transparent 60%),
    var(--w4f8a-bg);
}

img { max-width: 100%; display: block; }

a { color: var(--w4f8a-accent); text-decoration: none; }
a:hover, a:focus { color: var(--w4f8a-text); }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* Phone canvas wrapper keeps the layout centered on wide screens. */
.w4f8a-canvas {
  max-width: var(--w4f8a-max-canvas);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--w4f8a-bg);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
}

.w4f8a-lock-scroll { overflow: hidden; }

/* ============= Header ============= */
.w4f8a-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--w4f8a-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  background: linear-gradient(180deg, rgba(15, 12, 9, 0.98) 0%, rgba(15, 12, 9, 0.88) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--w4f8a-line);
}

.w4f8a-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.w4f8a-brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--w4f8a-card);
  border: 1px solid var(--w4f8a-accent);
  box-shadow: 0 2px 8px rgba(191, 54, 12, 0.35);
  flex-shrink: 0;
}

.w4f8a-brand-text { min-width: 0; }

.w4f8a-brand-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1.1;
  color: var(--w4f8a-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.w4f8a-brand-tag {
  font-size: 10px;
  color: var(--w4f8a-accent);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.w4f8a-header-actions { display: flex; align-items: center; gap: 6px; }

.w4f8a-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.w4f8a-btn:active { transform: scale(0.96); }

.w4f8a-btn-register {
  background: var(--w4f8a-gold-grad);
  color: #1A1108;
  box-shadow: 0 3px 10px rgba(191, 54, 12, 0.45);
}

.w4f8a-btn-login {
  background: transparent;
  color: var(--w4f8a-accent);
  border: 1px solid var(--w4f8a-accent);
}

.w4f8a-menu-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--w4f8a-card);
  border: 1px solid var(--w4f8a-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.w4f8a-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--w4f8a-accent);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.w4f8a-menu-btn:hover { border-color: var(--w4f8a-accent-2); }
.w4f8a-menu-btn-active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.w4f8a-menu-btn-active span:nth-child(2) { opacity: 0; }
.w4f8a-menu-btn-active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============= Full-height menu layer ============= */
.w4f8a-menu-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: linear-gradient(160deg, #0C0C0C 0%, #1B1410 60%, #2A1F16 100%);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.w4f8a-menu-open { transform: translateX(0); }

.w4f8a-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--w4f8a-line);
}
.w4f8a-menu-title { font-size: 16px; font-weight: 800; color: var(--w4f8a-text); }
.w4f8a-menu-close {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--w4f8a-card); border: 1px solid var(--w4f8a-line);
  color: var(--w4f8a-accent); font-size: 20px;
}

.w4f8a-menu-body { padding: 14px 16px 32px; }

.w4f8a-menu-section-title {
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--w4f8a-accent);
  margin: 18px 0 8px;
}

.w4f8a-menu-list { list-style: none; padding: 0; margin: 0; }
.w4f8a-menu-list li { margin-bottom: 8px; }

.w4f8a-menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border-radius: var(--w4f8a-radius-sm);
  background: var(--w4f8a-card);
  border: 1px solid var(--w4f8a-line);
  color: var(--w4f8a-text);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.w4f8a-menu-link:active { transform: scale(0.98); }
.w4f8a-menu-link:hover { background: var(--w4f8a-card-2); border-color: var(--w4f8a-accent-2); color: var(--w4f8a-text); }
.w4f8a-menu-link .w4f8a-menu-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--w4f8a-accent); flex-shrink: 0;
}

.w4f8a-menu-cta {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.w4f8a-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.w4f8a-menu-open ~ .w4f8a-menu-backdrop,
.w4f8a-menu-layer.w4f8a-menu-open + .w4f8a-menu-backdrop { opacity: 1; pointer-events: auto; }

/* ============= Hero / Carousel ============= */
.w4f8a-main { padding-bottom: calc(var(--w4f8a-bottom-h) + 24px); }

.w4f8a-hero {
  position: relative;
  margin: 12px 12px 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--w4f8a-line);
  box-shadow: var(--w4f8a-shadow);
}

.w4f8a-hero-track {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.w4f8a-hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
  cursor: pointer;
}
.w4f8a-hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.w4f8a-hero-slide-active { opacity: 1; }

.w4f8a-hero-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 14px 16px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.75) 100%);
  pointer-events: none;
}
.w4f8a-hero-title {
  font-size: 16px;
  font-weight: 800;
  color: #FFF;
  margin: 0 0 4px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}
.w4f8a-hero-sub {
  font-size: 12px;
  color: var(--w4f8a-accent);
  margin: 0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.w4f8a-hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(12, 12, 12, 0.7);
  color: var(--w4f8a-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  z-index: 5;
  border: 1px solid var(--w4f8a-line);
}
.w4f8a-hero-arrow:hover { background: var(--w4f8a-hot); color: #FFF; }
.w4f8a-hero-prev { left: 8px; }
.w4f8a-hero-next { right: 8px; }

.w4f8a-hero-dots {
  position: absolute;
  bottom: 8px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 5;
}
.w4f8a-hero-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(250, 240, 230, 0.45);
  cursor: pointer;
  transition: background 0.2s ease, width 0.2s ease;
}
.w4f8a-hero-dot-active { background: var(--w4f8a-accent); width: 18px; border-radius: 4px; }

/* ============= Sections / headings ============= */
.w4f8a-section {
  margin: 22px 12px 0;
}
.w4f8a-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.w4f8a-section-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--w4f8a-text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.w4f8a-section-title::before {
  content: "";
  display: inline-block;
  width: 4px; height: 18px;
  background: var(--w4f8a-gold-grad);
  border-radius: 3px;
}
.w4f8a-section-more { font-size: 12px; color: var(--w4f8a-accent); font-weight: 600; }

.w4f8a-category-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 14px;
  background: var(--w4f8a-card);
  border: 1px solid var(--w4f8a-line);
  font-size: 11px;
  font-weight: 700;
  color: var(--w4f8a-accent);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* ============= Filter bar ============= */
.w4f8a-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 12px 0;
  background: var(--w4f8a-card);
  border: 1px solid var(--w4f8a-line);
  border-radius: 22px;
  padding: 6px 8px 6px 14px;
}
.w4f8a-filter input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--w4f8a-text);
  font-size: 14px;
  min-width: 0;
}
.w4f8a-filter input::placeholder { color: var(--w4f8a-muted); }
.w4f8a-filter-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 16px;
  background: var(--w4f8a-gold-grad);
  color: #1A1108;
}

/* ============= Game grids ============= */
.w4f8a-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (min-width: 375px) {
  .w4f8a-grid { grid-template-columns: repeat(5, 1fr); gap: 9px; }
}

.w4f8a-tile {
  display: block;
  background: var(--w4f8a-card);
  border: 1px solid var(--w4f8a-line);
  border-radius: var(--w4f8a-radius-sm);
  padding: 6px;
  text-align: center;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
  overflow: hidden;
}
.w4f8a-tile:hover, .w4f8a-tile:focus {
  transform: translateY(-2px);
  border-color: var(--w4f8a-accent-2);
  box-shadow: 0 6px 16px rgba(191, 54, 12, 0.3);
}
.w4f8a-tile:active { transform: scale(0.96); }

.w4f8a-tile-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
  margin-bottom: 6px;
}
.w4f8a-tile-name {
  font-size: 11px;
  line-height: 1.25;
  color: var(--w4f8a-text-soft);
  font-weight: 600;
  min-height: 28px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.w4f8a-tile-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 8px;
  background: var(--w4f8a-hot);
  color: #FFF;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

/* ============= Info / promo cards ============= */
.w4f8a-info {
  background: var(--w4f8a-card);
  border: 1px solid var(--w4f8a-line);
  border-radius: var(--w4f8a-radius);
  padding: 14px;
  margin-top: 12px;
}
.w4f8a-info h2 {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--w4f8a-text);
}
.w4f8a-info h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 14px 0 6px;
  color: var(--w4f8a-accent);
}
.w4f8a-info p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--w4f8a-text-soft);
  margin: 0 0 8px;
}
.w4f8a-info ul { padding-left: 18px; margin: 6px 0; color: var(--w4f8a-text-soft); }
.w4f8a-info li { font-size: 13px; line-height: 1.6; margin-bottom: 4px; }

.w4f8a-info a { color: var(--w4f8a-accent); font-weight: 600; border-bottom: 1px dashed var(--w4f8a-accent-2); }
.w4f8a-info a:hover { color: var(--w4f8a-text); border-bottom-color: var(--w4f8a-text); }

/* Two-column promo action row */
.w4f8a-promo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.w4f8a-promo-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 8px;
  border-radius: 12px;
  background: var(--w4f8a-card-2);
  border: 1px solid var(--w4f8a-line);
  color: var(--w4f8a-text);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.w4f8a-promo-action:active { transform: scale(0.97); }
.w4f8a-promo-action-primary { background: var(--w4f8a-gold-grad); color: #1A1108; border-color: transparent; }
.w4f8a-promo-action-hot { background: var(--w4f8a-hot); color: #FFF; border-color: transparent; }

/* ============= Extended footer (homepage only) ============= */
.w4f8a-extended-footer {
  margin: 26px 12px 0;
  padding: 18px 14px;
  border-radius: var(--w4f8a-radius);
  background: linear-gradient(160deg, var(--w4f8a-card) 0%, var(--w4f8a-bg-soft) 100%);
  border: 1px solid var(--w4f8a-line);
}
.w4f8a-extended-footer h2 {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--w4f8a-text);
}
.w4f8a-extended-footer p {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--w4f8a-text-soft);
  margin: 0 0 12px;
}

.w4f8a-directory {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 8px 0 16px;
}
.w4f8a-directory a {
  display: block;
  padding: 9px 10px;
  background: var(--w4f8a-card-2);
  border: 1px solid var(--w4f8a-line);
  border-radius: 8px;
  color: var(--w4f8a-text-soft);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  transition: background 0.18s ease, color 0.18s ease;
}
.w4f8a-directory a:hover {
  background: var(--w4f8a-card);
  color: var(--w4f8a-accent);
}

.w4f8a-disclaimer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--w4f8a-line);
  font-size: 11px;
  color: var(--w4f8a-muted);
  line-height: 1.55;
}

/* ============= Copyright bar (shared, all pages) ============= */
.w4f8a-copyright {
  text-align: center;
  padding: 14px 16px calc(var(--w4f8a-bottom-h) + 16px);
  font-size: 11px;
  color: var(--w4f8a-muted);
  line-height: 1.5;
}

/* ============= Mobile bottom navigation rail ============= */
.w4f8a-bottom {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: var(--w4f8a-max-canvas);
  z-index: 60;
  height: var(--w4f8a-bottom-h);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: linear-gradient(180deg, rgba(20, 16, 12, 0.98) 0%, rgba(8, 8, 8, 0.98) 100%);
  border-top: 1px solid var(--w4f8a-line);
  backdrop-filter: blur(8px);
}

.w4f8a-bottom-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px 6px;
  color: var(--w4f8a-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.w4f8a-bottom-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: transparent;
  transition: background 0.2s ease;
}

.w4f8a-bottom-item:hover { color: var(--w4f8a-accent); }
.w4f8a-bottom-item:hover::before { background: var(--w4f8a-accent-2); }

.w4f8a-bottom-item-active {
  color: var(--w4f8a-text);
  background: linear-gradient(180deg, rgba(191, 54, 12, 0.25) 0%, transparent 80%);
}
.w4f8a-bottom-item-active::before { background: var(--w4f8a-gold-grad); }

.w4f8a-bottom-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--w4f8a-card);
  border: 1px solid var(--w4f8a-line);
  border-radius: 8px;
  color: var(--w4f8a-accent);
  font-size: 13px;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.w4f8a-bottom-item:hover .w4f8a-bottom-icon { transform: translateY(-1px) rotate(-3deg); }
.w4f8a-bottom-item-active .w4f8a-bottom-icon {
  background: var(--w4f8a-gold-grad);
  color: #1A1108;
  border-color: transparent;
  transform: scale(1.06);
}
.w4f8a-bottom-label { line-height: 1; }

/* Hide fixed rail on very wide screens (desktop not required) */
@media (min-width: 720px) {
  .w4f8a-bottom { max-width: var(--w4f8a-max-canvas); }
}

/* Keep touch targets friendly */
@media (max-width: 359px) {
  .w4f8a-grid { grid-template-columns: repeat(4, 1fr); }
  .w4f8a-directory { grid-template-columns: 1fr; }
}

/* Focus visibility for keyboard users */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--w4f8a-accent);
  outline-offset: 2px;
  border-radius: 6px;
}
