/* ===================================================================
   איתי · RABET777 — משחקי המזל
   אותה שפה עיצובית של האתר הראשי: ink · felt · champagne gold
   =================================================================== */

:root {
  --ink: #07090B;
  --ink-2: #0C0F12;
  --felt: #0B1B16;
  --felt-2: #10241D;
  --gold: #C9A24B;
  --gold-hi: #E8C97D;
  --gold-deep: #9A7834;
  --ivory: #F2EDE3;
  --muted: #98A099;
  --wa: #25D366;
  --wa-deep: #128C4A;
  --line: rgba(201, 162, 75, 0.18);
  --line-soft: rgba(242, 237, 227, 0.08);
  --font-display: "Frank Ruhl Libre", "Times New Roman", serif;
  --font-body: "Heebo", "Arial Hebrew", sans-serif;
}

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

body {
  background:
    radial-gradient(1100px 500px at 50% -10%, rgba(201, 162, 75, 0.09), transparent 60%),
    radial-gradient(900px 600px at 50% 115%, rgba(16, 36, 29, 0.9), transparent 65%),
    var(--ink);
  color: var(--ivory);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* film grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.25; }

/* ---------- Header ---------- */

.g-head {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(18px, 4vw, 44px);
  background: rgba(7, 9, 11, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.g-brand { display: flex; align-items: center; gap: 12px; }
.g-brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  color: var(--gold);
  padding: 7px;
}
.g-brand-mark svg { width: 100%; height: 100%; }
.g-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.g-brand-text strong { font-family: var(--font-display); font-weight: 900; font-size: 1.2rem; }
.g-brand-text small { font-size: 0.66rem; letter-spacing: 0.12em; color: var(--gold); font-weight: 500; }

.g-head-wa {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 20px;
  border-radius: 100px;
  background: linear-gradient(135deg, #2BE070, var(--wa-deep));
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 12px 30px -10px rgba(37, 211, 102, 0.45);
  transition: transform 0.25s ease;
}
.g-head-wa:hover { transform: translateY(-2px); }
.g-head-wa svg { width: 19px; height: 19px; }

/* ---------- Layout ---------- */

.g-wrap { width: min(1080px, calc(100% - 40px)); margin-inline: auto; }

.g-hero { text-align: center; padding: 56px 0 34px; }
.g-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--gold-hi);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 7px 18px;
  background: rgba(201, 162, 75, 0.07);
  margin-bottom: 22px;
}
.g-badge svg { width: 15px; height: 15px; }
.g-hero h1 { font-size: clamp(2rem, 5vw, 3.3rem); font-weight: 900; }
.g-hero h1 .grad {
  background: linear-gradient(100deg, #9A7834 5%, #E8C97D 35%, #FFF3D6 50%, #E8C97D 65%, #9A7834 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.g-sub { max-width: 560px; margin: 14px auto 0; color: var(--muted); font-size: 1.05rem; }

.g-stage-wrap { display: flex; justify-content: center; padding: 26px 0 10px; }
.g-help { text-align: center; color: var(--muted); font-size: 0.9rem; padding-bottom: 26px; }

/* ---------- Stage card ---------- */

.stage-card {
  position: relative;
  width: 100%;
  max-width: 640px;
  border-radius: 26px;
  padding: clamp(24px, 4vw, 44px);
  background:
    radial-gradient(500px 260px at 50% -10%, rgba(201, 162, 75, 0.12), transparent 60%),
    linear-gradient(160deg, var(--felt-2), var(--felt) 55%, #081511);
  border: 1px solid var(--line);
  box-shadow:
    inset 0 1px 0 rgba(232, 201, 125, 0.14),
    0 40px 90px -35px rgba(0, 0, 0, 0.95);
}

/* ---------- Buttons ---------- */

.g-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 34px;
  border-radius: 100px;
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  color: #14100A;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold-deep));
  box-shadow: 0 14px 34px -12px rgba(201, 162, 75, 0.6);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.2s;
}
.g-btn:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -14px rgba(201, 162, 75, 0.75); }
.g-btn:active { transform: scale(0.97); }
.g-btn[disabled] { opacity: 0.45; pointer-events: none; }

.g-btn--wa {
  color: #fff;
  background: linear-gradient(135deg, #2BE070, var(--wa-deep));
  box-shadow: 0 14px 34px -12px rgba(37, 211, 102, 0.5);
}

.stage-cta { display: flex; justify-content: center; margin-top: 26px; }

/* ---------- Prize board ---------- */

.g-prizes { text-align: center; padding: 44px 0 70px; }
.g-prizes h2 { font-size: 1.7rem; }
.g-prizes > p { color: var(--muted); margin: 8px 0 26px; }
.g-prizes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-width: 720px;
  margin-inline: auto;
}
.prize {
  padding: 18px 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(242, 237, 227, 0.03), transparent);
}
.prize strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.7rem;
  color: var(--ivory);
  direction: ltr;
}
.prize span { font-size: 0.72rem; color: var(--muted); }
.prize.hl { border-color: var(--line); background: linear-gradient(180deg, rgba(201, 162, 75, 0.12), rgba(201, 162, 75, 0.02)); }
.prize.hl strong { color: var(--gold-hi); }

/* ---------- Footer ---------- */

.g-foot { border-top: 1px solid var(--line-soft); background: #050607; }
.g-foot .inner { width: min(860px, calc(100% - 40px)); margin-inline: auto; padding: 30px 0 34px; text-align: center; }
.a18 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 12px;
}
.g-foot p { font-size: 0.78rem; color: rgba(152, 160, 153, 0.75); }
.g-foot .cp { margin-top: 10px; color: var(--muted); }

