/* מבצע מענה — חאקי, נייר טפסים, חותמות */
:root {
  --night: #1b1d15;
  --olive-900: #22251a;
  --olive-800: #2c3122;
  --olive-700: #3c4428;
  --olive-500: #5f6c3b;
  --olive-300: #8e9a62;
  --sand-300: #d7c290;
  --sand-200: #e9dfc2;
  --paper: #f5efdd;
  --paper-2: #ece3c8;
  --ink: #1f1d17;
  --ink-soft: #4a4636;
  --stamp: #c0362c;
  --stamp-blue: #2b4f9e;
  --brass: #e2bf4a;
  --good: #7ccf7a;
  --warn: #ff9f6b;
  --sky: #8fc6e4;
  --r: 14px;
  --font: 'Rubik', system-ui, sans-serif;
  --display: 'Karantina', 'Rubik', sans-serif;
  --form: 'Frank Ruhl Libre', 'David', serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { color-scheme: dark; margin: 0; height: 100%; background: var(--night); color: var(--sand-200); font-family: var(--font); overscroll-behavior: none; }
body { overflow: hidden; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }
.hidden { display: none !important; }

/* ===== מסכים ===== */
.screen { position: fixed; inset: 0; display: none; }
.screen.active { display: block; }
#home.active, #lobby.active { overflow-y: auto; -webkit-overflow-scrolling: touch; }

#home, #lobby {
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(226, 191, 74, 0.10), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.018) 0 2px, transparent 2px 10px),
    linear-gradient(180deg, #23271b, #171912);
}
.home-wrap, .lobby-wrap { max-width: 520px; margin: 0 auto; padding: calc(18px + var(--safe-t)) 16px calc(28px + var(--safe-b)); }

