:root {
  --bg: #0b0a1a;
  --bg-2: #13112b;
  --card: #17153a;
  --line: #2c2862;
  --text: #ecebff;
  --muted: #a7a3d6;
  --neon: #ff4fd8;
  --neon-2: #22d3ee;
  --ok: #4ade80;
  --radius: 18px;
  --pixel: 'Press Start 2P', monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Rubik', system-ui, 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}
body.has-party { padding-bottom: 96px; }
body::after { /* scanlines */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px);
}
a { color: var(--neon-2); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
:focus-visible { outline: 3px solid var(--neon-2); outline-offset: 3px; border-radius: 6px; }

.pixel { font-family: var(--pixel); font-size: .68rem; letter-spacing: .08em; color: var(--neon-2); margin: 0; direction: ltr; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--neon); color: #000; padding: 8px 14px; border-radius: 8px; z-index: 200; }
.skip:focus { inset-inline-start: 8px; }

/* ---------- כפתורים ---------- */
.btn {
  font: inherit; font-weight: 700; cursor: pointer; border-radius: 12px; border: 2px solid transparent;
  padding: 12px 22px; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--neon), #7c5cff); color: #fff; box-shadow: 0 6px 24px -6px var(--neon); }
.btn[hidden] { display: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--neon-2); }
.btn-small { padding: 8px 14px; font-size: .9rem; border-radius: 10px; }
.btn-toggle { background: var(--c, var(--neon)); color: #0b0a1a; }
.btn-toggle[aria-pressed="true"] { background: transparent; color: var(--c, var(--neon)); border-color: var(--c, var(--neon)); }

/* ---------- כותרת ---------- */
.top {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 20px;
  padding: 12px clamp(16px, 4vw, 48px); background: rgba(11,10,26,.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); direction: ltr; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, var(--neon), var(--neon-2));
  box-shadow: 0 0 18px var(--neon);
}
.logo-text { font-family: var(--pixel); font-size: .8rem; }
.logo-text small { font-size: .55rem; color: var(--muted); }
.top nav { display: flex; gap: 4px; margin-inline-start: auto; }
.top nav a { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 8px; font-weight: 500; }
.top nav a:hover { color: var(--text); background: var(--bg-2); }
.party-open { padding: 8px 14px; }
.lang { flex: none; color: var(--muted); text-decoration: none; font-weight: 700; font-size: .85rem; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; }
.lang:hover { color: var(--text); border-color: var(--neon-2); }
.logo + .lang { margin-inline-start: auto; }
.count { background: var(--neon); color: #000; border-radius: 99px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; font-size: .8rem; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(56px, 10vw, 120px) 16px 40px; text-align: center; }
.hero-grid {
  position: absolute; inset: auto -50% 0 -50%; height: 55%;
  background:
    linear-gradient(transparent 0 calc(100% - 1px), rgba(255,79,216,.35) 0) 0 0 / 100% 42px,
    linear-gradient(90deg, transparent 0 calc(100% - 1px), rgba(34,211,238,.3) 0) 0 0 / 42px 100%;
  transform: perspective(420px) rotateX(62deg); transform-origin: bottom;
  mask-image: linear-gradient(transparent, #000 60%);
  animation: floor 3s linear infinite;
}
@keyframes floor { to { background-position: 0 42px, 0 0; } }
.hero-inner { position: relative; max-width: 860px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.3rem, 7vw, 4.6rem); font-weight: 900; margin: 18px 0; }
.grad { background: linear-gradient(90deg, var(--neon), #7c5cff, var(--neon-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--muted); max-width: 640px; margin: 0 auto 28px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.blink { animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.hero-lineup { display: flex; justify-content: center; gap: clamp(4px, 2vw, 18px); margin-top: 48px; }
.hero-lineup span { width: clamp(52px, 11vw, 96px); animation: bob 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.4s); filter: drop-shadow(0 8px 16px color-mix(in srgb, var(--c) 45%, transparent)); }
@keyframes bob { 50% { transform: translateY(-10px); } }

.avatar { width: 100%; height: auto; display: block; overflow: visible; }
.av-eyes { animation: look 5s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes look { 0%, 44%, 50%, 100% { transform: scaleY(1); } 47% { transform: scaleY(.1); } }
.av-tip { animation: tip 1.6s ease-in-out infinite; }
@keyframes tip { 50% { opacity: .35; } }

/* ---------- סקשנים ---------- */
.section { max-width: 1180px; margin: 0 auto; padding: clamp(56px, 8vw, 96px) 16px 0; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 900; margin: 12px 0 8px; }
.section-head p:not(.pixel) { color: var(--muted); margin: 0; }

/* ---------- כרטיסי דמויות ---------- */
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.card {
  position: relative; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 10%, var(--card)), var(--card) 55%);
  border: 2px solid var(--line); border-radius: var(--radius); padding: 22px 20px 18px; text-align: center;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.card:hover, .card:focus-within { transform: translateY(-6px); border-color: var(--c); box-shadow: 0 16px 40px -18px var(--c); }
.card.picked { border-color: var(--c); box-shadow: 0 0 0 2px var(--c), 0 16px 40px -14px var(--c); }
.card.picked::before {
  content: 'IN PARTY'; position: absolute; top: 12px; inset-inline-end: 12px; font-family: var(--pixel); font-size: .5rem;
  background: var(--c); color: #0b0a1a; padding: 5px 7px; border-radius: 6px;
}
.card-hit { position: absolute; inset: 0; background: none; border: 0; cursor: pointer; border-radius: var(--radius); }
.card-avatar { width: 120px; margin: 0 auto 6px; transition: transform .25s; }
.card:hover .card-avatar { transform: scale(1.08) rotate(-3deg); }
.card-latin { color: var(--c); }
.card h3 { font-size: 1.6rem; font-weight: 900; margin: 6px 0 2px; }
.card-role { color: var(--muted); margin: 0; font-size: .95rem; }
.card-role span { color: var(--text); }
.card-tag { margin: 12px 0 14px; min-height: 3.2em; }
.stats { display: grid; gap: 6px; margin-bottom: 16px; }
.stat { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 10px; font-size: .82rem; color: var(--muted); text-align: start; }
.bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.bar i { height: 9px; border-radius: 2px; background: var(--line); }
.bar i.on { background: var(--c); box-shadow: 0 0 8px color-mix(in srgb, var(--c) 60%, transparent); }
.card-actions { position: relative; display: flex; gap: 8px; justify-content: center; }

/* ---------- איך זה עובד ---------- */
.quest { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; counter-reset: q; }
.quest li { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: relative; }
.quest .lvl { font-family: var(--pixel); font-size: .75rem; color: #0b0a1a; background: var(--neon-2); border-radius: 8px; padding: 6px 9px; display: inline-block; margin-bottom: 12px; }
.quest h3 { font-size: 1.2rem; margin-bottom: 6px; }
.quest p { margin: 0; color: var(--muted); }

/* ---------- מוצרים ---------- */
.items { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.item { position: relative; border-radius: var(--radius); padding: 24px; border: 2px dashed color-mix(in srgb, var(--c) 60%, var(--line)); background: color-mix(in srgb, var(--c) 7%, var(--bg-2)); }
.item h3 { font-size: 1.6rem; font-weight: 900; color: var(--c); direction: ltr; text-align: right; }
.item-he { margin: 2px 0 10px; font-weight: 700; }
.item p { color: var(--muted); }
.item-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.item-status { position: absolute; top: 18px; inset-inline-end: 18px; font-size: .8rem; background: var(--c); color: #fff; padding: 3px 10px; border-radius: 99px; font-weight: 700; }

/* ---------- עבודות ---------- */
.missions { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.mission { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.mission h3 { font-size: 1.25rem; margin: 10px 0 6px; direction: ltr; text-align: right; }
[dir="ltr"] :is(.item, .mission) h3 { text-align: left; }
.mission p { color: var(--muted); margin: 0 0 12px; }
.mission-owners { display: flex; gap: 6px; }
.mission-owners button { width: 42px; padding: 0; border: 2px solid var(--c); border-radius: 50%; background: var(--card); cursor: pointer; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: .78rem; border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; max-width: 820px; margin: 0 auto; }
.faq details { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { color: var(--muted); margin: 10px 0 0; }

.final { text-align: center; padding-bottom: 80px; }
.final h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 900; margin: 12px 0 24px; }

.foot { border-top: 1px solid var(--line); display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; padding: 24px 16px; color: var(--muted); font-size: .9rem; }
.foot a { color: var(--muted); }

/* ---------- סרגל הצוות ---------- */
.party-bar {
  position: fixed; bottom: 12px; inset-inline: 12px; z-index: 60; max-width: 900px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px;
  background: rgba(23,21,58,.92); backdrop-filter: blur(12px); border: 2px solid var(--neon); border-radius: 18px;
  box-shadow: 0 10px 40px -10px var(--neon); animation: rise .3s ease-out;
}
.party-bar[hidden] { display: none; }
@keyframes rise { from { transform: translateY(120%); } }
.party-slots { display: flex; align-items: center; gap: 6px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.slot { flex: none; display: flex; flex-direction: column; align-items: center; background: none; border: 0; color: var(--text); cursor: pointer; font: inherit; font-size: .72rem; padding: 0 2px; }
.slot .avatar { width: 44px; }
.slot:hover .avatar { opacity: .5; }
.party-label { color: var(--muted); font-size: .85rem; white-space: nowrap; margin-inline-start: 6px; }

/* ---------- פרופיל ---------- */
.profile {
  width: min(760px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 2px solid var(--c); border-radius: 22px;
  background: var(--bg); color: var(--text); box-shadow: 0 0 60px -10px var(--c);
}
.profile::backdrop { background: rgba(5,4,15,.75); backdrop-filter: blur(4px); }
.profile[open] { animation: pop .25s ease-out; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.profile-inner { padding: clamp(20px, 4vw, 36px); position: relative; }
.close { position: absolute; top: 14px; inset-inline-end: 14px; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); cursor: pointer; font-size: 1.1rem; }
.profile-head { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.profile-avatar { width: clamp(96px, 20vw, 140px); flex: none; animation: bob 2.4s ease-in-out infinite; }
.profile-head .pixel { color: var(--c); }
.profile-head h2 { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 900; }
.speech {
  position: relative; background: var(--bg-2); border: 2px solid var(--c); border-radius: 16px; padding: 16px 18px; margin: 0 0 20px; font-size: 1.05rem;
}
.speech::before { content: ''; position: absolute; top: -10px; inset-inline-start: 44px; width: 16px; height: 16px; background: var(--bg-2); border-top: 2px solid var(--c); border-inline-start: 2px solid var(--c); transform: rotate(45deg); }
.stats.wide .stat { grid-template-columns: 120px 1fr; font-size: .9rem; }
.fit { margin: 0 0 8px; }
.profile h3 { font-size: 1.2rem; margin: 26px 0 12px; color: var(--c); }
.does { margin: 0; padding-inline-start: 0; list-style: none; display: grid; gap: 8px; }
.does li { background: var(--bg-2); border-radius: 12px; padding: 10px 14px; border-inline-start: 4px solid var(--c); }
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.ba div { border-radius: 14px; padding: 14px; background: var(--bg-2); }
.ba div:last-child { background: color-mix(in srgb, var(--c) 14%, var(--bg-2)); }
.ba p { margin: 8px 0 0; }
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.level { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--bg-2); }
.level:nth-child(3) { border-color: var(--c); }
.level b { font-family: var(--pixel); font-size: .62rem; color: var(--c); }
.level p { margin: 8px 0 0; color: var(--muted); font-size: .92rem; }
.price { display: block; margin-top: 8px; font-weight: 700; }
.p-missions { display: grid; gap: 10px; }
.p-missions div { background: var(--bg-2); border-radius: 12px; padding: 12px 14px; }
.p-missions p { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.profile .faq { max-width: none; }
.profile-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }

/* ---------- עמודי מוצר ---------- */
.product { --c: var(--neon-2); }
.product-hero { max-width: 900px; margin: 0 auto; padding: clamp(48px, 8vw, 96px) 16px 0; text-align: center; }
.product-hero .item-status { position: static; display: inline-block; margin-bottom: 14px; }
.product-hero h1 { font-size: clamp(2.4rem, 7vw, 4rem); font-weight: 900; margin: 8px 0 4px; color: var(--c); direction: ltr; text-shadow: 0 0 28px color-mix(in srgb, var(--c) 45%, transparent); }
.product-hero .item-he { font-size: clamp(1.15rem, 3vw, 1.5rem); margin-bottom: 16px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.feature { background: var(--bg-2); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: var(--radius); padding: 22px; }
.feature h3 { font-size: 1.15rem; margin: 0 0 6px; }
.feature p { margin: 0; color: var(--muted); }
.who { max-width: 760px; margin: 0 auto; padding: 0; list-style: none; display: grid; gap: 10px; }
.who li { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; color: var(--muted); }
.who b { color: var(--text); }
.back { display: block; text-align: center; margin: 32px auto 80px; color: var(--muted); }

/* ---------- טוסט ---------- */
.toast {
  position: fixed; top: 76px; left: 50%; transform: translate(-50%, -20px); opacity: 0; pointer-events: none; z-index: 300;
  background: var(--card); border: 1px solid var(--neon-2); padding: 10px 18px; border-radius: 12px; transition: .25s; font-weight: 500;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- מובייל ---------- */
@media (max-width: 760px) {
  .top { gap: 12px; }
  .top nav { display: none; }
  .party-open { margin-inline-start: auto; white-space: nowrap; }
  .ba { grid-template-columns: 1fr; }
  .profile-head { flex-direction: column; text-align: center; }
  .speech::before { inset-inline-start: calc(50% - 8px); }
  .party-bar .btn { padding: 10px 14px; font-size: .9rem; }
  .party-label { display: none; }
}
@media (max-width: 420px) {
  .logo-text small { display: none; } /* מפנה מקום בכותרת לכפתור הצוות ולכפתור השפה */
}
@media (max-width: 360px) {
  .top { gap: 8px; }
  .logo-text { font-size: .62rem; }
  .party-open { padding: 6px 10px; }
  .lang { padding: 5px 7px; }
}

/* ---------- משחק פתיחה ---------- */
.game-pending, .game-open { overflow: hidden; }
.game { display: none; position: fixed; inset: 0; z-index: 400; background: var(--bg); overflow: hidden; }
.game-pending .game, .game-open .game { display: block; }
.game canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.game-loading { position: absolute; inset: 0; display: none; place-items: center; font-size: .9rem; }
.game[data-state="loading"] .game-loading { display: grid; }
.game-skip { position: absolute; top: 14px; left: 14px; z-index: 3; background: rgba(11,10,26,.6); }
.game[data-state="title"] .game-skip, .game[data-state="end"] .game-skip { display: none; }
.game-screen {
  position: absolute; inset: 0; z-index: 2; display: none; place-items: center; align-content: center; gap: 16px;
  text-align: center; padding: 24px 16px; background: radial-gradient(ellipse at center, rgba(11,10,26,.7), rgba(11,10,26,.2) 70%);
}
.game[data-state="title"] [data-screen="title"], .game[data-state="end"] [data-screen="end"] { display: grid; }
.game-screen h2 { font-size: clamp(2rem, 6vw, 3.6rem); font-weight: 900; text-shadow: 0 4px 30px #000; }
.game-screen p:not(.pixel) { color: var(--text); margin: 0; max-width: 520px; text-shadow: 0 2px 12px #000; }
.game-hud {
  position: absolute; top: 18px; right: 18px; z-index: 2; display: none; gap: 20px; direction: ltr; pointer-events: none;
  font-family: var(--pixel); font-size: .7rem; color: var(--neon-2); text-shadow: 0 0 10px var(--neon-2);
}
.game-hud b { color: #fff; font-weight: 400; }
.game-hud .lives { color: var(--neon); text-shadow: 0 0 10px var(--neon); letter-spacing: .2em; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip { border: 2px solid var(--c); color: var(--c); background: rgba(11,10,26,.75); border-radius: 99px; padding: 2px 12px; font-weight: 700; box-shadow: 0 0 14px -4px var(--c); }
.game-team { position: absolute; bottom: 18px; inset-inline: 16px; z-index: 2; display: none; pointer-events: none; }
.game[data-state="play"] .game-hud, .game[data-state="play"] .game-team { display: flex; }
.game-pop { position: absolute; top: 28%; left: 50%; z-index: 2; transform: translateX(-50%); opacity: 0; pointer-events: none; font-size: clamp(1.3rem, 4vw, 2rem); font-weight: 900; text-shadow: 0 0 18px currentColor; white-space: nowrap; }
.game-pop.show { animation: game-pop .9s ease-out; }
@keyframes game-pop { 0% { opacity: 0; transform: translate(-50%, 12px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -40px); } }
.game.hit::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: rgba(255,46,77,.28); animation: game-hit .35s ease-out forwards; }
@keyframes game-hit { to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
