:root {
  --blue: #4d6ef5;
  --blue-dark: #3a57d9;
  --blue-soft: #e8eeff;
  --blue-glow: #c9d4ff;
  --bg: #f0f4ff;
  --white: #ffffff;
  --ink: #1a1f36;
  --muted: #6b7289;
  --border: #d8dff5;
  --gold: #f5c542;
  --success: #16a34a;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(77, 110, 245, 0.12);
  --max: 720px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Nunito", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  width: min(100% - 28px, var(--max));
  margin: 0 auto;
}

/* ========== TOP AUTH BAR ========== */
.auth-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 14px 8px;
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(26, 31, 54, 0.06);
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-decoration: none !important;
  transition: transform 0.15s ease, background 0.15s ease;
}

.auth-btn:active { transform: scale(0.98); }

.auth-btn--login,
.auth-btn--register {
  background: var(--blue);
  color: #fff !important;
}

.auth-btn:hover { background: var(--blue-dark); }

/* ========== HEADER ========== */
.site-header {
  background: var(--white);
  padding: 8px 14px 12px;
  border-bottom: 1px solid var(--border);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: var(--max);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  color: inherit;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(77, 110, 245, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-family: "Fredoka", sans-serif;
  font-size: 1.15rem;
  color: var(--ink);
}

.brand-text small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

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

.gift-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(145deg, #ff6b6b, #f43f5e);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(244, 63, 94, 0.35);
  position: relative;
  animation: giftPulse 2.2s ease-in-out infinite;
}

.gift-circle svg { width: 22px; height: 22px; }

.gift-circle::after {
  content: "Gift";
  position: absolute;
  bottom: -14px;
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: 0.02em;
}

@keyframes giftPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.menu-btn {
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  display: grid;
  place-items: center;
}

/* ========== HERO ========== */
.hero {
  padding: 18px 0 8px;
}

.hero-title {
  font-family: "Fredoka", sans-serif;
  font-size: clamp(1.55rem, 5.5vw, 2rem);
  text-align: center;
  margin-bottom: 12px;
  color: var(--ink);
}

.gift-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 14px;
  padding: 10px 14px;
  background: var(--white);
  border: 1.5px dashed var(--blue);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
  box-shadow: var(--shadow);
}

.gift-orb {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 3px solid var(--blue);
  background: radial-gradient(circle at 30% 30%, #fff, var(--blue-soft));
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.gift-orb:hover { transform: scale(1.05); }

.gift-orb svg { width: 26px; height: 26px; color: var(--blue); }

.gift-meta {
  text-align: left;
  min-width: 0;
}

.gift-meta .label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.gift-meta .code {
  display: block;
  font-family: "Fredoka", sans-serif;
  font-size: 1.2rem;
  color: var(--blue);
  font-weight: 700;
  word-break: break-all;
}

.gift-meta .hint {
  font-size: 0.72rem;
  color: var(--success);
  font-weight: 700;
}

.promo-banner {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: #2c49ff;
  box-shadow: 0 10px 24px rgba(61, 94, 240, 0.25);
  max-width: 100%;
}

.promo-banner picture,
.promo-banner img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.promo-banner img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 720px) {
  .promo-banner {
    border-radius: 12px;
  }
  .promo-banner img {
    aspect-ratio: 16 / 9;
    max-height: 168px;
    object-fit: cover;
    object-position: center 35%;
  }
}

.cta-stack {
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
}

.cta-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--blue);
  color: #fff !important;
  font-family: "Fredoka", sans-serif;
  font-size: 1.15rem;
  text-decoration: none !important;
  box-shadow: 0 8px 18px rgba(77, 110, 245, 0.28);
  transition: background 0.15s ease, transform 0.15s ease;
}

.cta-main:hover { background: var(--blue-dark); }
.cta-main:active { transform: scale(0.985); }

.info-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1.5px solid #222;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 20px;
  font-size: 0.92rem;
}