.brand { text-align: center; margin: 10px 0 18px; }
.brand-kicker { display: inline-block; font-size: 13px; letter-spacing: .08em; color: var(--olive-300); border: 1px solid var(--olive-700); border-radius: 99px; padding: 3px 12px; }
.brand h1 { font-family: var(--display); font-weight: 700; font-size: 84px; line-height: .78; margin: 14px 0 6px; color: var(--sand-200); letter-spacing: .01em; text-shadow: 0 3px 0 #0e0f0a; }
.brand h1 span { color: var(--brass); font-size: 112px; display: inline-block; transform: rotate(-3deg); position: relative; }
.brand h1 span::after { content: 'מאושר'; position: absolute; font-family: var(--display); font-size: 26px; color: var(--stamp); border: 3px solid var(--stamp); border-radius: 6px; padding: 0 8px; left: -46px; top: 18px; transform: rotate(-14deg); opacity: .85; letter-spacing: .05em; }
.brand-sub { color: var(--olive-300); margin: 6px 0 0; font-size: 15px; }

.panel { background: linear-gradient(180deg, rgba(60,68,40,.55), rgba(44,49,34,.55)); border: 1px solid rgba(142,154,98,.22); border-radius: var(--r); padding: 14px; margin-bottom: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.lbl { font-size: 13px; color: var(--olive-300); margin: 4px 0 6px; font-weight: 600; }
.hint { font-size: 13px; color: var(--olive-300); margin: 8px 0 0; line-height: 1.45; }
.error { color: var(--warn); min-height: 1.2em; margin-top: 8px; font-size: 14px; }

input, textarea {
  width: 100%; background: rgba(0,0,0,.28); border: 1px solid rgba(142,154,98,.35); color: var(--sand-200);
  border-radius: 10px; padding: 11px 12px; font-size: 16px; outline: none;
}
input:focus, textarea:focus { border-color: var(--brass); }

.btn {
  border: 1px solid rgba(142,154,98,.45); background: var(--olive-700); color: var(--sand-200); border-radius: 12px;
  padding: 12px 16px; font-size: 16px; font-weight: 600; transition: transform .08s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brass); color: #2a2412; border-color: #f2d775; box-shadow: 0 4px 0 #9b7f22; }
.btn.primary:active { box-shadow: 0 1px 0 #9b7f22; transform: translateY(3px); }
.btn.big { width: 100%; padding: 16px; font-size: 19px; margin-top: 10px; }
.btn.small { padding: 8px 12px; font-size: 14px; }
.btn.ghost { background: transparent; }
.link-btn { background: none; border: none; color: var(--olive-300); font-size: 15px; padding: 8px 0; text-decoration: underline; text-underline-offset: 4px; }
.link-btn.center { display: block; margin: 8px auto; }

.me-row { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.me-fields { flex: 1; }
.portrait-btn { width: 92px; height: 92px; border-radius: 16px; border: 2px solid var(--brass); background: radial-gradient(circle at 50% 30%, #4b5530, #262a1c); padding: 0; overflow: hidden; flex: none; }
.portrait-btn img, img.px { image-rendering: pixelated; width: 100%; height: 100%; display: block; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid rgba(142,154,98,.45); background: rgba(0,0,0,.2); color: var(--sand-200); border-radius: 99px;
  padding: 7px 14px; font-size: 15px; font-weight: 600;
}
.chip.on { background: var(--olive-500); border-color: var(--brass); color: #fff; }

.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; max-height: 260px; overflow-y: auto; margin-bottom: 8px; }
.roster button { background: rgba(0,0,0,.22); border: 1px solid rgba(142,154,98,.25); border-radius: 12px; padding: 6px 4px; color: var(--sand-200); font-size: 12px; }
.roster button img { width: 54px; height: 54px; image-rendering: pixelated; display: block; margin: 0 auto 4px; }
.roster button.on { border-color: var(--brass); background: rgba(226,191,74,.15); }
.roster button.taken { opacity: .35; }

.join-row { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.join-row .or { text-align: center; color: var(--olive-300); font-size: 13px; }
.code-join { display: flex; gap: 8px; }
.code-join input { text-align: center; letter-spacing: .3em; font-size: 20px; font-weight: 700; }

/* ===== לובי ===== */
.lobby-head { display: flex; justify-content: space-between; align-items: end; margin: 6px 0 14px; }
.room-code { font-family: var(--display); font-size: 64px; line-height: .8; color: var(--brass); letter-spacing: .08em; }
.lobby-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; margin-bottom: 8px; }
.lp { text-align: center; font-size: 13px; position: relative; }
.lp img { width: 64px; height: 64px; image-rendering: pixelated; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px solid rgba(142,154,98,.3); }
.lp .host-badge { position: absolute; top: -4px; right: 8px; font-size: 16px; }
.lp .team { display: inline-block; font-size: 11px; color: var(--olive-300); }
.lp.off { opacity: .4; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0; }
.setting > span { font-size: 14px; color: var(--sand-300); }
.waiting { text-align: center; color: var(--olive-300); padding: 10px; animation: pulse 1.6s infinite; }
.rules summary { font-weight: 700; cursor: pointer; }
.rules ul { margin: 10px 0 0; padding-inline-start: 18px; line-height: 1.55; font-size: 14px; color: var(--sand-300); }
.rules li { margin-bottom: 6px; }

/* ===== משחק ===== */
#game { background: #2b2a22; touch-action: none; user-select: none; -webkit-user-select: none; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#joyzone { position: absolute; left: 0; bottom: 0; width: 60%; height: 72%; }

.hud-top { position: absolute; top: calc(8px + var(--safe-t)); left: 8px; right: 8px; display: flex; gap: 8px; align-items: flex-start; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.clock-box { background: rgba(20,22,15,.82); border: 1px solid rgba(226,191,74,.35); border-radius: 12px; padding: 4px 10px 6px; min-width: 82px; }
.clock { font-family: var(--display); font-size: 34px; line-height: 1; color: var(--brass); letter-spacing: .04em; text-align: center; }
.day-bar { height: 4px; background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; margin-top: 2px; }
.day-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brass), var(--stamp)); }
.status { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; }
.st { background: rgba(20,22,15,.8); border: 1px solid rgba(142,154,98,.3); border-radius: 99px; padding: 3px 8px; font-size: 13px; white-space: nowrap; }
.st.bad { border-color: rgba(255,120,90,.7); color: #ffb39b; }
.st.ok { border-color: rgba(124,207,122,.5); color: #b9efb7; }
.st.hot { background: rgba(192,54,44,.85); border-color: #ff8e7d; color: #fff; animation: pulse 1.2s infinite; }
.hud-btns { display: flex; gap: 6px; flex-direction: column; }
.hud-btn { width: 44px; height: 44px; border-radius: 12px; background: rgba(20,22,15,.82); border: 1px solid rgba(142,154,98,.35); font-size: 20px; position: relative; color: #fff; }
.hud-btn.off { opacity: .5; }
.hud-btn.live { border-color: var(--good); box-shadow: 0 0 0 2px rgba(124,207,122,.25); }
.badge { position: absolute; top: -5px; left: -5px; background: var(--stamp); color: #fff; font-size: 11px; border-radius: 99px; padding: 1px 6px; font-style: normal; }

.objective { position: absolute; top: calc(66px + var(--safe-t)); left: 50%; transform: translateX(-50%); background: rgba(20,22,15,.85); border: 1px solid var(--brass); color: var(--brass); padding: 5px 14px; border-radius: 99px; font-weight: 700; font-size: 14px; white-space: nowrap; pointer-events: none; max-width: 80vw; overflow: hidden; text-overflow: ellipsis; }
.objective.urgent { border-color: var(--stamp); color: #fff; background: rgba(192,54,44,.9); animation: pulse 1s infinite; }

/* מה שקורה בבסיס: בצד ימין מעל כפתור ההצדעה — לא מתחת לאגודל של הג'ויסטיק */
.feed { position: absolute; right: 8px; bottom: calc(188px + var(--safe-b)); width: min(64vw, 300px); pointer-events: none; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.feed div { background: rgba(20,22,15,.8); border-radius: 8px; padding: 5px 9px; font-size: 13px; line-height: 1.35; color: var(--sand-200); animation: fadeOut 11s forwards; }

/* left: 60px — לא מסתירים את עמודת הכפתורים. כשיש הודעה גדולה, JS מוריד את הטוסטים מתחתיה */
.toasts { position: absolute; top: calc(104px + var(--safe-t)); left: 60px; right: 8px; max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; pointer-events: none; z-index: 5; transition: top .2s ease-out; }
.toast { background: rgba(245,239,221,.96); color: var(--ink); border-radius: 12px; padding: 8px 11px; font-size: 14px; line-height: 1.35; font-weight: 500; box-shadow: 0 6px 18px rgba(0,0,0,.35); border-inline-start: 5px solid var(--olive-500); animation: toastIn .25s ease-out, fadeOut 5.5s forwards; }
.toast.warn { border-color: var(--stamp); }
.toast.good { border-color: #4caa52; }
.toast.task { border-color: var(--brass); }

.action-btn {
  position: absolute; right: 14px; bottom: calc(22px + var(--safe-b)); min-width: 132px; max-width: 46vw; min-height: 74px;
  border-radius: 22px; border: 2px solid #f2d775; background: var(--brass); color: #2a2412; font-size: 16px; font-weight: 800;
  padding: 10px 14px; box-shadow: 0 5px 0 #8a6f1b, 0 10px 24px rgba(0,0,0,.35); overflow: hidden; line-height: 1.2;
}
.action-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #8a6f1b; }
.action-btn.passive { background: rgba(20,22,15,.85); color: var(--sand-200); border-color: rgba(142,154,98,.5); box-shadow: none; }
.action-btn.disabled { opacity: .55; }
.salute-btn {
  position: absolute; right: 18px; bottom: calc(118px + var(--safe-b)); width: 56px; height: 56px; border-radius: 50%;
  background: rgba(20,22,15,.82); border: 2px solid rgba(226,191,74,.55); font-size: 28px; line-height: 1; padding: 0;
  box-shadow: 0 6px 16px rgba(0,0,0,.35); z-index: 3;
}
.salute-btn:active { transform: scale(.94); }
.salute-btn.officer { border-color: var(--brass); background: rgba(226,191,74,.22); animation: pulse 1.1s infinite; }
.salute-btn.cool { opacity: .5; }
.action-btn i { position: absolute; left: 0; bottom: 0; height: 5px; background: var(--good); width: 0; }
.hud-btn.host-skip[data-armed] { background: rgba(192,54,44,.9); border-color: #ff8e7d; }

.joy-base { position: fixed; width: 116px; height: 116px; margin: -58px 0 0 -58px; border-radius: 50%; background: rgba(245,239,221,.08); border: 2px solid rgba(245,239,221,.25); display: none; pointer-events: none; z-index: 4; }
.joy-base.on { display: block; }
.joy-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; border-radius: 50%; background: rgba(226,191,74,.85); box-shadow: 0 4px 10px rgba(0,0,0,.4); transform: translate(-50%,-50%); }

/* ===== הודעה גדולה ===== */
/* למעלה, בעמודה אחת עם הטוסטים — מרכז המסך (השחקן) נשאר פנוי */
.announce { position: fixed; top: calc(100px + var(--safe-t)); left: 8px; right: 8px; max-width: 520px; margin: 0 auto; z-index: 20; pointer-events: none; text-align: center; }
body:has(#game.active) .announce { left: 60px; }
.announce-text { background: rgba(245,239,221,.97); color: var(--ink); font-weight: 700; font-size: 18px; padding: 12px 16px; border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.45); border: 3px solid var(--olive-500); animation: popIn .3s ease-out; line-height: 1.35; }
.announce.alarm .announce-text { background: var(--stamp); color: #fff; border-color: #ffd2c8; font-family: var(--display); font-size: 32px; line-height: 1.05; padding: 14px 16px 10px; animation: popIn .3s ease-out, shake .5s .3s; }
.announce.big .announce-text { font-size: 21px; border-color: var(--brass); }
.announce-timer { height: 6px; margin: 8px auto 0; width: 70%; border-radius: 6px; background: rgba(0,0,0,.35); overflow: hidden; }
.announce-timer i { display: block; height: 100%; width: 100%; background: #fff; transform-origin: left; }
body.alarm::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 19; box-shadow: inset 0 0 0 6px rgba(192,54,44,.85); animation: pulse .8s infinite; }

/* ===== ערני ===== */
.alert-qte { position: fixed; inset: 0; z-index: 40; background: rgba(10,10,8,.55); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.alert-car { font-size: 64px; animation: drive 1.2s ease-out; }
.alert-text { font-family: var(--display); font-size: 40px; color: #fff; text-shadow: 0 2px 0 #000; }
.alert-btn { font-size: 34px; font-weight: 900; padding: 22px 40px; border-radius: 26px; border: 3px solid #fff; background: var(--stamp); color: #fff; box-shadow: 0 8px 0 #7d1e17; animation: pulse .6s infinite; }
.alert-timer { width: 60vw; max-width: 300px; height: 8px; background: rgba(255,255,255,.2); border-radius: 8px; overflow: hidden; }
.alert-timer i { display: block; height: 100%; background: #fff; width: 100%; }

/* ===== בקשה ===== */
.request { position: fixed; left: 50%; bottom: calc(110px + var(--safe-b)); transform: translateX(-50%); z-index: 30; width: min(92vw, 380px); background: var(--paper); color: var(--ink); border-radius: 16px; padding: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: toastIn .25s; }
.request-text { font-weight: 700; font-size: 17px; margin-bottom: 10px; text-align: center; }
.request-actions { display: flex; gap: 8px; }
.request-actions .btn { flex: 1; }
.request .btn:not(.primary) { background: #ddd3b6; color: var(--ink); border-color: #cbbf9c; }

/* ===== שיחה ===== */
.sheet { position: fixed; inset: 0; z-index: 25; display: flex; align-items: flex-end; background: rgba(10,10,8,.35); }
.sheet-inner { width: 100%; max-width: 640px; margin: 0 auto; height: min(78vh, 720px); background: var(--paper); color: var(--ink); border-radius: 22px 22px 0 0; display: flex; flex-direction: column; box-shadow: 0 -12px 40px rgba(0,0,0,.45); animation: sheetUp .28s ease-out; padding-bottom: var(--safe-b);
  background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(43,79,158,.07) 27px 28px); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px; border-bottom: 2px dashed rgba(31,29,23,.18); }
.dlg-portrait { width: 56px; height: 56px; image-rendering: pixelated; border-radius: 12px; background: #d9cfb1; border: 2px solid #bfb393; }
.dlg-who { flex: 1; }
.dlg-name { font-family: var(--display); font-size: 32px; line-height: .9; }
.dlg-role { font-size: 13px; color: var(--ink-soft); }
.dlg-turns { display: flex; gap: 4px; }
.dlg-turns i { width: 12px; height: 12px; border-radius: 50%; background: var(--olive-500); }
.dlg-turns i.used { background: #cbbf9c; }
.icon-btn { background: none; border: none; font-size: 22px; }
.dlg-violations { margin: 8px 14px 0; background: rgba(192,54,44,.08); border: 1px solid rgba(192,54,44,.35); border-radius: 10px; padding: 6px 10px; font-size: 13px; color: #7c2018; }
.dlg-violations b { display: block; margin-bottom: 2px; }
.dlg-messages { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 14px; font-size: 16px; line-height: 1.4; animation: toastIn .2s; }
.msg.npc { align-self: flex-start; background: #fff; border: 1px solid #d8cdae; border-start-start-radius: 4px; }
.msg.player { align-self: flex-end; background: var(--olive-500); color: #fff; border-start-end-radius: 4px; }
.msg.witness { align-self: center; background: #fff5d6; border: 1px dashed #c7a845; font-size: 14px; }
.msg.system { align-self: center; color: var(--ink-soft); font-size: 13px; font-style: italic; }
.msg .who { display: block; font-size: 11px; opacity: .7; margin-bottom: 2px; font-weight: 600; }
.typing { align-self: flex-start; color: var(--ink-soft); font-size: 14px; font-style: italic; }
.typing::after { content: '...'; animation: dots 1.2s infinite; display: inline-block; width: 1.2em; text-align: start; }
.dlg-input { padding: 8px 12px 12px; border-top: 1px solid rgba(31,29,23,.12); }
.dlg-extras { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.chip-btn { border: 1px solid #cbbf9c; background: #fff; color: var(--ink); border-radius: 99px; padding: 6px 12px; font-size: 14px; font-weight: 600; }
.chip-btn.ghost { background: transparent; color: var(--ink-soft); }
.dlg-row { display: flex; gap: 8px; align-items: flex-end; }
.dlg-row textarea { flex: 1; resize: none; background: #fff; color: var(--ink); border-color: #cbbf9c; max-height: 120px; }
.send, .mic-hold { flex: none; width: 50px; height: 50px; border-radius: 50%; border: none; font-size: 22px; }
.send { background: var(--olive-500); color: #fff; transform: scaleX(-1); }
.mic-hold { background: #e8dfc4; border: 2px solid #cbbf9c; touch-action: none; }
.mic-hold.rec { background: var(--stamp); color: #fff; border-color: #ffd2c8; animation: pulse .8s infinite; }
.dlg-result { flex: 1; overflow-y: auto; padding: 14px; }
.dlg-result .effect { margin: 10px 0; background: #fff; border: 1px solid #d8cdae; border-radius: 10px; padding: 8px 10px; font-weight: 600; font-size: 14px; }
.dlg-result .btn { width: 100%; position: sticky; bottom: 0; box-shadow: 0 -8px 16px var(--paper, #f4efe0); }
#dialog.ended .dlg-messages { flex: 0 1 auto; max-height: 24%; opacity: .75; }
.dlg-result .unknown { text-align: center; padding: 18px; }
.dlg-result .unknown .big-q { font-family: var(--display); font-size: 70px; color: var(--stamp); line-height: 1; }

/* ===== טופס מענה / פטור ===== */
.card {
  position: relative; background: var(--paper); color: var(--ink); border-radius: 6px; padding: 14px 14px 12px;
  font-family: var(--form); border: 1px solid #cdbf98; box-shadow: 0 2px 0 #d9cfb2, 0 8px 22px rgba(0,0,0,.18);
  background-image: linear-gradient(transparent 0 0), repeating-linear-gradient(0deg, transparent 0 25px, rgba(43,79,158,.08) 25px 26px);
  overflow: hidden;
}
.card + .card { margin-top: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--font); font-size: 11px; color: var(--ink-soft); border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin-bottom: 8px; letter-spacing: .02em; }
.card-head b { font-weight: 800; color: var(--ink); }
.card-owner { display: flex; align-items: center; gap: 8px; font-family: var(--font); font-size: 13px; margin-bottom: 6px; }
.card-owner img { width: 34px; height: 34px; image-rendering: pixelated; border-radius: 8px; background: #ddd2b3; }
.card-title { font-size: 25px; font-weight: 900; line-height: 1.1; margin: 4px 0 6px; }
.card-diag { font-style: italic; color: var(--ink-soft); font-size: 15px; margin-bottom: 4px; }
.card-text { font-size: 17px; line-height: 1.45; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-family: var(--font); font-size: 12px; color: var(--ink-soft); margin-top: 8px; }
.card-excuse { font-family: var(--font); font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
.card-sign { font-family: var(--form); font-style: italic; text-align: left; margin-top: 8px; font-size: 14px; }
.stamp { position: absolute; left: 12px; top: 40px; font-family: var(--display); font-size: 34px; color: var(--stamp); border: 4px double var(--stamp); border-radius: 8px; padding: 2px 10px 0; transform: rotate(-14deg); opacity: .78; letter-spacing: .04em; mix-blend-mode: multiply; pointer-events: none; }
.stamp.blue { color: var(--stamp-blue); border-color: var(--stamp-blue); }
.card.animate .stamp { animation: stampIn .5s .25s both cubic-bezier(.2,1.6,.5,1); }
.card.small { padding: 10px; }
.card.small .card-title { font-size: 19px; }
.card.small .card-text { font-size: 14px; }
.card.small .stamp { font-size: 22px; top: 30px; }
.card.pickable { cursor: pointer; }
.card.picked { outline: 4px solid var(--brass); outline-offset: 2px; }

/* ===== מודלים ===== */
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(10,10,8,.65); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { background: var(--olive-800); border: 1px solid rgba(142,154,98,.35); border-radius: 18px; padding: 16px; width: min(100%, 420px); max-height: 88vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,.5); animation: popIn .22s; }
.modal-card.wide { width: min(100%, 560px); }
.modal-card h3 { font-family: var(--display); font-size: 36px; margin: 0 0 8px; font-weight: 700; color: var(--brass); }
.modal-card textarea { margin-top: 8px; }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; overflow-x: auto; }
.tab { border: 1px solid rgba(142,154,98,.35); background: transparent; color: var(--sand-300); border-radius: 99px; padding: 7px 12px; font-size: 14px; white-space: nowrap; }
.tab.active { background: var(--olive-500); color: #fff; border-color: var(--brass); }
.file-line { font-size: 14px; padding: 6px 0; border-bottom: 1px dashed rgba(142,154,98,.25); color: var(--sand-300); }
.file-line.bad { color: #ffb39b; }
.empty { color: var(--olive-300); text-align: center; padding: 20px 6px; font-size: 14px; }
#mapview { flex-direction: column; padding: 8px; background: rgba(10,10,8,.9); }
#mapcanvas { width: 100%; flex: 1; image-rendering: pixelated; }
.close-map { margin-top: 8px; }
.custom-grid { display: flex; gap: 14px; align-items: flex-start; }
#custom-preview { width: 96px; height: 144px; image-rendering: pixelated; background: radial-gradient(circle at 50% 40%, #4b5530, #23271b); border-radius: 14px; border: 2px solid var(--brass); flex: none; }
.custom-opts { flex: 1; }
.opt-row { margin-bottom: 10px; }
.opt-row .lbl { margin-top: 0; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(0,0,0,.4); }
.swatch.on { outline: 3px solid var(--brass); outline-offset: 2px; }

/* ===== ישיבה ===== */
.meeting { position: fixed; inset: 0; z-index: 35; display: flex; flex-direction: column;
  background: radial-gradient(900px 500px at 50% 0%, rgba(226,191,74,.12), transparent 60%), linear-gradient(180deg, #2a2f1f, #15170f); }
.meeting-head { padding: calc(12px + var(--safe-t)) 16px 6px; text-align: center; }
.meeting-title { font-family: var(--display); font-size: 44px; line-height: .95; color: var(--brass); }
.meeting-sub { color: var(--olive-300); font-size: 14px; }
.meeting-timer { height: 5px; background: rgba(255,255,255,.1); border-radius: 5px; overflow: hidden; margin: 8px auto 0; width: min(80%, 420px); }
.meeting-timer i { display: block; height: 100%; background: var(--brass); width: 100%; transform-origin: right; }
.meeting-body { flex: 1; overflow-y: auto; padding: 10px 14px; max-width: 640px; width: 100%; margin: 0 auto; }
.meeting-foot { padding: 10px 14px calc(12px + var(--safe-b)); max-width: 640px; width: 100%; margin: 0 auto; }
.meeting-foot .btn { width: 100%; }
.cat-title { font-weight: 800; color: var(--sand-200); margin: 14px 0 8px; font-size: 16px; }
.presenter { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.presenter img { width: 72px; height: 72px; image-rendering: pixelated; border-radius: 16px; background: rgba(0,0,0,.3); border: 2px solid var(--brass); }
.presenter .pname { font-family: var(--display); font-size: 40px; line-height: .9; }
.presenter .pcount { color: var(--olive-300); font-size: 13px; }
.reactions { display: flex; justify-content: center; gap: 8px; }
.reactions button { font-size: 30px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; width: 58px; height: 58px; }
.reactions button:active { transform: scale(1.2); }
.float-emoji { position: fixed; bottom: 120px; font-size: 38px; pointer-events: none; animation: floatUp 2.2s ease-out forwards; z-index: 50; }
.vote-note { color: var(--olive-300); font-size: 13px; text-align: center; margin: 4px 0 10px; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin: 10px 0 6px; }
.podium .pl { text-align: center; width: 30%; }
.podium .pl img { width: 60px; height: 60px; image-rendering: pixelated; }
.podium .bar { background: var(--olive-500); border-radius: 10px 10px 0 0; color: #fff; font-family: var(--display); font-size: 34px; padding-top: 6px; }
.podium .p1 .bar { height: 110px; background: var(--brass); color: #2a2412; }
.podium .p2 .bar { height: 80px; }
.podium .p3 .bar { height: 56px; background: var(--olive-700); }
.podium .nm { font-size: 13px; margin: 4px 0; }
.award { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.2); border-radius: 12px; padding: 8px 10px; margin-bottom: 6px; }
.award img { width: 44px; height: 44px; image-rendering: pixelated; }
.award b { display: block; color: var(--brass); }
.award span { font-size: 13px; color: var(--sand-300); }
.teams { width: 100%; border-collapse: collapse; font-size: 14px; }
.teams th, .teams td { padding: 6px; border-bottom: 1px solid rgba(142,154,98,.2); text-align: center; }
.hof-game { margin-bottom: 16px; }
.hof-date { color: var(--olive-300); font-size: 12px; margin-bottom: 6px; }

/* ===== אנימציות ===== */
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }
@keyframes fadeOut { 0%,80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes popIn { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes stampIn { from { transform: rotate(-14deg) scale(2.4); opacity: 0; } to { transform: rotate(-14deg) scale(1); opacity: .78; } }
@keyframes floatUp { from { transform: translateY(0) scale(.8); opacity: 1; } to { transform: translateY(-60vh) scale(1.3); opacity: 0; } }
@keyframes drive { from { transform: translateX(60vw); } to { transform: none; } }
@keyframes dots { 0% { content: ''; } 33% { content: '.'; } 66% { content: '..'; } 100% { content: '...'; } }

@media (hover: hover) and (pointer: fine) {
  #joyzone { display: none; }
  .action-btn { right: 24px; bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* ===== איך משחקים ===== */
.home-links { display: flex; justify-content: center; gap: 22px; margin-top: 8px; flex-wrap: wrap; }
.howto .howto-step { min-height: 300px; }
.howto .howto-icon { font-size: 44px; line-height: 1; margin: 4px 0 6px; }
.howto h3 { margin-bottom: 10px; }
.howto ul { margin: 0; padding: 0 18px 0 0; display: grid; gap: 8px; font-size: 15px; line-height: 1.55; color: var(--sand-200); }
.howto li b { color: var(--brass); }
.howto .howto-foot { margin-top: 12px; font-size: 13px; color: var(--olive-300); }
.howto-dots { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.howto-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(245,239,221,.25); }
.howto-dots i.on { background: var(--brass); }
