/* style.css — מסכים, HUD וקלפים בסגנון אנימה. פונטים של האתר: Rubik + Suez One. */
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body {
  height:100%; overflow:hidden; background:#101a2e; color:#fbf7ee;
  font-family:'Rubik', sans-serif; user-select:none; -webkit-user-select:none;
  overscroll-behavior:none; touch-action:none;
}
#stage { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; background:#0d1526; }
#game { display:block; background:#b8d8e8; image-rendering:auto; }
#screens { position:fixed; inset:0; pointer-events:none; }
#screens > * { pointer-events:auto; }

.screen { position:absolute; inset:0; display:flex; flex-direction:column; padding:20px; }
.screen.center { align-items:center; justify-content:center; gap:16px; text-align:center;
  background:radial-gradient(ellipse at 50% 30%, #23406e 0%, #101a2e 70%); }

.logo {
  font-family:'Suez One', serif; font-weight:400; font-size:clamp(38px, 7vw, 76px); line-height:1.1;
  color:#ffd166; text-shadow:0 4px 0 #b3202c, 0 8px 22px rgba(0,0,0,.45);
}
.title { font-family:'Suez One', serif; font-weight:400; font-size:clamp(26px,4vw,44px); }
.sub { font-size:clamp(15px,2vw,20px); color:#b9c6dd; }
.hint { font-size:14px; color:#8ea0be; max-width:640px; line-height:1.7; }

.btn {
  font-family:'Suez One', serif; font-size:22px; color:#fff; border:none; cursor:pointer;
  background:linear-gradient(#2f7fe0, #1e5bb0); padding:12px 34px; border-radius:16px;
  box-shadow:0 6px 0 #14407e, 0 10px 22px rgba(0,0,0,.35);
  transition:transform .08s ease, box-shadow .08s ease;
}
.btn:active { transform:translateY(4px); box-shadow:0 2px 0 #14407e, 0 6px 14px rgba(0,0,0,.35); }
.btn-big { font-size:30px; padding:18px 52px; }
.btn-orange { background:linear-gradient(#f0952e, #d06d14); box-shadow:0 6px 0 #9c4f0c, 0 10px 22px rgba(0,0,0,.35); }
.btn-orange:active { box-shadow:0 2px 0 #9c4f0c, 0 6px 14px rgba(0,0,0,.35); }
.btn-ghost { background:rgba(255,255,255,.08); border:2px solid #4a648f; box-shadow:none; color:#dbe6f7; }
.btn-ghost:active { transform:scale(.97); box-shadow:none; }
.small { font-size:16px; padding:8px 20px; border-radius:12px; text-decoration:none; display:inline-block; }
.btn-row { display:flex; gap:18px; flex-wrap:wrap; justify-content:center; }
.tool-row { display:flex; gap:12px; align-items:center; justify-content:center; }

/* ---------- טעינה ---------- */
.loading-bar { width:min(420px, 70vw); height:14px; border-radius:10px; background:rgba(255,255,255,.12); overflow:hidden; }
.loading-bar-fill { height:100%; width:0; background:linear-gradient(90deg,#ffd166,#f0952e); transition:width .15s linear; }

/* ---------- בחירת גיבור ---------- */
.screen.center.select { justify-content:flex-start; gap:6px; padding:12px 12px 18px; overflow:auto; }
.hero-grid {
  display:grid; grid-template-columns:repeat(3, minmax(120px, 190px)); gap:10px;
  margin:6px auto; max-width:700px;
}
.hero-card {
  background:linear-gradient(#1d2e4f, #16233c); border:3px solid #33507f; border-radius:18px;
  padding:6px 8px 7px; display:flex; flex-direction:column; align-items:center; gap:4px;
  box-shadow:0 8px 18px rgba(0,0,0,.35); position:relative;
}
.hero-card.cur1 { border-color:#2f7fe0; box-shadow:0 0 0 4px rgba(47,127,224,.35), 0 8px 18px rgba(0,0,0,.35); }
.hero-card.cur2 { border-color:#f0952e; box-shadow:0 0 0 4px rgba(240,138,36,.35), 0 8px 18px rgba(0,0,0,.35); }
.hero-card.lock1 { border-color:#2f7fe0; background:linear-gradient(#20406e,#16233c); }
.hero-card.lock2 { border-color:#f0952e; background:linear-gradient(#5c3b18,#16233c); }
.hero-card.lock1::after, .hero-card.lock2::after {
  content:'1'; position:absolute; top:-12px; inset-inline-end:-10px;
  width:30px; height:30px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-family:'Suez One', serif; background:#2f7fe0; color:#fff; border:3px solid #101a2e;
}
.hero-card.lock2::after { content:'2'; background:#f0952e; }
.hero-img { display:flex; align-items:center; justify-content:center; }
.hero-img img { image-rendering:auto; }
.hero-name { font-family:'Suez One', serif; font-size:19px; }
.hero-name.big { font-size:30px; }
.hero-power { font-size:13px; color:#a8bada; min-height:17px; }
.pick-row { display:flex; gap:8px; margin-top:4px; }
.pick {
  width:40px; height:34px; border-radius:10px; border:none; cursor:pointer; color:#fff;
  font-family:'Suez One', serif; font-size:17px;
}
.pick.p1 { background:#2f7fe0; }
.pick.p2 { background:#f0952e; }
.sel-status { font-size:17px; color:#dbe6f7; margin-top:6px; }
.tag { font-size:13px; padding:2px 9px; border-radius:20px; color:#fff; }
.tag.p1 { background:#2f7fe0; }
.tag.p2 { background:#f0952e; }

/* ---------- ספירה לאחור ---------- */
.count { background:transparent; }
.count-num {
  font-family:'Suez One', serif; font-size:clamp(90px, 22vw, 240px); color:#ffd166;
  text-shadow:0 6px 0 #b3202c, 0 14px 40px rgba(0,0,0,.5);
  animation:pop .45s ease-out;
}
@keyframes pop { from { transform:scale(.4); opacity:0; } 70% { transform:scale(1.12); } to { transform:scale(1); opacity:1; } }

/* ---------- HUD ---------- */
.hud-screen { background:transparent; padding:0; pointer-events:none; }
.hud-bar {
  position:absolute; top:0; inset-inline:0; display:flex; align-items:flex-start;
  justify-content:space-between; gap:10px; padding:10px 14px;
}
.hud-panel {
  display:flex; gap:10px; align-items:center; min-width:230px;
  background:rgba(16,26,46,.82); border:3px solid #33507f; border-radius:16px; padding:8px 12px;
}
.hud-panel.p1 { border-color:#2f7fe0; }
.hud-panel.p2 { border-color:#f0952e; }
.hud-hero { width:56px; height:56px; display:flex; align-items:center; justify-content:center; }
.hud-info { display:flex; flex-direction:column; gap:2px; }
.hud-name { font-family:'Suez One', serif; font-size:16px; }
.hud-money { font-family:'Rubik', sans-serif; font-weight:700; font-size:22px; color:#ffd166; direction:ltr; unicode-bidi:isolate; }
.hud-charge { width:130px; height:9px; border-radius:6px; background:rgba(255,255,255,.16); overflow:hidden; }
.hud-charge i { display:block; height:100%; width:0; background:linear-gradient(90deg,#7fd8ff,#2f7fe0); }
.hud-charge.none { opacity:.25; }
.hud-next { font-size:13px; color:#b9c6dd; }
.hud-mid { display:flex; flex-direction:column; align-items:center; gap:4px; }
.hud-clock { font-family:'Rubik', sans-serif; font-weight:700; font-size:26px; color:#fbf7ee; direction:ltr; }
.hud-wave { font-size:14px; color:#ffd166; }
.btn-pause {
  pointer-events:auto; width:44px; height:44px; border-radius:50%; border:3px solid #33507f;
  background:rgba(16,26,46,.85); color:#fbf7ee; font-size:18px; cursor:pointer;
}

/* ---------- השהיה / שכבות ---------- */
.overlay {
  position:fixed; inset:0; background:rgba(8,14,26,.78); display:flex; align-items:center; justify-content:center;
  backdrop-filter:blur(3px);
}
.box {
  background:linear-gradient(#1d2e4f,#16233c); border:3px solid #33507f; border-radius:24px;
  padding:28px 34px; display:flex; flex-direction:column; gap:14px; align-items:center; min-width:280px;
}

/* ---------- סיום ---------- */
.end { overflow:auto; }
.winner-card {
  background:linear-gradient(#26406e,#152239); border:4px solid #ffd166; border-radius:24px;
  padding:16px 28px; display:flex; flex-direction:column; align-items:center; gap:6px;
  box-shadow:0 14px 34px rgba(0,0,0,.45);
}
.stats { display:flex; gap:14px; flex-wrap:wrap; justify-content:center; margin-top:6px; }
.stat {
  background:rgba(255,255,255,.07); border-radius:14px; padding:10px 18px; min-width:120px;
  display:flex; flex-direction:column; gap:2px;
}
.stat b { font-family:'Rubik', sans-serif; font-weight:700; font-size:22px; color:#ffd166; direction:ltr; unicode-bidi:isolate; }
.stat span { font-size:12px; color:#b9c6dd; }

.toast {
  position:fixed; bottom:28px; inset-inline:0; margin:auto; width:max-content;
  background:rgba(16,26,46,.92); border:2px solid #33507f; border-radius:14px; padding:10px 20px;
}

@media (max-width: 760px) {
  .hero-grid { grid-template-columns:repeat(3, minmax(96px, 1fr)); gap:8px; }
  .hud-panel { min-width:auto; }
  .hud-charge { width:90px; }
  .hud-next { display:none; }
}
@media (prefers-reduced-motion: reduce) {
  .count-num { animation:none; }
  .btn, .btn:active { transition:none; }
}

/* ---------- מצב מקוון ---------- */
.join-box { display:flex; flex-direction:column; gap:10px; align-items:center; margin-top:10px; }
.code-input {
  font-family:'Rubik', sans-serif; font-weight:700; font-size:40px; letter-spacing:12px;
  width:220px; text-align:center; direction:ltr; border-radius:14px; padding:8px 10px;
  border:3px solid #33507f; background:#0d1526; color:#ffd166;
}
.room-code {
  font-family:'Rubik', sans-serif; font-weight:700; font-size:clamp(56px, 12vw, 108px);
  letter-spacing:14px; direction:ltr; color:#ffd166; text-shadow:0 5px 0 #b3202c;
}
.room-status { font-size:18px; color:#b9c6dd; min-height:26px; }
.sel-wait { font-size:15px; color:#ffd166; margin-top:4px; }
.net-wait {
  position:fixed; inset-inline:0; top:96px; margin:auto; width:max-content;
  background:rgba(16,26,46,.92); border:2px solid #ffd166; color:#ffd166;
  border-radius:14px; padding:10px 22px; font-size:17px;
}
