/* ===== עולם קסום - סגנון משחק (לובי אלופים) ===== */
:root {
  --bg-deep: #0D1230; --bg-mid: #171E4A; --bg-glow1: #2A2170; --bg-glow2: #123055;
  --panel: rgba(28, 36, 78, 0.72); --panel-2: rgba(40, 50, 100, 0.66); --panel-solid: #1B2350;
  --ink: #ECF1FF; --ink-soft: #A7B2E0;
  --accent: #3D8BFF; --accent-2: #7A5CFF; --gold: #F5B301; --good: #35D08A; --bad: #FF6B6B;
  --common: #8A93B5; --rare: #3D8BFF; --epic: #A65CFF; --legendary: #F5B301;
  --radius: 24px; --radius-sm: 16px;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.38);
  --shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.30);
  --glow: 0 0 22px rgba(61, 139, 255, 0.45);
  --glow-gold: 0 0 26px rgba(245, 179, 1, 0.5);
  --font-display: "Fredoka", "Rubik", "Assistant", "Heebo", system-ui, sans-serif;
  --font-body: "Rubik", "Assistant", "Heebo", system-ui, sans-serif;
}
body.high-contrast {
  --bg-deep: #05070F; --bg-mid: #0A0F22; --panel: #12183A; --panel-2: #12183A; --panel-solid: #0C1128;
  --ink: #FFFFFF; --ink-soft: #C9D2F5; --accent: #5AA0FF;
  --shadow: 0 6px 18px rgba(0,0,0,0.6);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%; min-height: 560px; overflow: hidden;
  color: var(--ink); font-family: var(--font-body);
  background:
    radial-gradient(1200px 800px at 82% -8%, var(--bg-glow1), transparent 55%),
    radial-gradient(1000px 800px at 0% 108%, var(--bg-glow2), transparent 55%),
    linear-gradient(165deg, var(--bg-mid), var(--bg-deep) 70%);
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition-duration: 0.01ms !important; } }

/* רקע אווירה (תמונה) */
.app-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url("assets/champions/bg.jpg") center/cover no-repeat; opacity: 0.35; }
body.no-bg .app-bg { display: none; }

/* מסכים */
.screen { position: fixed; inset: 0; z-index: 1; display: none; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.screen.active { display: flex; animation: screenIn 0.34s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes screenIn { from { opacity: 0; transform: translateY(12px) scale(0.99); } to { opacity: 1; transform: none; } }

/* אשכול עליון */
.topbar { position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 12px; z-index: 60; display: flex; gap: 8px; align-items: center; }
.icon-btn { width: 56px; height: 56px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.10);
  background: var(--panel); box-shadow: var(--shadow-soft); backdrop-filter: blur(10px);
  cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--ink); transition: transform 0.15s ease; }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.ghost { background: transparent; border-color: transparent; box-shadow: none; opacity: 0.75; }
.icon-btn svg { width: 26px; height: 26px; }
.icon-btn.muted { opacity: 0.6; }
.counter { display: flex; align-items: center; gap: 6px; height: 56px; padding: 0 16px 0 12px;
  border: 1px solid rgba(255,255,255,0.10); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px); font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--ink); }
.counter .c-ico { width: 24px; height: 24px; }
.counter.trophy .c-ico { fill: var(--gold); }
.counter.bump { animation: bump 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes bump { 0%{transform:scale(1)} 40%{transform:scale(1.22)} 100%{transform:scale(1)} }

/* כפתור חזרה */
.back-btn { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 55;
  width: 58px; height: 56px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.10);
  background: var(--panel); box-shadow: var(--shadow-soft); backdrop-filter: blur(10px);
  cursor: pointer; color: var(--ink); font-size: 0; transition: transform 0.15s ease; }
.back-btn::before { content: "\2192"; font-size: 28px; font-weight: 700; line-height: 56px; }
.back-btn:active { transform: scale(0.92); }

