/* =============================================================
   דו-קרב הניחושים — עיצוב
   TV studio aesthetic: רקע כהה, זוהר ניאון, אפקט זכוכית (glassmorphism)
============================================================= */

:root {
  --bg-deep: #05060f;
  --bg-panel: rgba(20, 24, 46, 0.55);
  --neon-pink: #ff2fd6;
  --neon-blue: #23e5ff;
  --neon-purple: #7f5bff;
  --neon-gold: #ffd23f;
  --text-light: #eef1ff;
  --text-muted: #9aa3c7;
  --danger: #ff4d5e;
  --success: #33ff9d;
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 8px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Heebo', 'Assistant', 'Segoe UI', sans-serif;
  color: var(--text-light);
  background:
    radial-gradient(circle at 15% 20%, rgba(127, 91, 255, 0.25), transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(35, 229, 255, 0.2), transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(255, 47, 214, 0.18), transparent 50%),
    var(--bg-deep);
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
}

button, input, select {
  touch-action: manipulation;
}

.hidden { display: none !important; }

/* ---------------- לוח זכוכית בסיסי ---------------- */
.glass {
  background: var(--bg-panel);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ---------------- כפתורים ---------------- */
.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.4rem;
  cursor: pointer;
  color: var(--text-light);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  box-shadow: 0 0 20px rgba(255, 47, 214, 0.55), 0 0 40px rgba(127, 91, 255, 0.25);
}

.btn-secondary {
  background: linear-gradient(135deg, rgba(35, 229, 255, 0.25), rgba(127, 91, 255, 0.25));
  border: 1px solid rgba(35, 229, 255, 0.5);
  box-shadow: 0 0 14px rgba(35, 229, 255, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #12a86a);
  box-shadow: 0 0 16px rgba(51, 255, 157, 0.5);
}

.btn-danger {
  background: linear-gradient(135deg, rgba(255, 77, 94, 0.35), rgba(255, 47, 214, 0.2));
  border: 1px solid rgba(255, 77, 94, 0.6);
  box-shadow: 0 0 14px rgba(255, 77, 94, 0.35);
}

/* =============================================================
   מסך פתיחה
============================================================= */
.screen {
  min-height: 100vh;
  width: 100%;
}

.start-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.start-card {
  width: 100%;
  max-width: 600px;
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.5rem 2rem;
  animation: pop-in 0.5s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.show-title {
  font-size: 2.2rem;
  font-weight: 900;
  text-align: center;
  margin: 0 0 0.4rem;
  text-shadow: 0 0 18px rgba(255, 47, 214, 0.6);
}
.show-title span {
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.show-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin: 0 0 1.8rem;
  font-size: 0.95rem;
}

.field-row {
  display: flex;
  gap: 1rem;
}
.field-row .field { flex: 1; }

.field {
  margin-bottom: 1.3rem;
  display: flex;
  flex-direction: column;
}

.field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--neon-blue);
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
}

input[type="text"] {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}
input[type="text"]:focus {
  border-color: var(--neon-blue);
  box-shadow: 0 0 12px rgba(35, 229, 255, 0.4);
}
input::placeholder { color: rgba(238, 241, 255, 0.35); }

/* ---------------- בחירת קטגוריה ---------------- */
.category-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.category-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  font-weight: 600;
}
.category-option .cat-emoji { font-size: 1.5rem; }
.category-option .cat-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(35, 229, 255, 0.5);
  flex-shrink: 0;
}
.category-option:hover {
  border-color: rgba(35, 229, 255, 0.5);
}
.category-option.selected {
  border-color: var(--neon-blue);
  background: rgba(35, 229, 255, 0.12);
  box-shadow: 0 0 16px rgba(35, 229, 255, 0.35);
}

.btn-start {
  width: 100%;
  font-size: 1.05rem;
  padding: 1rem;
  margin-top: 0.5rem;
}

.btn-custom-trigger {
  width: 100%;
  margin-top: 0.4rem;
  font-size: 0.9rem;
}

.start-error {
  color: var(--danger);
  font-size: 0.85rem;
  text-align: center;
  margin: 0.8rem 0 0;
}