.info-table th,
.info-table td {
  border: 1px solid #222;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.info-table th {
  width: 42%;
  background: #fafbff;
  font-weight: 800;
  color: var(--ink);
}

.info-table a { font-weight: 800; }

/* ========== CONTENT ========== */
.content {
  padding: 8px 0 100px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(77, 110, 245, 0.08);
}

.card h2 {
  font-family: "Fredoka", sans-serif;
  font-size: 1.35rem;
  margin-bottom: 10px;
  color: var(--ink);
  position: relative;
  padding-left: 12px;
}

.card h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: 4px;
  border-radius: 4px;
  background: var(--blue);
}

.card h3 {
  font-size: 1.05rem;
  margin: 16px 0 8px;
  color: var(--blue-dark);
}

.card p { margin-bottom: 10px; color: #2d3450; }

.card ul, .card ol {
  padding-left: 1.2rem;
  margin-bottom: 12px;
}

.card li { margin-bottom: 6px; }

.toc {
  background: var(--blue-soft);
  border: 1px solid var(--blue-glow);
}

.toc summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--blue-dark);
  list-style: none;
}

.toc summary::-webkit-details-marker { display: none; }

.toc nav {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}

.toc a {
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.88rem;
  overflow: hidden;
  border-radius: 10px;
}

.data-table th,
.data-table td {
  border: 1px solid var(--border);
  padding: 9px 10px;
  text-align: left;
}

.data-table th {
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}

.data-table tr:nth-child(even) td { background: #f7f9ff; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.game-card {
  border-radius: 10px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  text-align: center;
  text-decoration: none !important;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(77, 110, 245, 0.08);
  transition: transform 0.15s ease;
  min-width: 0;
}

.game-card:active { transform: scale(0.98); }

.game-art {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  object-position: center;
  display: block;
  background: #eef2ff;
}

.game-rtp {
  background: var(--blue);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 5px 3px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 380px) {
  .game-grid { gap: 6px; }
  .game-rtp { font-size: 0.52rem; padding: 4px 2px; }
}

@media (min-width: 480px) {
  .game-grid { gap: 10px; }
  .game-rtp { font-size: 0.7rem; padding: 6px 4px; }
}

.announce {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border-radius: 999px;
  padding: 8px 10px 8px 14px;
  margin: 0 0 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.announce-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.announce-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.announce-text span {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 18s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.detail-btn {
  flex-shrink: 0;
  background: var(--blue);
  color: #fff !important;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 800;
  text-decoration: none !important;
}

.faq details {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #fafbff;
}

.faq summary {
  cursor: pointer;
  font-weight: 800;
}

.faq details[open] summary { color: var(--blue); margin-bottom: 6px; }

.disclaimer {
  background: #fff8e8;
  border: 1px solid #f0d48a;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 8px 0 24px;
}

/* ========== MODAL ========== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 49, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal.open { display: flex; }

.modal-card {
  width: min(100%, 360px);
  background: var(--white);
  border-radius: 18px;
  padding: 22px 18px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  animation: popIn 0.2s ease;
}

@keyframes popIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-card h3 {
  font-family: "Fredoka", sans-serif;
  margin-bottom: 6px;
}

.modal-card p {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.modal-code {
  font-family: "Fredoka", sans-serif;
  font-size: 1.5rem;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1.5px dashed var(--blue);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  word-break: break-all;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary { background: var(--blue); color: #fff; }
.btn-ghost { background: var(--blue-soft); color: var(--blue-dark); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%) translateY(20px);
  background: #111827;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 120;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17,24,49,0.45);
  z-index: 80;
}

.mobile-nav.open { display: block; }

.mobile-nav-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(80%, 300px);
  height: 100%;
  background: var(--white);
  padding: 24px 18px;
  box-shadow: -8px 0 24px rgba(0,0,0,0.12);
}

.mobile-nav-panel a {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
}

@media (min-width: 768px) {
  .auth-bar,
  .site-header { padding-left: calc((100% - var(--max)) / 2 + 14px); padding-right: calc((100% - var(--max)) / 2 + 14px); }
}