/* ===== לובי (בית) ===== */
[data-screen="home"] { align-items: center; justify-content: center; }
.lobby { text-align: center; width: 100%; max-width: 780px; padding: 84px 22px 26px; display: flex; flex-direction: column; align-items: center; }
.lobby-title { font-family: var(--font-display); font-size: clamp(38px, 9vw, 66px); margin: 0; font-weight: 700;
  color: #fff; letter-spacing: 0.5px; text-shadow: 0 0 20px rgba(61,139,255,0.5); }
.lobby-sub { font-size: clamp(15px, 3.6vw, 20px); color: var(--ink-soft); margin: 2px 0 14px; font-weight: 500; }

/* אלוף מוצג */
.featured { position: relative; width: 100%; max-width: 340px; margin: 0 auto 18px; }
.featured-card { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1;
  box-shadow: var(--shadow); border: 3px solid var(--rare); background: #0B0F26; }
.featured-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured-card.animate img { animation: floaty 4s ease-in-out infinite; }
@keyframes floaty { 0%,100%{transform:scale(1.02) translateY(0)} 50%{transform:scale(1.02) translateY(-8px)} }
.featured-name { position: absolute; bottom: 10px; right: 10px; left: 10px; display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to top, rgba(6,9,24,0.92), rgba(6,9,24,0)); padding: 26px 12px 8px; }
.featured-name .fn-name { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: #fff; }
.rarity-tag { font-family: var(--font-display); font-size: 13px; font-weight: 700; padding: 3px 12px; border-radius: 12px; color: #0B0F26; }
.r-common { background: var(--common); } .r-rare { background: var(--rare); } .r-epic { background: var(--epic); } .r-legendary { background: var(--legendary); }
.featured-hint { color: var(--ink-soft); font-size: 15px; margin: 8px 0 0; font-weight: 500; }
.next-bar { height: 10px; border-radius: 6px; background: rgba(255,255,255,0.12); overflow: hidden; margin: 10px auto 0; max-width: 300px; }
.next-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 6px; transition: width 0.4s ease; }

/* מצבי משחק */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; margin-top: 6px; }
@media (max-width: 520px) { .mode-grid { grid-template-columns: 1fr; } }
.mode-card { position: relative; display: flex; align-items: center; gap: 14px; padding: 20px 18px; border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(10px);
  cursor: pointer; overflow: hidden; text-align: right; transition: transform 0.16s cubic-bezier(0.34,1.56,0.64,1); }
.mode-card:active { transform: scale(0.96); }
.mode-badge { width: 58px; height: 58px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 30px; flex-shrink: 0; box-shadow: var(--shadow-soft); }
.mode-explorer .mode-badge { background: linear-gradient(150deg, #3D8BFF, #7A5CFF); }
.mode-learner .mode-badge { background: linear-gradient(150deg, #35D08A, #24A0C8); }
.mode-text { display: flex; flex-direction: column; }
.mode-name { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--ink); }
.mode-desc { font-size: 14px; color: var(--ink-soft); font-weight: 500; }

.lobby-foot { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; }
.pill-btn { display: inline-flex; align-items: center; gap: 9px; height: 54px; padding: 0 10px 0 20px;
  border: 1px solid rgba(255,255,255,0.10); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px); font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--ink); cursor: pointer; transition: transform 0.15s ease; }
.pill-btn:active { transform: scale(0.95); }
.pill-btn .pill-ico { width: 24px; height: 24px; color: var(--accent); }
.pill-count { background: var(--gold); color: #2A1E00; font-size: 15px; font-weight: 700; padding: 2px 11px; border-radius: 12px; }

/* ===== כפתור PLAY בלובי ===== */
.play-btn { display: flex; align-items: center; gap: 14px; width: 100%; margin: 0 0 16px; padding: 16px 18px;
  border: none; border-radius: var(--radius); cursor: pointer; text-align: right; overflow: hidden; position: relative;
  background: linear-gradient(120deg, #3D8BFF, #7A5CFF); box-shadow: var(--shadow), 0 0 26px rgba(61,139,255,0.4);
  transition: transform 0.16s cubic-bezier(0.34,1.56,0.64,1); }
.play-btn:active { transform: scale(0.97); }
.play-dice { font-size: 40px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35)); animation: dicebob 2.4s ease-in-out infinite; }
@keyframes dicebob { 0%,100%{transform:rotate(-6deg)} 50%{transform:rotate(6deg)} }
.play-text { flex: 1; display: flex; flex-direction: column; }
.play-name { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: #fff; }
.play-desc { font-size: 14px; color: rgba(255,255,255,0.85); font-weight: 500; }
.play-go { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: #21306a; background: #fff; padding: 8px 20px; border-radius: 14px; box-shadow: var(--shadow-soft); }

/* ===== משחק הלוח ===== */
.board-area { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 84px 14px 22px; width: 100%; max-width: 520px; margin: 0 auto; }
.board-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: #fff; margin: 0; text-shadow: 0 0 14px rgba(61,139,255,0.4); }
.board-wrap { position: relative; width: 100%; }
.board { position: relative; width: 100%; aspect-ratio: 6 / 5; background: var(--panel); border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.board-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.tile { position: absolute; box-sizing: border-box; border: 1px solid rgba(255,255,255,0.06); display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 3px 4px; font-size: 11px; font-weight: 700; color: var(--ink-soft); background: rgba(255,255,255,0.015); }
.tile:nth-child(even) { background: rgba(255,255,255,0.05); }
.tile.ladder { background: rgba(53,208,138,0.16); }
.tile.snake { background: rgba(255,107,107,0.16); }
.tile .tmark { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; opacity: 0.9; }
.tile.goal { background: rgba(245,179,1,0.22); border-color: var(--gold); }
.token { position: absolute; width: 15%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 2px solid #fff;
  box-shadow: var(--glow), 0 4px 10px rgba(0,0,0,0.4); z-index: 5; transform: translate(-50%,-50%);
  transition: left 0.26s ease, top 0.26s ease; }
.token img { width: 100%; height: 100%; object-fit: cover; }
.board-toolbar { display: flex; align-items: center; justify-content: center; gap: 16px; width: 100%; }
.die { width: 78px; height: 78px; border-radius: 20px; border: none; cursor: pointer; font-size: 52px; line-height: 78px; color: #21306a;
  background: linear-gradient(150deg, #fff, #dfe6ff); box-shadow: var(--shadow), 0 0 20px rgba(61,139,255,0.35); transition: transform 0.12s ease; }
.die:active { transform: scale(0.92); }
.die.rolling { animation: diroll 0.5s ease; }
@keyframes diroll { 0%,100%{transform:rotate(0) scale(1)} 25%{transform:rotate(-18deg) scale(1.08)} 75%{transform:rotate(18deg) scale(1.08)} }
.die[disabled] { opacity: 0.55; cursor: default; }
.board-status { font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--ink); min-width: 120px; text-align: center; }
.board-replay { border: none; border-radius: 16px; background: linear-gradient(150deg, var(--good), #24A0C8); color: #06231a; font-family: var(--font-display); font-size: 19px; font-weight: 700; padding: 12px 28px; cursor: pointer; }

/* ===== משחקי 1/2 שחקנים ===== */
.game2-area { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 84px 14px 22px; width: 100%; max-width: 560px; margin: 0 auto; }
.game-title { font-family: var(--font-display); font-size: 23px; font-weight: 700; color: #fff; margin: 0; text-shadow: 0 0 14px rgba(61,139,255,0.4); }
.game-status { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--ink); min-height: 26px; text-align: center; }
.turn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--ink); }
.turn .who { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; border: 2px solid var(--accent); }
.turn .who img { width: 100%; height: 100%; object-fit: cover; }
.game-replay { border: none; border-radius: 16px; background: linear-gradient(150deg, var(--good), #24A0C8); color: #06231a; font-family: var(--font-display); font-size: 18px; font-weight: 700; padding: 11px 26px; cursor: pointer; }

/* בורר שחקנים */
.chooser { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.chooser h3 { font-family: var(--font-display); font-size: 26px; color: #fff; margin: 0; }
.chooser-row { display: flex; gap: 16px; }
.chooser-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 130px; padding: 22px 10px; border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(8px); cursor: pointer; transition: transform 0.15s ease; }
.chooser-btn:active { transform: scale(0.95); }
.chooser-btn .cb-ico { font-size: 42px; }
.chooser-btn .cb-label { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--ink); }

/* איקס-עיגול */
.ttt-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(86vw, 350px); aspect-ratio: 1; }
.ttt-cell { background: var(--panel); border: 1px solid rgba(255,255,255,0.10); border-radius: 16px; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; }
.ttt-cell img { width: 84%; height: 84%; object-fit: cover; border-radius: 12px; animation: popIn 0.3s ease; }
.ttt-cell.win { box-shadow: 0 0 0 3px var(--gold) inset, var(--glow-gold); }

/* זיכרון */
.mem-grid { display: grid; gap: 9px; width: 100%; max-width: 460px; }
.mem-card { position: relative; aspect-ratio: 1; border-radius: 14px; cursor: pointer; }
.mem-card .mem-back, .mem-card .mem-front { position: absolute; inset: 0; border-radius: 14px; overflow: hidden; transition: opacity 0.2s ease; }
.mem-card .mem-back { background: linear-gradient(150deg, #3D8BFF, #7A5CFF); display: flex; align-items: center; justify-content: center; font-size: 30px; border: 1px solid rgba(255,255,255,0.15); }
.mem-card .mem-front { opacity: 0; border: 2px solid rgba(255,255,255,0.18); }
.mem-card .mem-front img { width: 100%; height: 100%; object-fit: cover; }
.mem-card.flipped .mem-front, .mem-card.matched .mem-front { opacity: 1; }
.mem-card.flipped .mem-back, .mem-card.matched .mem-back { opacity: 0; }
.mem-card.matched .mem-front { border-color: var(--good); box-shadow: 0 0 14px rgba(53,208,138,0.5); }

/* 4 בשורה */
.c4-board { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; background: #131a44; padding: 6px; border-radius: 16px; width: min(94vw, 420px); box-shadow: var(--shadow); }
.c4-col { display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.c4-slot { aspect-ratio: 1; border-radius: 50%; background: rgba(0,0,0,0.34); overflow: hidden; }
.c4-slot img { width: 100%; height: 100%; object-fit: cover; animation: popIn 0.28s ease; }
.c4-slot.win { box-shadow: 0 0 0 3px var(--gold) inset, var(--glow-gold); }

/* ===== תפריטים ===== */
.menu-inner { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 88px 22px 28px; overflow-y: auto; }
.menu-title { font-family: var(--font-display); font-size: clamp(28px, 7vw, 44px); color: #fff; margin: 0 0 22px; font-weight: 700; text-shadow: 0 0 16px rgba(61,139,255,0.4); }
.activity-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; width: 100%; max-width: 720px; }
.activity-card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 26px 12px;
  border: 1px solid rgba(255,255,255,0.10); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow);
  backdrop-filter: blur(10px); cursor: pointer; min-height: 150px; justify-content: center; transition: transform 0.16s cubic-bezier(0.34,1.56,0.64,1); position: relative; overflow: hidden; }
.activity-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 60%; opacity: 0.5; }
.activity-card.c1::before { background: radial-gradient(100% 100% at 50% 0, rgba(61,139,255,0.45), transparent 70%); }
.activity-card.c2::before { background: radial-gradient(100% 100% at 50% 0, rgba(122,92,255,0.45), transparent 70%); }
.activity-card.c3::before { background: radial-gradient(100% 100% at 50% 0, rgba(53,208,138,0.45), transparent 70%); }
.activity-card.c4::before { background: radial-gradient(100% 100% at 50% 0, rgba(245,179,1,0.4), transparent 70%); }
.activity-card:active { transform: scale(0.95); }
.act-emoji { font-size: 50px; position: relative; }
.act-name { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--ink); position: relative; }

/* ===== רוסטר ===== */
.coll-hint { color: var(--ink-soft); font-size: 16px; margin: -10px 0 20px; font-weight: 500; }
.roster-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; width: 100%; max-width: 700px; }
.champ { position: relative; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; background: #0B0F26;
  border: 2px solid var(--common); box-shadow: var(--shadow-soft); }
.champ.r-common { border-color: var(--common); } .champ.r-rare { border-color: var(--rare); }
.champ.r-epic { border-color: var(--epic); box-shadow: 0 0 16px rgba(166,92,255,0.4); }
.champ.r-legendary { border-color: var(--legendary); box-shadow: var(--glow-gold); }
.champ img { width: 100%; height: 100%; object-fit: cover; display: block; }
.champ .champ-name { position: absolute; bottom: 0; right: 0; left: 0; font-family: var(--font-display); font-weight: 700; font-size: 15px;
  color: #fff; background: linear-gradient(to top, rgba(6,9,24,0.9), transparent); padding: 18px 6px 6px; text-align: center; }
.champ.locked img { filter: brightness(0.12) grayscale(1); }
.champ.locked::after { content: "?"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 46px; font-weight: 700; color: rgba(255,255,255,0.5); }
.champ.locked .champ-name { display: none; }
.champ.just-won { animation: bump 0.6s cubic-bezier(0.34,1.56,0.64,1); }

/* ===== מיכל פעילות ===== */
.activity-screen { align-items: stretch; }
.game-area { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 92px 20px 28px; width: 100%; max-width: 840px; margin: 0 auto; }

/* מגע וקסם */
.sensory-board { flex: 1; position: relative; overflow: hidden; cursor: pointer; z-index: 2; }
.hint { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center;
  font-size: 20px; color: var(--ink-soft); pointer-events: none; transition: opacity 0.6s ease; font-weight: 500; z-index: 3; }
.spawn { position: absolute; transform: translate(-50%,-50%) scale(0.2); width: 130px; height: 130px; border-radius: 22px; overflow: hidden;
  pointer-events: none; box-shadow: var(--shadow), var(--glow); border: 2px solid rgba(255,255,255,0.2); animation: pop 2.3s ease forwards; }
.spawn img { width: 100%; height: 100%; object-fit: cover; }
@keyframes pop { 0%{transform:translate(-50%,-50%) scale(0.2);opacity:0} 16%{transform:translate(-50%,-50%) scale(1.06);opacity:1} 70%{transform:translate(-50%,-50%) scale(1);opacity:1} 100%{transform:translate(-50%,-58%) scale(0.92);opacity:0} }
.ripple { position: absolute; transform: translate(-50%,-50%); border-radius: 50%; pointer-events: none;
  border: 3px solid rgba(61,139,255,0.6); animation: ripple 1s ease-out forwards; }
@keyframes ripple { from { width: 20px; height: 20px; opacity: 0.8; } to { width: 240px; height: 240px; opacity: 0; } }
.sparkle { position: absolute; transform: translate(-50%,-50%); font-size: 24px; color: var(--gold); pointer-events: none; animation: sparkleFloat 1.1s ease-out forwards; }
@keyframes sparkleFloat { 0%{opacity:0;transform:translate(-50%,-50%) scale(0.3)} 30%{opacity:1} 100%{opacity:0;transform:translate(var(--dx,-50%),var(--dy,-120%)) scale(0.9)} }

/* AAC */
.aac-grid { flex: 1; display: grid; gap: 14px; padding: 92px 16px 22px; grid-template-columns: repeat(4, 1fr); align-content: center; max-width: 920px; margin: 0 auto; width: 100%; }
@media (max-width: 680px) { .aac-grid { grid-template-columns: repeat(2, 1fr); } }
.aac-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-soft); backdrop-filter: blur(8px);
  padding: 20px 8px; cursor: pointer; min-height: 128px; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.aac-card:active, .aac-card.speaking { transform: scale(1.06); box-shadow: var(--glow); }
.aac-emoji { font-size: 50px; }
.aac-label { font-family: var(--font-display); font-size: 21px; font-weight: 600; color: var(--ink); }

/* משחקים */
.prompt { font-family: var(--font-display); font-size: clamp(22px, 5.2vw, 34px); font-weight: 600; color: #fff; text-align: center; margin: 0; text-shadow: 0 0 14px rgba(61,139,255,0.35); }
.big-face { font-size: clamp(110px, 28vw, 190px); line-height: 1; animation: bobface 3s ease-in-out infinite; }
@keyframes bobface { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
.card-img { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 3px solid rgba(255,255,255,0.14); background: #0B0F26; }
.card-img img { display: block; object-fit: cover; }
.big-target { width: clamp(150px, 40vw, 220px); aspect-ratio: 1; }
.big-target img { width: 100%; height: 100%; }
.big-letter { font-family: var(--font-display); font-size: clamp(88px, 22vw, 150px); font-weight: 700; color: #fff; line-height: 1.05;
  background: var(--panel); border: 3px solid rgba(255,255,255,0.14); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(8px); padding: 6px 40px; }

/* ===== אותיות (אלף-בית נגיש) ===== */
[data-screen="act-letters"] .game-area { justify-content: flex-start; overflow-y: auto; }
.letter-display { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.letter-big { font-family: var(--font-display); font-size: clamp(84px, 24vw, 150px); font-weight: 700; color: #fff; line-height: 1;
  background: var(--panel); border: 3px solid rgba(255,255,255,0.16); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(8px);
  padding: 6px 46px; cursor: pointer; transition: transform 0.15s ease; }
.letter-big:active { transform: scale(0.96); }
.letter-word { display: inline-flex; align-items: center; gap: 10px; border: none; background: transparent; cursor: pointer;
  font-family: var(--font-display); font-size: clamp(24px, 6vw, 34px); font-weight: 600; color: var(--ink); }
.letter-word .lw-emoji { font-size: 1.4em; }
.letter-speak { width: 62px; height: 62px; border-radius: 50%; border: none; background: linear-gradient(150deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 30px; cursor: pointer; box-shadow: var(--shadow), var(--glow); transition: transform 0.15s ease; }
.letter-speak:active { transform: scale(0.92); }
.letter-nav { display: flex; align-items: center; justify-content: center; gap: 14px; }
.letter-arrow { border: 1px solid rgba(255,255,255,0.12); border-radius: 14px; background: var(--panel); color: var(--ink);
  font-family: var(--font-display); font-weight: 600; font-size: 18px; padding: 9px 20px; cursor: pointer; }
.letter-arrow:active { transform: scale(0.95); }
.letter-count { font-family: var(--font-display); color: var(--ink-soft); font-size: 16px; min-width: 66px; text-align: center; }
.letter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 8px; width: 100%; max-width: 520px; }
.letter-tile { aspect-ratio: 1; border: 1px solid rgba(255,255,255,0.10); border-radius: 12px; background: var(--panel); color: var(--ink);
  font-family: var(--font-display); font-weight: 700; font-size: 24px; cursor: pointer; transition: transform 0.12s ease; }
.letter-tile:active { transform: scale(0.9); }
.letter-tile.active { background: linear-gradient(150deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: var(--glow); }
.choice-row { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.choice { border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px); cursor: pointer; padding: 0; overflow: hidden; transition: transform 0.15s ease; }
.choice:active { transform: scale(0.95); }
.choice.img-choice { width: clamp(120px, 30vw, 160px); aspect-ratio: 1; }
.choice.img-choice img { width: 100%; height: 100%; object-fit: cover; display: block; }
.choice.text-choice { font-family: var(--font-display); font-size: clamp(22px, 5vw, 30px); font-weight: 600; color: var(--ink); padding: 22px 30px; min-width: 110px; text-align: center; }
.choice.correct { box-shadow: 0 0 0 4px var(--good) inset, var(--glow); animation: bump 0.5s cubic-bezier(0.34,1.56,0.64,1); }
.choice.wrong { animation: shake 0.4s ease; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)} }
.bins { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.count-objects { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 600px; }
.count-objects .count-tile { width: clamp(64px, 16vw, 92px); aspect-ratio: 1; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-soft); border: 2px solid rgba(255,255,255,0.12); animation: popIn 0.35s ease backwards; }
.count-objects .count-tile img { width: 100%; height: 100%; object-fit: cover; }
@keyframes popIn { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ===== "נסה שוב" ===== */
.retry-toast { position: fixed; left: 50%; bottom: calc(30px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 68;
  background: var(--panel-solid); border: 1px solid rgba(255,255,255,0.14); color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 20px;
  padding: 12px 26px; border-radius: 20px; box-shadow: var(--shadow); animation: retryPop 1.4s ease forwards; pointer-events: none; }
@keyframes retryPop { 0%{opacity:0;transform:translateX(-50%) translateY(12px) scale(0.9)} 15%{opacity:1;transform:translateX(-50%) translateY(0) scale(1)} 80%{opacity:1} 100%{opacity:0;transform:translateX(-50%) translateY(-6px)} }

/* ===== חיזוק ===== */
.reward-overlay { position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center; background: rgba(8, 12, 30, 0.55); backdrop-filter: blur(4px); }
.reward-overlay.show { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.reward-card { display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.reward-emoji { font-size: 92px; animation: reward 1.2s ease forwards; }
@keyframes reward { 0%{transform:scale(0.3) rotate(-10deg);opacity:0} 30%{transform:scale(1.2) rotate(6deg);opacity:1} 70%{transform:scale(1);opacity:1} 100%{transform:scale(1.1);opacity:0} }
.reward-text { font-family: var(--font-display); font-size: 34px; font-weight: 700; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.6); }

.unlock-overlay { background: rgba(8,12,30,0.72); backdrop-filter: blur(6px); }
.unlock-card { background: var(--panel-solid); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius); box-shadow: var(--shadow), var(--glow-gold);
  padding: 26px 28px; pointer-events: auto; max-width: 340px; text-align: center; }
.unlock-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--gold); margin-bottom: 14px; text-shadow: var(--glow-gold); }
.unlock-champ { width: 200px; height: 200px; max-width: 62vw; border-radius: var(--radius); overflow: hidden; margin: 0 auto; border: 3px solid var(--gold); box-shadow: var(--glow-gold); animation: unlockPop 0.6s cubic-bezier(0.34,1.56,0.64,1); }
.unlock-champ img { width: 100%; height: 100%; object-fit: cover; }
@keyframes unlockPop { 0%{transform:scale(0.4);opacity:0} 100%{transform:scale(1);opacity:1} }
.unlock-name { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: #fff; margin: 12px 0 4px; }
.unlock-rarity { margin-bottom: 16px; }

/* ===== מודלים ===== */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; background: rgba(6, 9, 22, 0.66); padding: 20px; }
.modal-backdrop.show { display: flex; animation: fadeIn 0.2s ease; }
.modal { background: var(--panel-solid); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 24px; width: 100%; max-width: 420px; text-align: center; animation: modalIn 0.28s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes modalIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { font-family: var(--font-display); margin: 0 0 16px; font-size: 25px; color: #fff; }
.gate-q { font-size: 23px; font-weight: 600; margin: 0 0 10px; color: var(--ink); }
.gate-answer { font-family: var(--font-display); font-size: 32px; font-weight: 700; min-height: 42px; margin-bottom: 12px; letter-spacing: 4px; color: var(--accent); }
.gate-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.gate-pad button { border: 1px solid rgba(255,255,255,0.10); border-radius: 14px; background: rgba(255,255,255,0.06); font-family: var(--font-display); font-size: 25px; font-weight: 600; padding: 15px 0; cursor: pointer; color: var(--ink); }
.gate-pad button:active { transform: scale(0.95); }
.modal-close { border: none; border-radius: 16px; background: linear-gradient(150deg, var(--accent), var(--accent-2)); color: #fff; font-family: var(--font-display); font-size: 20px; font-weight: 600; padding: 13px 40px; cursor: pointer; margin-top: 6px; }
.modal-close.ghost-btn { background: transparent; color: var(--ink-soft); }
.settings-panel { max-width: 460px; text-align: right; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 4px; border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 19px; font-weight: 500; color: var(--ink); }
.setting-row input[type="checkbox"] { width: 28px; height: 28px; accent-color: var(--accent); }
.setting-row input[type="range"] { width: 150px; accent-color: var(--accent); }
.disclaimer { font-size: 14px; color: var(--ink-soft); line-height: 1.5; margin: 16px 4px 6px; background: rgba(255,255,255,0.05); border-radius: 12px; padding: 12px 14px; text-align: center; }