/* ---------------- חלון קטגוריית תמונות מותאמת אישית ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(2, 3, 10, 0.72);
  backdrop-filter: blur(4px);
}

.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  padding: 1.8rem 2rem;
  animation: pop-in 0.35s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.modal-header h2 {
  font-size: 1.25rem;
  margin: 0;
}

.modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-light);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.modal-close:hover { background: rgba(255, 77, 94, 0.3); transform: scale(1.05); }

.hint-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}

.hint-text.warning-text {
  color: var(--neon-gold);
}

.hint-text code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.78rem;
}

.custom-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 1.1rem 0 1.4rem;
  max-height: 260px;
  overflow-y: auto;
}

.custom-item-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-item-thumb {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.custom-item-answer {
  flex: 1;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
  outline: none;
}
.custom-item-answer:focus {
  border-color: var(--neon-blue);
  box-shadow: 0 0 10px rgba(35, 229, 255, 0.35);
}

.custom-item-remove {
  flex-shrink: 0;
  background: rgba(255, 77, 94, 0.2);
  border: 1px solid rgba(255, 77, 94, 0.5);
  color: var(--text-light);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: transform 0.15s ease, filter 0.2s ease;
}
.custom-item-remove:hover { transform: scale(1.08); filter: brightness(1.2); }

.custom-empty-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.6rem 0;
}

/* =============================================================
   מסך המשחק
============================================================= */
.game-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem 2rem;
  min-height: 100vh;
}