/* ---------- Win modal ---------- */

.modal-back {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 6, 5, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}
.modal {
  position: relative;
  width: min(430px, 100%);
  text-align: center;
  border-radius: 24px;
  padding: 44px 34px 34px;
  background:
    radial-gradient(400px 220px at 50% -10%, rgba(201, 162, 75, 0.18), transparent 60%),
    linear-gradient(160deg, #131A16, #0A0D0B);
  border: 1px solid rgba(201, 162, 75, 0.5);
  box-shadow: 0 50px 110px -30px rgba(0, 0, 0, 1), 0 0 70px -20px rgba(201, 162, 75, 0.4);
  animation: popIn 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.modal .close {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-soft);
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 7px;
}
.modal .close svg { width: 100%; height: 100%; }
.modal-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 74px; height: 74px;
  border-radius: 50%;
  color: #14100A;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold-deep));
  padding: 19px;
  box-shadow: 0 16px 40px -12px rgba(201, 162, 75, 0.7);
  margin-bottom: 14px;
}
.modal-medal svg { width: 100%; height: 100%; }
.modal .won {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 6px;
}
.modal h3 { font-size: 1.5rem; margin-bottom: 10px; }
.modal .desc { color: var(--muted); font-size: 0.92rem; margin-bottom: 22px; }
.modal .fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.modal input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(7, 9, 11, 0.6);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.modal input:focus { outline: none; border-color: var(--gold); }
.modal .wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  border-radius: 100px;
  background: linear-gradient(135deg, #2BE070, var(--wa-deep));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 14px 34px -12px rgba(37, 211, 102, 0.55);
  transition: transform 0.25s ease;
}
.modal .wa-btn:hover { transform: translateY(-2px); }
.modal .wa-btn svg { width: 20px; height: 20px; }
.modal-fine { margin-top: 12px; font-size: 0.75rem; color: var(--muted); }

/* ---------- Mute button ---------- */

.g-head-side { display: flex; align-items: center; gap: 10px; }
.g-mute {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(201, 162, 75, 0.06);
  color: var(--gold-hi);
  cursor: pointer;
  padding: 10px;
  transition: border-color 0.2s, transform 0.2s;
}
.g-mute:hover { border-color: var(--gold); transform: translateY(-1px); }
.g-mute svg { width: 100%; height: 100%; }
.g-mute .snd-off { display: none; }
.g-mute.is-muted .snd-on { display: none; }
.g-mute.is-muted .snd-off { display: block; }
.g-mute.is-muted { color: var(--muted); }

/* ---------- Coin burst ---------- */

.coin-layer {
  position: fixed;
  inset: 0;
  z-index: 290;
  pointer-events: none;
  overflow: hidden;
}
.coin-layer i {
  position: absolute;
  top: 58%;
  left: 50%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #FFF3D6, #E8C97D 40%, #9A7834 85%);
  box-shadow:
    inset 0 0 0 2px rgba(122, 95, 40, 0.7),
    inset 2px 2px 3px rgba(255, 248, 226, 0.7),
    0 4px 10px rgba(0, 0, 0, 0.45);
  animation: coinFly 1.4s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
@keyframes coinFly {
  0% { transform: translate(0, 0) scale(0.4) rotate(0deg); opacity: 0; }
  12% { opacity: 1; }
  38% { transform: translate(calc(var(--dx) * 0.65), var(--dy)) scale(1.05) rotate(220deg); opacity: 1; }
  100% { transform: translate(var(--dx), 60vh) scale(0.9) rotate(560deg); opacity: 0.9; }
}

/* ---------- Shake ---------- */

.shake { animation: stageShake 0.4s ease; }
@keyframes stageShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5px, 2px); }
  40% { transform: translate(5px, -2px); }
  60% { transform: translate(-4px, -1px); }
  80% { transform: translate(3px, 2px); }
}

/* ---------- Confetti ---------- */

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  overflow: hidden;
}
.confetti-layer i {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  opacity: 0.95;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.7; }
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { transform: scale(0.85); opacity: 0; } }

/* ---------- Hub (index) ---------- */

.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  padding: 20px 0 70px;
}
.hub-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 30px 28px 26px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(300px 170px at 85% -10%, rgba(201, 162, 75, 0.1), transparent 60%),
    linear-gradient(160deg, #101913, #0A0F0C);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}
.hub-card:hover {
  transform: translateY(-7px);
  border-color: rgba(201, 162, 75, 0.55);
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, 0.9), 0 0 40px -18px rgba(201, 162, 75, 0.4);
}
.hub-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
  border: 1px solid var(--line-soft);
  border-radius: 100px;
  padding: 3px 12px;
  margin-bottom: 18px;
}
.hub-tag.gold {
  color: #14100A;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold));
  border-color: transparent;
}
.hub-ico { width: 52px; height: 52px; color: var(--gold); margin-bottom: 16px; }
.hub-ico svg { width: 100%; height: 100%; }
.hub-card h2 { font-size: 1.35rem; margin-bottom: 6px; }
.hub-card p { font-size: 0.92rem; color: var(--muted); }
.hub-go {
  margin-top: 18px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold-hi);
  border-bottom: 1px solid rgba(232, 201, 125, 0.4);
  padding-bottom: 2px;
}

/* ---------- A11y & motion ---------- */

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .hub-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .hub-grid { grid-template-columns: 1fr; }
  .g-prizes-grid { grid-template-columns: repeat(2, 1fr); }
  .g-head-wa span { display: none; }
}
