/* המרוץ לעצמאות - הלוח הדיגיטלי
   כיוון: ניאון ארקייד. מכונת משחק, לא דשבורד.
   מה מבדיל בין השניים: מסגרת סביב משטח המשחק, טקסטורת סריקה,
   רשת פרספקטיבה מתחת ללוח, וזוהר שקיים רק במקום שבו הוא אומר משהו.
   הכל CSS/SVG. בלי תמונות, בלי רשת. כהה בלבד - ניאון על רקע בהיר הוא לא ניאון. */

@font-face {
  font-family: 'Assistant';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../assets/fonts/assistant-hebrew.woff2') format('woff2');
  unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: 'Assistant';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../assets/fonts/assistant-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+2000-206F, U+2074, U+20AC, U+2212;
}

:root {
  --void: #05050e;
  --deep: #0b0a1c;
  --panel: #11102a;
  --tile-fill: #161431;
  --edge: #2a2752;
  --edge-hi: #3d3878;

  --cyan: #22e8ff;
  --magenta: #ff2d8f;

  --ink: #e9e9ff;
  --ink-dim: #8d8bc4;

  --t-payday: #35ff9b;
  --t-small: #22e8ff;
  --t-big: #b475ff;
  --t-temptation: #ff7a3d;
  --t-market: #ffd83f;
  --t-life: #ff2d8f;
}

/* ---------- הרקע: רשת פרספקטיבה + קווי סריקה ---------- */
.arcade-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(120% 80% at 50% 0%, #191539 0%, var(--deep) 45%, var(--void) 100%);
}
/* כל התוכן יושב מעל שכבת הרקע */
.wrap, .tabs, .overlay { position: relative; z-index: 1; }
.arcade-bg::before {
  content: '';
  position: absolute;
  inset: 42% -60% -10% -60%;
  background:
    repeating-linear-gradient(to right, rgba(34, 232, 255, 0.16) 0 1px, transparent 1px 62px),
    repeating-linear-gradient(to bottom, rgba(34, 232, 255, 0.16) 0 1px, transparent 1px 44px);
  transform: perspective(320px) rotateX(62deg);
  transform-origin: top center;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
}
.arcade-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px);
  opacity: 0.5;
}

/* ---------- מסגרת המכונה ---------- */
.board-wrap {
  position: relative;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  padding: 12px;
  border-radius: 20px;
  background: linear-gradient(180deg, #151233, #0a0919);
  border: 1px solid var(--edge);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 44px rgba(34, 232, 255, 0.07),
    0 0 0 1px rgba(34, 232, 255, 0.12),
    0 22px 50px -24px #000;
}
.board-wrap::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 15px;
  border: 1px solid rgba(34, 232, 255, 0.28);
  box-shadow: inset 0 0 18px rgba(34, 232, 255, 0.1);
  pointer-events: none;
}

.board { display: block; width: 100%; height: auto; }

/* ---------- אריחים ---------- */
.sq-body { fill: var(--tile-fill); stroke: var(--edge-hi); stroke-width: 1.6; }
.sq-band { opacity: 0.95; }
.sq-num {
  font-family: 'Assistant', sans-serif;
  font-size: 14px;
  font-weight: 800;
  fill: var(--ink-dim);
  text-anchor: middle;
  direction: ltr;
}
.sq-icon path { fill: none; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }

.sq { cursor: pointer; }
.sq-glow { opacity: 0; transition: opacity 0.25s ease; }
.sq:hover .sq-glow { opacity: 0.45; }

/* המשבצת הנוכחית היא היחידה שזוהרת במלוא העוצמה */
.sq.is-current .sq-body { stroke: var(--cyan); stroke-width: 2.6; }
.sq.is-current .sq-glow { opacity: 1; }
.sq.is-current { animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(34, 232, 255, 0.55)); }
  50%      { filter: drop-shadow(0 0 13px rgba(34, 232, 255, 0.95)); }
}