.show-header {
  text-align: center;
  margin-bottom: 1rem;
}
.game-logo {
  font-size: 1.6rem;
  font-weight: 900;
  margin: 0;
  text-shadow: 0 0 16px rgba(127, 91, 255, 0.6);
}
.game-logo span {
  background: linear-gradient(90deg, var(--neon-pink), var(--neon-blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.category-badge {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  background: rgba(127, 91, 255, 0.18);
  border: 1px solid rgba(127, 91, 255, 0.5);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--neon-gold);
}

.board-layout {
  display: grid;
  grid-template-columns: 220px minmax(320px, 900px) 220px;
  gap: 1.5rem;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  justify-content: center;
}

/* ---------------- לוח ניקוד ---------------- */
.scoreboard {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.scoreboard[data-player="1"] { border-top: 3px solid var(--neon-pink); }
.scoreboard[data-player="2"] { border-top: 3px solid var(--neon-blue); }

.scoreboard.active-turn {
  box-shadow: 0 0 0 2px var(--neon-gold), 0 0 30px rgba(255, 210, 63, 0.45);
}

.turn-flag {
  position: absolute;
  top: -14px;
  background: linear-gradient(135deg, var(--neon-gold), #ff9e2c);
  color: #241a00;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(255, 210, 63, 0.6);
  opacity: 0;
  transform: translateY(6px) scale(0.8);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.scoreboard.active-turn .turn-flag {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.score-name {
  font-weight: 700;
  font-size: 1.15rem;
  word-break: break-word;
  max-width: 100%;
}

.score-value {
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 20px currentColor;
}
.scoreboard[data-player="1"] .score-value { color: var(--neon-pink); }
.scoreboard[data-player="2"] .score-value { color: var(--neon-blue); }

.score-value.bump { animation: score-bounce 0.4s ease; }
@keyframes score-bounce {
  0% { transform: scale(1); }
  35% { transform: scale(1.35) rotate(-3deg); }
  65% { transform: scale(0.92) rotate(2deg); }
  100% { transform: scale(1); }
}

/* ---------------- נקודות פסילה ---------------- */
.miss-dots {
  display: flex;
  gap: 0.4rem;
  margin: 0.2rem 0;
}
.miss-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.miss-dots .dot.used {
  background: var(--danger);
  box-shadow: 0 0 10px rgba(255, 77, 94, 0.7);
  transform: scale(1.15);
}

.score-buttons {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.3rem;
}
.score-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
  color: var(--text-light);
  transition: transform 0.15s ease, filter 0.2s ease;
}
.score-btn:hover { transform: translateY(-2px) scale(1.06); filter: brightness(1.15); }
.score-btn:active { transform: scale(0.9); }
.score-btn.plus {
  background: linear-gradient(135deg, var(--success), #12a86a);
  box-shadow: 0 0 12px rgba(51, 255, 157, 0.5);
}
.score-btn.minus {
  background: linear-gradient(135deg, var(--danger), #a3202f);
  box-shadow: 0 0 12px rgba(255, 77, 94, 0.5);
}

/* ---------------- מסך הטלוויזיה ---------------- */
.tv-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tv-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(160deg, #1b1e33, #0b0d1c 60%);
  border-radius: 28px;
  padding: 1.4rem;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.05),
    0 0 40px rgba(127, 91, 255, 0.35),
    0 25px 60px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tv-brand-dot {
  position: absolute;
  bottom: 0.5rem;
  left: 1.4rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-gold);
  box-shadow: 0 0 8px var(--neon-gold), 0 0 16px var(--neon-gold);
}

.tv-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #131735, #05060f 75%);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.round-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  animation: stage-in 0.4s ease;
}

@keyframes stage-in {
  from { opacity: 0; transform: scale(0.8) rotate(-4deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

.item-emoji {
  font-size: clamp(5rem, 18vw, 11rem);
  filter: drop-shadow(0 0 30px rgba(35, 229, 255, 0.45));
  line-height: 1;
}

.item-image {
  max-width: min(80vw, 520px);
  max-height: 50vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 0 40px rgba(35, 229, 255, 0.35), 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.item-answer {
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 800;
  padding: 0.5rem 1.4rem;
  border-radius: 999px;
  background: rgba(51, 255, 157, 0.15);
  border: 1px solid rgba(51, 255, 157, 0.6);
  color: var(--success);
  text-shadow: 0 0 12px rgba(51, 255, 157, 0.5);
}

.round-banner {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  font-size: clamp(1.1rem, 3vw, 1.8rem);
  font-weight: 800;
  background: rgba(5, 6, 15, 0.82);
  animation: banner-in 0.3s ease;
}

@keyframes banner-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.round-banner.correct { color: var(--success); text-shadow: 0 0 18px rgba(51, 255, 157, 0.6); }
.round-banner.lost { color: var(--danger); text-shadow: 0 0 18px rgba(255, 77, 94, 0.6); }

.scanlines {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.035) 0px,
    rgba(255, 255, 255, 0.035) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  box-shadow: inset 0 0 120px 40px rgba(0, 0, 0, 0.65);
}

.tv-stand {
  width: 140px;
  height: 22px;
  margin-top: -2px;
  background: linear-gradient(180deg, #232a4d, #0b0d1c);
  border-radius: 0 0 14px 14px;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.5);
}

/* ---------------- פאנל שליטה למנחה ---------------- */
.host-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin-top: 1.8rem;
  padding: 1.2rem 2rem;
  border-radius: var(--radius-lg);
}

.category-select {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
  cursor: pointer;
}
.category-select option { background: #14172e; color: var(--text-light); }

/* ---------------- שעון עצר לתור ---------------- */
.turn-timer {
  position: absolute;
  top: -0.6rem;
  right: -1.6rem;
  z-index: 6;
  width: 88px;
  height: 88px;
}
.timer-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 10px rgba(35, 229, 255, 0.55));
}
.timer-ring-bg {
  fill: rgba(5, 6, 15, 0.6);
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 2.5;
}
.timer-ring-fg {
  fill: none;
  stroke: var(--neon-blue);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.95s linear, stroke 0.3s ease;
}
.timer-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  color: var(--neon-blue);
  transition: color 0.2s ease;
}
.turn-timer.urgent .timer-ring-fg { stroke: var(--danger); }
.turn-timer.urgent .timer-number { color: var(--danger); }
.turn-timer.urgent { animation: timer-pulse 0.6s ease infinite; }
@keyframes timer-pulse {
  0%, 100% { transform: translateX(50%) scale(1); }
  50% { transform: translateX(50%) scale(1.14); }
}

/* ---------------- כרטיס הכרזת מנצח ---------------- */
.winner-card {
  text-align: center;
  max-width: 480px;
}
.winner-trophy {
  font-size: 4.5rem;
  filter: drop-shadow(0 0 24px rgba(255, 210, 63, 0.7));
  margin-bottom: 0.4rem;
}
.winner-title {
  font-size: 1.7rem;
  font-weight: 900;
  margin: 0 0 0.6rem;
  background: linear-gradient(90deg, var(--neon-gold), var(--neon-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.winner-sub {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0 0 1.6rem;
}
.winner-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* =============================================================
   רספונסיביות
============================================================= */
@media (max-width: 980px) {
  .board-layout {
    grid-template-columns: 1fr;
  }
  .scoreboard {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    flex-wrap: wrap;
  }
  .score-buttons { flex-direction: row; }
  .tv-wrapper { order: -1; width: 100%; }
}

/* ---------------- גירסה מלאה לטלפון ---------------- */
@media (max-width: 560px) {
  html { font-size: 15px; }

  .game-screen {
    padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 0.6rem calc(6.5rem + env(safe-area-inset-bottom, 0px));
    min-height: 100dvh;
  }

  .start-screen {
    padding: calc(1.2rem + env(safe-area-inset-top, 0px)) 0.8rem calc(1.2rem + env(safe-area-inset-bottom, 0px));
    min-height: 100dvh;
  }

  .field-row { gap: 0.6rem; }
  .field { margin-bottom: 0.8rem; }
  .show-subtitle { margin-bottom: 0.9rem; font-size: 0.85rem; }
  .category-picker { grid-template-columns: repeat(2, 1fr); max-height: 30dvh; overflow-y: auto; padding-inline-end: 0.25rem; }
  .category-picker::-webkit-scrollbar { width: 5px; }
  .category-picker::-webkit-scrollbar-thumb { background: rgba(35, 229, 255, 0.4); border-radius: 4px; }
  .start-card { padding: 1.6rem 1.2rem; max-width: 100%; }
  .show-title { font-size: 1.7rem; }

  input[type="text"], .category-select, .custom-item-answer {
    font-size: 16px; /* מונע זום אוטומטי באייפון בעת פוקוס */
  }

  /* לוחות ניקוד: שני עמודים קטנים וצפופים זה לצד זה, נוחים לאגודל */
  .board-layout { gap: 0.6rem; }
  .scoreboard {
    padding: 0.75rem 0.5rem;
    flex: 1 1 0;
    flex-direction: column;
    gap: 0.35rem;
    border-radius: var(--radius-md);
  }
  .score-name { font-size: 0.95rem; }
  .score-value { font-size: 2.1rem; }
  .turn-flag { font-size: 0.65rem; padding: 0.2rem 0.55rem; top: -12px; }
  .miss-dots .dot { width: 10px; height: 10px; }

  .score-buttons { gap: 0.9rem; margin-top: 0.15rem; }
  .score-btn {
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
  }

  .tv-wrapper { margin: 0.4rem 0; }
  .tv-frame { padding: 0.9rem; border-radius: 20px; }
  .tv-stand { display: none; }
  .item-emoji { font-size: clamp(4rem, 26vw, 7rem); }
  .item-image { max-width: 88vw; max-height: 34dvh; }
  .item-answer { font-size: clamp(1.05rem, 4.5vw, 1.4rem); }

  .category-badge { font-size: 0.75rem; padding: 0.3rem 0.8rem; }
  .game-logo { font-size: 1.25rem; }
  .turn-timer { width: 68px; height: 68px; top: 0.3rem; right: -0.4rem; }
  .timer-number { font-size: 1.5rem; }
  .winner-card { padding: 1.6rem 1.2rem; }
  .winner-trophy { font-size: 3.2rem; }
  .winner-title { font-size: 1.3rem; }

  /* פאנל שליטה: סרגל דביק תחתון עם גלילה אופקית, אצבע-ידידותי */
  .host-controls {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0.8rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0;
  }
  .host-controls::-webkit-scrollbar { display: none; }
  .host-controls .btn,
  .host-controls .category-select {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
  }
  .host-controls .btn {
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    min-height: 44px; /* מטרת מגע נוחה */
  }
  #btn-correct, #btn-miss {
    font-weight: 800;
  }

  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-card {
    max-width: 100%;
    width: 100%;
    max-height: calc(92dvh - env(safe-area-inset-bottom, 0px));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1.3rem 1.2rem calc(1.3rem + env(safe-area-inset-bottom, 0px));
    animation: sheet-in 0.3s ease;
  }
  @keyframes sheet-in {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .btn-custom-trigger, .btn-start { min-height: 48px; }
}

/* ---------------- אוריינטציית לרוחב בטלפון ---------------- */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 480px) {
  .game-screen { padding-bottom: 4.5rem; }
  .board-layout { grid-template-columns: 140px minmax(200px, 1fr) 140px; }
  .tv-wrapper { order: 0; }
  .scoreboard { flex-direction: column; }
  .item-emoji { font-size: clamp(3rem, 12vw, 5rem); }
  .item-image { max-height: 55dvh; }
  .host-controls { padding: 0.5rem 0.8rem; }
  .host-controls .btn { padding: 0.6rem 0.9rem; font-size: 0.78rem; min-height: 38px; }
}

/* ---------------- הודעת טוסט קצרה (הצלחה/שגיאה) ---------------- */
.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 23, 46, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.4rem;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  z-index: 999;
  max-width: min(90vw, 480px);
  text-align: center;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(16px);
  pointer-events: none;
}
.toast.toast-error {
  border-color: rgba(255, 77, 94, 0.6);
  color: #ffc2c8;
}
