/* Rubik — הפונט הראשי: עגול, ידידותי ותומך בעברית (רישיון SIL OFL, assets/fonts/RUBIK-LICENSE.txt).
   Outfit נשאר למספרים ולכותרות באנגלית. שניהם מקומיים — בלי Google Fonts. */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/assets/fonts/rubik-hebrew.woff2') format('woff2');
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/assets/fonts/rubik-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/assets/fonts/rubik-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Outfit מקומי (במקום Google Fonts — ה-@import החיצוני עיכב כל טעינת דף).
   פונט משתנה: קובץ אחד לכל המשקלים. רישיון SIL OFL. אין בו עברית — העברית נופלת לפונט המערכת. */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── פלטה: צבעי עולם הפוקימונים (אדום פוכדור, צהוב פיקאצ'ו, כחול שמיים) על כחול-לילה ──
   בכוונה בלי גרדיאנט סגול-אינדיגו ובלי "זכוכית" שקופה — זה המראה הגנרי שרצינו לעזוב. */
:root {
  --bg-primary:   #4fb0fa;   /* רקע הדף — שמיים (מתחת לתמונת הרקע) */
  --bg-secondary: #151f38;   /* שדות, פאנלים */
  --bg-tertiary:  #1e2a48;   /* צ'יפים, כפתור משני */
  --surface:      #131c33;   /* כרטיסים */
  --surface-hi:   #1a2542;

  --text-primary:   #f4f6fb;
  --text-secondary: #98a4c0;

  --accent-primary:   #ff4d3d;   /* אדום פוכדור — פעולה ראשית, מצב פעיל */
  --accent-dark:      #c7301f;
  --accent-secondary: #ffcb05;   /* צהוב — Silver, XP, הדגשות */
  --accent-blue:      #3b8cff;
  --accent-glow: rgba(255, 77, 61, 0.28);
  --highlight:   #ffd84d;

  --success: #22c55e;
  --danger:  #ef4444;
  --warning: #f59e0b;

  --glass-bg:     var(--surface);
  --glass-border: #243154;
  --glass-shadow: 0 6px 18px rgba(3, 7, 18, 0.35);

  --font-main: 'Rubik', 'Outfit', system-ui, sans-serif;
  --font-num:  'Outfit', 'Rubik', system-ui, sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* hidden תמיד מסתיר — גם כשלאלמנט יש display משלו (אחרת מפת הקרב נשארה פתוחה באמצע קרב) */
[hidden] { display: none !important; }

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  direction: rtl; /* Hebrew */
  line-height: 1.5;
  /* רקע "פוקימוני" של יום בהיר: שמיים כחולים, עננים וגבעות דשא בתחתית (כמו מסכי הפתיחה של המשחקים).
     הכרטיסים נשארים כחול-לילה אטום — כמו תפריט משחק שמונח מעל העולם. */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='260' viewBox='0 0 1600 260' preserveAspectRatio='none'%3E%3Cpath fill='%238fdc6a' d='M0 120 C160 60 300 70 440 110 S720 150 860 96 S1160 40 1320 90 S1520 130 1600 100 V260 H0Z'/%3E%3Cpath fill='%235cc44a' d='M0 170 C200 120 360 130 520 160 S820 200 1000 150 S1320 110 1600 160 V260 H0Z'/%3E%3Cpath fill='%2348ad3c' d='M0 214 C260 188 520 196 800 214 S1340 232 1600 208 V260 H0Z'/%3E%3C/svg%3E"),
    radial-gradient(ellipse 60% 40% at 85% 0%, rgba(255, 244, 190, .55), transparent 70%),
    linear-gradient(180deg, #2f8ff0 0%, #4fb0fa 38%, #8fd3ff 72%, #c7ecff 100%);
  background-size: 100% 200px, auto, auto;
  background-position: bottom center, 0 0, 0 0;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* עננים שנסחפים לאט מעל השמיים (שכבה נפרדת — תזוזה ב-transform, בלי לצייר מחדש את כל הדף) */
body::before {
  content: ''; position: fixed; z-index: -1; pointer-events: none;
  top: 70px; left: 0; width: calc(100% + 1400px); height: 360px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='360' viewBox='0 0 1400 360'%3E%3Cg fill='white'%3E%3Cg opacity='.95'%3E%3Cellipse cx='170' cy='96' rx='92' ry='30'/%3E%3Ccircle cx='130' cy='80' r='34'/%3E%3Ccircle cx='188' cy='66' r='44'/%3E%3Ccircle cx='236' cy='86' r='28'/%3E%3C/g%3E%3Cg opacity='.8'%3E%3Cellipse cx='720' cy='58' rx='70' ry='22'/%3E%3Ccircle cx='694' cy='46' r='26'/%3E%3Ccircle cx='740' cy='36' r='32'/%3E%3C/g%3E%3Cg opacity='.9'%3E%3Cellipse cx='1130' cy='150' rx='110' ry='32'/%3E%3Ccircle cx='1080' cy='132' r='38'/%3E%3Ccircle cx='1146' cy='112' r='52'/%3E%3Ccircle cx='1204' cy='138' r='30'/%3E%3C/g%3E%3Cg opacity='.6'%3E%3Cellipse cx='470' cy='230' rx='64' ry='18'/%3E%3Ccircle cx='452' cy='220' r='22'/%3E%3Ccircle cx='492' cy='212' r='26'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat-x 0 0 / 1400px 360px;
  animation: clouds-drift 140s linear infinite;
}
@keyframes clouds-drift { to { transform: translateX(-1400px); } }
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }

::selection { background: rgba(255, 203, 5, 0.35); }

a { color: inherit; }

/* פאנל — היה "זכוכית"; עכשיו משטח אטום עם גבול ברור */
.glass-panel {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-md);
}

/* ── כפתורים: "משחקיים" — צבע מלא וקצה תחתון כהה, נלחצים פנימה ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-bottom: 3px solid rgba(0, 0, 0, 0.28);
  border-radius: 12px;
  cursor: pointer;
  transition: transform .12s ease, filter .15s ease, background .15s ease;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover  { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); border-bottom-width: 1px; }

.btn-primary {
  background: var(--accent-primary);
  border-bottom-color: var(--accent-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-bottom-color: #0f172c;
  box-shadow: inset 0 0 0 1px var(--glass-border);
}
.btn-secondary:hover { background: #26345a; }

/* Inputs */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.input-group label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.input-group input {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 1rem;
  transition: var(--transition);
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent-secondary);
  box-shadow: 0 0 0 3px rgba(255, 203, 5, 0.18);
}

/* Layout Helpers */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

/* Micro-animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: #18223d;
  border: 1px solid var(--glass-border);
  padding: 12px 18px;
  border-radius: 12px;
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  animation: slideInLeft 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 10px 24px rgba(0,0,0,0.45);
}

.toast.error { border-right: 4px solid var(--danger); }
.toast.success { border-right: 4px solid var(--success); }

@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutLeft {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-100%); opacity: 0; }
}

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