/* ---------- לוח התוצאות במרכז ---------- */
.hub-plate { fill: #07060f; stroke: var(--edge); stroke-width: 1.5; }
.hub-inner { fill: none; stroke: rgba(34, 232, 255, 0.22); stroke-width: 1; }
.hub-label {
  font-family: 'Assistant', sans-serif;
  font-size: 14px;
  font-weight: 700;
  fill: var(--ink-dim);
  text-anchor: middle;
  letter-spacing: 1.4px;
}
.hub-value {
  font-family: 'Assistant', sans-serif;
  font-size: 44px;
  font-weight: 800;
  text-anchor: middle;
  direction: ltr;
  letter-spacing: -1px;
}
.hub-value.cy { fill: var(--cyan); filter: drop-shadow(0 0 9px rgba(34, 232, 255, 0.7)); }
.hub-value.mg { fill: var(--ink); }

/* מד ההספק: פס אחד. קל לקרוא ממנו כמה נשאר, בניגוד לקשת. */
.pw-track { fill: rgba(255, 255, 255, 0.07); }
.pw-fill { fill: url(#pwGrad); transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1); }
.pw-cap { fill: var(--cyan); filter: drop-shadow(0 0 7px var(--cyan)); }

/* ---------- החייל ---------- */
.pawn { transition: transform 0.18s cubic-bezier(0.4, 0.1, 0.3, 1); }
.pawn-wrap { filter: drop-shadow(0 0 9px rgba(255, 45, 143, 0.85)); }
.pawn-halo { fill: var(--magenta); opacity: 0.22; }
.pawn-base { fill: #05050e; opacity: 0.85; }
.pawn-body { fill: var(--magenta); stroke: #fff; stroke-width: 2; }
.pawn-core { fill: #fff; }

/* ---------- הקוביה ---------- */
.die-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 22px;
  border: 1px solid rgba(34, 232, 255, 0.55);
  background: linear-gradient(165deg, #1b1a44, #0d0c22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 20px rgba(34, 232, 255, 0.3),
    0 10px 26px -12px #000;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.die-btn:hover {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 0 30px rgba(34,232,255,.5), 0 10px 26px -12px #000;
}
.die-btn:active { transform: translateY(2px) scale(0.97); }
.die-btn:disabled { opacity: 0.45; cursor: default; }
.die-pips { display: grid; grid-template-columns: repeat(3, 12px); grid-template-rows: repeat(3, 12px); gap: 4px; }
.die-pips i {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  opacity: 0;
  transition: opacity 0.08s;
}
.die-pips i.on { opacity: 1; }
.die-btn.rolling { animation: shake 0.44s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes shake {
  0%, 100% { transform: rotate(0) scale(1); }
  22% { transform: rotate(-14deg) scale(1.08); }
  48% { transform: rotate(12deg) scale(1.1); }
  74% { transform: rotate(-6deg) scale(1.04); }
}

.roll-dock { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 16px 0 6px; }
.roll-hint {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 2.4px;
  color: var(--ink-dim);
}

/* ---------- כרטיס "איפה אתה" ---------- */
.here {
  max-width: 540px;
  margin: 14px auto 0;
  padding: 12px 15px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent);
  border: 1px solid var(--edge);
  border-right: 3px solid var(--here-c, var(--cyan));
  display: flex;
  align-items: center;
  gap: 12px;
}
.here .txt { flex: 1; min-width: 0; }
.here .name {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--here-c, var(--cyan));
  text-shadow: 0 0 14px currentColor;
}
.here .sub { font-size: 0.82rem; color: var(--ink-dim); }
.here .pos { font-weight: 800; font-size: 1.6rem; color: var(--edge-hi); direction: ltr; }

/* ---------- סרגל עליון ---------- */
.topbar {
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 4px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink-dim);
}
.topbar b {
  display: block;
  font-size: 1.24rem;
  letter-spacing: -0.5px;
  color: var(--ink);
  direction: ltr;
}
.topbar .cash { text-align: left; }
.topbar .mid { flex: 1; text-align: center; }
.yearbar {
  display: block;
  width: 100%;
  margin-top: 5px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
  direction: rtl;
}
.yearbar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--t-market), var(--t-temptation));
  box-shadow: 0 0 8px var(--t-market);
}
.topbar .cash b { color: var(--t-payday); text-shadow: 0 0 12px rgba(53, 255, 155, 0.6); }

/* ---------- סרגל תחתון ---------- */
.tabs {
  position: fixed;
  bottom: 0; right: 0; left: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(7, 6, 18, 0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--edge);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  background: none;
  border: none;
  padding: 12px 4px 14px;
  font-family: 'Assistant', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--ink-dim);
  border-top: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
}
.tabs button[aria-selected='true'] {
  color: var(--cyan);
  border-top-color: var(--cyan);
  box-shadow: inset 0 12px 22px -14px var(--cyan);
  text-shadow: 0 0 12px var(--cyan);
}

@media (max-width: 380px) {
  .die-btn { width: 76px; height: 76px; }
  .here .name { font-size: 1rem; }
  .board-wrap { padding: 9px; }
  .topbar b { font-size: 1.1rem; }
}

/* ---------- טאבים ותוכן ---------- */
.tabpane { display: none; }
.tabpane.active { display: block; }
.tabs { grid-template-columns: repeat(4, 1fr); }

/* ---------- בורר סכום בבנק ---------- */
.stepper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  justify-content: center;
}
.stepper button {
  width: 46px;
  height: 46px;
  padding: 0;
  font-size: 1.35rem;
  border-radius: 12px;
  flex: 0 0 auto;
}
.stepper .amt {
  font-weight: 800;
  font-size: 1.5rem;
  direction: ltr;
  min-width: 116px;
  text-align: center;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(34, 232, 255, 0.55);
}

/* ---------- רשימת נכסים למכירה ---------- */
.sell-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.sell-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  text-align: right;
  width: 100%;
  font: inherit;
  color: inherit;
}
.sell-row:hover { border-color: var(--cyan); }
.sell-row .nm { flex: 1; font-weight: 700; }
.sell-row .pr { font-weight: 800; direction: ltr; color: var(--t-payday); }

/* ---------- פירוט קלף עסקה ---------- */
.detail {
  margin-top: 10px;
  border-top: 1px solid var(--edge);
  padding-top: 10px;
}
.detail summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-dim);
  list-style: none;
}
.detail summary::-webkit-details-marker { display: none; }
.detail summary::after { content: ' ▾'; }
.detail[open] summary::after { content: ' ▴'; }
.detail .row { font-size: 0.86rem; color: var(--ink-dim); }
.detail .row span:last-child { color: var(--ink); }
