/* כוכב עולה - שפת "ליל משחק": זהב על כחול לילה, מספרים גדולים ב-Karantina */
@import url('fonts.css?v=1');

:root {
  --bg: #0a0e1a;
  --bg-card: rgba(255, 255, 255, 0.045);
  --bg-raised: #141c33;
  --line: rgba(255, 255, 255, 0.07);
  --gold: #e8c15a;
  --gold-dim: rgba(232, 193, 90, 0.28);
  --ink: #edeef2;
  --ink-dim: #8b94ac;
  --danger: #e86a5a;
  --ok: #6ee8a0;
  --display: 'Karantina', 'Heebo', sans-serif;
  --body: 'Heebo', -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }
body {
  background: var(--bg);
  background-image:
    repeating-linear-gradient(115deg, rgba(255,255,255,.02) 0 2px, transparent 2px 26px),
    radial-gradient(120% 55% at 50% -10%, #16223f 0%, var(--bg) 60%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
}

.app {
  max-width: 520px;
  width: 100%;
  overflow-x: clip;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
}

.loading { color: var(--ink-dim); text-align: center; padding-top: 40vh; }

/* טיפוגרפיה */
h1.display { font-family: var(--display); font-size: 52px; line-height: 0.95; color: var(--gold); }
h2.display { font-family: var(--display); font-size: 36px; line-height: 0.95; }
.kicker { color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.dim { color: var(--ink-dim); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }

/* כרטיסים */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.card.hot {
  background: linear-gradient(160deg, var(--bg-raised), #0e1424);
  border-color: var(--gold-dim);
}

/* שורת סטטוס עליונה */
.topbar { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--ink-dim); }
.badge { background: var(--gold); color: #14161c; font-weight: 700; padding: 3px 9px; border-radius: 6px; font-size: 11px; }
.badge.ghost { background: none; border: 1px solid var(--gold-dim); color: var(--gold); }

/* גיבור */
.hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hero .name { font-family: var(--display); font-size: 40px; line-height: 0.95; }
.hero .meta { color: var(--ink-dim); font-size: 12.5px; margin-top: 4px; }
.hero .value { color: var(--gold); font-size: 12.5px; margin-top: 2px; }
.rating { font-family: var(--display); font-size: 46px; line-height: 1; color: var(--gold); text-shadow: 0 0 24px rgba(232,193,90,.4); text-align: center; min-width: 64px; }
.rating small { display: block; font-family: var(--body); font-size: 10px; color: var(--ink-dim); letter-spacing: .1em; }

/* רשת סטטים */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { text-align: center; padding: 10px 4px 8px; border-radius: 12px; background: var(--bg-card); border-top: 2px solid var(--gold-dim); }
.stat b { display: block; font-family: var(--display); font-size: 27px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { display: block; font-size: 10.5px; color: var(--ink-dim); margin-top: 2px; }

/* טבלה */
.table { border-radius: 12px; overflow: hidden; background: var(--bg-card); }
.trow { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.trow + .trow { border-top: 1px solid var(--line); }
.trow .pos { width: 18px; text-align: center; color: var(--ink-dim); }
.trow .club { flex: 1; }
.trow .pts { color: var(--ink-dim); }
.trow.me { background: rgba(232,193,90,.13); box-shadow: inset 3px 0 0 var(--gold); font-weight: 700; }
.trow.me .pos, .trow.me .pts { color: var(--ink); }

/* כפתורים */
.btns { display: flex; flex-direction: column; gap: 8px; }
.btn {
  border: 0; width: 100%; padding: 13px 14px; border-radius: 12px;
  font-family: var(--body); font-size: 14.5px; font-weight: 600;
  text-align: center; cursor: pointer; color: var(--ink);
  background: rgba(255,255,255,.07);
}
.btn:active { transform: scale(0.985); }
.btn.primary { background: var(--gold); color: #14161c; }
.btn.danger { background: rgba(232,106,90,.15); color: var(--danger); }
.btn .sub { display: block; font-weight: 400; font-size: 11.5px; opacity: .75; margin-top: 2px; }

/* הצעות */
.offer { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.offer .club-name { font-weight: 700; font-size: 15px; }
.offer .line { font-size: 12px; opacity: .8; }

/* אירוע */
.event-text { font-size: 15px; line-height: 1.6; margin: 6px 0 10px; }
.reaction { color: var(--ink-dim); font-size: 13px; border-right: 2px solid var(--gold-dim); padding-right: 10px; margin-top: 8px; }

/* ציר קריירה */
.timeline { display: flex; flex-direction: column; }
.timeline .trow { font-size: 12px; }

/* בחירת צ'יפים במסך פתיחה */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px;
  font-size: 13.5px; cursor: pointer; color: var(--ink); background: none; font-family: var(--body);
}
.chip.on { background: var(--gold); color: #14161c; font-weight: 700; border-color: var(--gold); }
input.field {
  width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-card); color: var(--ink); font-family: var(--body); font-size: 15px;
}
input.field:focus { outline: 1px solid var(--gold-dim); }

.divider { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.footer-actions { display: flex; gap: 8px; }
.footer-actions .btn { font-size: 12.5px; padding: 9px; color: var(--ink-dim); background: none; border: 1px solid var(--line); }

.fade-in { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

/* סמלים ואווטאר */
.crest { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.crest img { object-fit: contain; filter: drop-shadow(0 1px 3px rgba(0,0,0,.4)); }
.crest.mystery { width: 52px; height: 52px; border-radius: 50%; background: var(--bg-card); border: 1px solid var(--line); font-size: 22px; color: var(--ink-dim); }
.hero .avatar { flex: none; margin-inline-end: 2px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
.trow .crest { margin-inline-end: -4px; }

/* משחק מפתח */
.versus { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0; }
.versus .side { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; text-align: center; font-size: 13px; font-weight: 600; }
.versus .vs { font-family: var(--display); font-size: 26px; color: var(--gold); }
.ticker { display: flex; flex-direction: column; gap: 8px; }
.beat { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.5; opacity: 0; animation: beatIn .4s ease forwards; }
.beat .minute { color: var(--gold); font-weight: 700; min-width: 26px; text-align: center; flex: none; }
.beat.goal { background: rgba(232,193,90,.14); border-radius: 10px; padding: 8px 6px; box-shadow: inset 3px 0 0 var(--gold); animation: beatIn .4s ease forwards, goalFlash 1.1s ease; }
.beat.bad { background: rgba(232,106,90,.1); border-radius: 10px; padding: 8px 6px; box-shadow: inset 3px 0 0 var(--danger); }
@keyframes beatIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }
@keyframes goalFlash { 0% { background: rgba(232,193,90,.55); } 100% { background: rgba(232,193,90,.14); } }
.decision-card { opacity: 0; animation: fade .4s ease forwards; }
.result-card { opacity: 0; animation: fade .4s ease forwards; }
.scoreline { font-family: var(--display); font-size: 34px; line-height: 1.05; margin-top: 4px; }
.result-card.won .scoreline { color: var(--gold); text-shadow: 0 0 22px rgba(232,193,90,.4); }

/* הצעות עם סמלים */
.offer-row { display: flex; align-items: center; gap: 10px; opacity: 0; animation: fade .4s ease forwards; }
.offer-row .offer { flex: 1; }

/* חדשות */
.news .headline { font-size: 14px; font-weight: 600; padding: 8px 0; border-bottom: 1px solid var(--line); }
.news .headline:last-child { border-bottom: 0; }
.news .headline::before { content: '📰 '; }

/* חדר גביעים */
.trophy-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.trophy { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--bg-card); border-radius: 12px; padding: 10px 4px; text-align: center; }
.trophy .t-emoji { font-size: 22px; }
.trophy b { font-family: var(--display); font-size: 22px; }
.trophy .t-label { font-size: 9.5px; color: var(--ink-dim); line-height: 1.2; }
.trophy.empty { opacity: .35; }
.trophy.gold { border: 1px solid var(--gold-dim); background: rgba(232,193,90,.1); }

/* הודעות גיבוי */
.toast { margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13px; background: rgba(110,232,160,.12); color: var(--ok); border: 1px solid rgba(110,232,160,.28); }
.toast.bad { background: rgba(232,106,90,.12); color: var(--danger); border-color: rgba(232,106,90,.3); }
textarea.field { resize: vertical; font-family: var(--body); margin-top: 8px; line-height: 1.4; }

/* קונפטי לרגעי אליפות */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: confettiFall linear forwards; }
@keyframes confettiFall {
  to { transform: translateY(105vh) rotate(720deg); opacity: .7; }
}

@media (prefers-reduced-motion: reduce) {
  .fade-in, .beat, .decision-card, .result-card, .offer-row { animation: none; opacity: 1; }
  .confetti { display: none; }
}
