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

:root {
  /* ---- Brand palette: Auspicious Fortune — warm ivory canvas, oxblood-maroon +
     rich gold accents, coin/lucky-charm motif (matches the maneki-neko / golden
     dragon / Ganesha artwork in the logo) ---- */
  --bg:      #FBF3E2;
  --surface: #FFFFFF;
  --border:  #EBDBB8;
  --border-soft: #F3E9CE;

  --red:      #8C1424;
  --red-deep: #6B0E1A;
  --gold:      #C9971F;
  --gold-deep: #9C7215;
  --gold-soft: #FBEEC7;

  --grad-cta: linear-gradient(120deg, #C9971F 0%, #8C1424 60%, #6B0E1A 100%);

  --ink:   #241407;
  --muted: #7A6650;
  --dim:   #B4A182;

  --font-display: 'Prompt', sans-serif;
  --container-sm: 400px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Prompt', sans-serif;
  background:
    radial-gradient(circle, rgba(201,151,31,0.16) 1.5px, transparent 1.5px),
    var(--bg);
  background-size: 22px 22px, auto;
  color: var(--ink);
  min-height: 100svh;
  overflow-x: hidden;
  position: relative;
  padding-bottom: 76px;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { text-decoration: none; color: inherit; }

/* ===== TOP HEADER (logo left-aligned, not centered) ===== */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.header-logo-text .accent { color: var(--red); }
.header-logo-text .vip {
  display: inline-block;
  margin-left: 0.2rem;
  padding: 0.05rem 0.4rem;
  border-radius: 5px;
  background: var(--grad-cta);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  vertical-align: middle;
}
.lang-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2px;
}
.lang-btn svg { width: 100%; height: 100%; border-radius: 50%; }

/* ===== GAME CATEGORY STRIP ===== */
.game-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.8rem 1.1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.game-strip::-webkit-scrollbar { display: none; }
.game-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--gold-soft);
  border: 1px solid rgba(201,151,31,0.35);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
}
.game-chip .suit { font-size: 0.9rem; }
.game-chip .suit.gold { filter: saturate(1.3); }

/* ===== HERO BANNER ===== */
.hero-banner-wrap {
  max-width: var(--container-sm);
  margin: 0 auto;
  padding: 1.1rem 1.25rem 0;
}
.hero-banner {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(108,52,10,0.1);
}

/* ===== MAIN ===== */
.main-stage {
  max-width: var(--container-sm);
  margin: 0 auto;
  padding: 2.25rem 1.25rem 1.5rem;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.9rem 1.5rem 1.75rem;
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--red) 50%, var(--gold) 100%);
}
.card-suit-mark {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 1.6rem;
  opacity: 0.28;
  line-height: 1;
}
.login-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 1.6rem;
  text-align: center;
}
.login-title .brand-accent {
  display: block;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.3;
  margin-bottom: 0.15rem;
  background: var(--grad-cta);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-card form { width: 100%; }
.field {
  width: 100%;
  margin-bottom: 1rem;
}
.field label {
  display: block;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.field-input {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
}
.field-input:focus-within { border-color: var(--red); }
.field-input svg { flex-shrink: 0; color: var(--dim); width: 16px; height: 16px; }
.field-input input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-family: 'Prompt', sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
}
.field-input input::placeholder { color: var(--dim); }

.btn-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--grad-cta);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 8px;
  margin-top: 0.4rem;
  box-shadow: 0 8px 20px rgba(140,20,36,0.32);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.btn-login:hover { box-shadow: 0 10px 24px rgba(140,20,36,0.42); transform: translateY(-1px); }
.btn-login svg { width: 17px; height: 17px; }

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-soft);
}
.register-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--red);
}
.btn-line-flat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
}
.btn-line-flat .ico-line {
  display: inline-flex; align-items: center; justify-content: center;
  background: #06C755; color: #fff; font-size: 0.55rem; font-weight: 800;
  border-radius: 3px; padding: 1px 5px; line-height: 1.3;
}

/* ===== ABOUT TEXT ===== */
.about-text {
  max-width: var(--container-sm);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 1rem;
  text-align: left;
}
.about-text h2 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.about-text p {
  font-size: 0.76rem;
  line-height: 1.8;
  color: var(--muted);
}

/* ===== BOTTOM NAV — flat, dot active state ===== */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
}
.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-size: 0.64rem;
  font-weight: 500;
  color: var(--dim);
  padding: 0.35rem 0.2rem;
  background: none;
  border: none;
  position: relative;
}
.bn-item svg { width: 19px; height: 19px; color: var(--dim); }
.bn-item.active,
.bn-item:hover { color: var(--ink); }
.bn-item.active svg { color: var(--red); }
.bn-item.active::after {
  content: '';
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-soft);
}

/* ===== HOW-TO MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(36, 20, 7, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-sheet {
  width: 100%;
  max-width: var(--container-sm);
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 14px 14px 0 0;
  padding: 1.5rem 1.5rem calc(1.75rem + env(safe-area-inset-bottom, 0px));
  transform: translateY(16px);
  transition: transform 0.2s ease;
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}
.modal-head h2 {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
}
.modal-close {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--ink); font-size: 0.9rem; display: flex; align-items: center; justify-content: center;
}
.modal-steps { list-style: none; display: flex; flex-direction: column; gap: 0.9rem; }
.modal-steps li { display: flex; gap: 0.75rem; align-items: flex-start; }
.step-num {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--red); color: #fff; font-weight: 600; font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
}
.modal-steps p { font-size: 0.83rem; color: var(--muted); line-height: 1.6; }
.modal-steps strong { color: var(--ink); font-weight: 600; }
