/* נסיך הסביח — עיצוב */

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

:root {
  --bg: #1e1a16;
  --card: #2b251f;
  --card2: #352e26;
  --cream: #f5e9d4;
  --tahini: #efe6d0;
  --orange: #e8873c;
  --orange-dark: #c96a24;
  --teal: #26a69a;
  --gold: #e6b64c;
  --red: #d05043;
  --green: #7cb342;
  --muted: #a89a85;
  --radius: 16px;
}

html, body { height: 100%; }

body {
  font-family: "Segoe UI", "Arial Hebrew", Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 50% -10%, #3a3128 0%, var(--bg) 60%),
    var(--bg);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ===== HUD ===== */
#hud {
  width: 100%;
  max-width: 760px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  flex-wrap: wrap;
}
.hud-item {
  background: var(--card);
  border: 1px solid #453b30;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.9rem;
  font-weight: 600;
}
.hud-item.money { color: var(--gold); }
.hud-btn {
  margin-inline-start: auto;
  background: var(--card2);
  color: var(--cream);
  border: 1px solid #55483a;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
}
.hud-btn:hover { background: #443a2f; }

/* ===== מסכים ===== */
#game {
  width: 100%;
  max-width: 760px;
  padding: 12px 14px 40px;
  flex: 1;
}
.screen { animation: fadeIn 0.35s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ===== כפתורים ===== */
.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, var(--orange), var(--orange-dark));
  border: none;
  border-radius: 12px;
  padding: 12px 22px;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn-big { font-size: 1.15rem; padding: 14px 30px; }
.btn-secondary { background: linear-gradient(180deg, #4e657a, #3a4d5e); }

/* ===== מסך פתיחה ===== */
#screen-title {
  text-align: center;
  padding-top: 8vh;
}
.title-art { font-size: 3.2rem; margin-bottom: 8px; }
.game-title {
  font-size: clamp(2.6rem, 8vw, 4rem);
  font-weight: 900;
  background: linear-gradient(180deg, var(--gold), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 6px;
}
.tagline { color: var(--muted); font-size: 1.15rem; margin-bottom: 4px; }
.subtitle { color: var(--cream); opacity: 0.85; margin-bottom: 28px; }
.title-buttons { display: flex; flex-direction: column; gap: 12px; align-items: center; margin-bottom: 30px; }
.howto {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ===== כרטיס סיפור / פרק ===== */
.story-card {
  background: var(--card);
  border: 1px solid #453b30;
  border-radius: var(--radius);
  padding: 34px 28px;
  text-align: center;
  margin-top: 6vh;
}
.story-num { color: var(--orange); font-weight: 800; letter-spacing: 2px; margin-bottom: 8px; }
.story-card h2 { font-size: 2rem; margin-bottom: 16px; color: var(--gold); }
.story-card p { line-height: 1.9; font-size: 1.08rem; margin-bottom: 26px; text-align: right; }

/* ===== דיאלוג ===== */
.customer-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid #453b30;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 14px;
}
.cust-emoji {
  font-size: 3rem;
  width: 74px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card2);
  border-radius: 50%;
  flex-shrink: 0;
}
.cust-name { font-size: 1.3rem; font-weight: 800; }
.cust-title { color: var(--muted); font-size: 0.9rem; }
.cust-tier { margin-top: 4px; font-size: 0.85rem; color: var(--gold); }

.speech {
  background: var(--tahini);
  color: #2b251f;
  border-radius: var(--radius);
  border-start-start-radius: 4px;
  padding: 18px 20px;
  font-size: 1.12rem;
  line-height: 1.8;
  margin-bottom: 18px;
  position: relative;
}

.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  font-family: inherit;
  text-align: right;
  font-size: 1rem;
  background: var(--card2);
  color: var(--cream);
  border: 1px solid #55483a;
  border-radius: 12px;
  padding: 13px 16px;
  cursor: pointer;
  line-height: 1.5;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.choice:hover { background: #443a2f; border-color: var(--orange); transform: translateX(-3px); }

/* ===== מיני-משחק ===== */
.prep-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.timer {
  flex: 1;
  height: 16px;
  background: var(--card2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #55483a;
}
.timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold));
  border-radius: 999px;
  transition: width 0.1s linear;
}
.timer-fill.low { background: var(--red); }
.mistakes { font-size: 1.1rem; min-width: 70px; text-align: left; }

.prep-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.ticket {
  background: var(--tahini);
  color: #2b251f;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.95rem;
  transition: filter 0.4s ease;
}
.ticket.blurred .ticket-list { filter: blur(6px); }
.ticket-head { font-weight: 800; margin-bottom: 4px; }
.ticket-note { font-size: 0.82rem; color: #6b5d49; margin-bottom: 8px; font-style: italic; }
.ticket-list { padding-inline-start: 20px; line-height: 1.7; }
.ticket-list li.done { opacity: 0.4; text-decoration: line-through; }
.ticket-list li.current { font-weight: 800; color: var(--orange-dark); }

.pita-zone { display: flex; align-items: flex-end; justify-content: center; }
.pita {
  width: 100%;
  max-width: 240px;
  min-height: 220px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  gap: 3px;
  background: var(--card);
  border: 1px solid #453b30;
  border-radius: 12px;
  padding: 10px;
}
.pita-base {
  background: #caa96b;
  color: #4a3a20;
  text-align: center;
  border-radius: 8px;
  padding: 8px;
  font-weight: 800;
}
.layer {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  text-align: center;
  border-radius: 8px;
  padding: 5px;
  font-size: 0.88rem;
  font-weight: 700;
  animation: drop 0.25s ease;
}
@keyframes drop {
  from { transform: translateY(-14px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.ing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ing-btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--card2);
  color: var(--cream);
  border: 1px solid #55483a;
  border-radius: 12px;
  padding: 12px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.08s ease, border-color 0.15s ease;
}
.ing-btn:hover { border-color: var(--orange); }
.ing-btn:active { transform: scale(0.95); }
.ing-btn .ing-emoji { font-size: 1.5rem; }
.ing-btn.shake { animation: shake 0.3s ease; border-color: var(--red); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ===== תגובה ===== */
#screen-reaction { text-align: center; }
.quality-badge {
  display: inline-block;
  font-size: 1.4rem;
  font-weight: 900;
  padding: 10px 26px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.quality-badge.perfect { background: #2e5d33; color: #b6f0a2; }
.quality-badge.good { background: #5d532e; color: #f0e3a2; }
.quality-badge.bad { background: #5d2e2e; color: #f0a2a2; }
#screen-reaction .customer-card, #screen-reaction .speech { text-align: right; }
.reward-line { font-size: 1.05rem; margin-bottom: 20px; color: var(--gold); }

/* ===== סוד ===== */
.secret-card {
  background: linear-gradient(180deg, #3a3049, #2b2537);
  border: 1px solid #6a5a8a;
  border-radius: var(--radius);
  padding: 34px 28px;
  text-align: center;
  margin-top: 5vh;
}
.secret-glow { font-size: 2.2rem; margin-bottom: 8px; }
.secret-card h2 { color: #cbb6f0; margin-bottom: 16px; }
.secret-card p { line-height: 1.9; font-size: 1.06rem; text-align: right; margin-bottom: 26px; }

/* ===== סיכום ===== */
#screen-summary { text-align: center; padding-top: 5vh; }
#screen-summary h2 { font-size: 1.9rem; color: var(--gold); margin-bottom: 20px; }
.summary-stats {
  background: var(--card);
  border: 1px solid #453b30;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 0 auto 24px;
  max-width: 420px;
  text-align: right;
  line-height: 2.1;
  font-size: 1.05rem;
}

/* ===== סיומת ===== */
.ending-card { margin-top: 3vh; }
.ending-emoji { font-size: 3.4rem; margin-bottom: 8px; }

/* ===== חלון קשרים ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}
.modal-box {
  background: var(--card);
  border: 1px solid #55483a;
  border-radius: var(--radius);
  padding: 24px;
  max-width: 440px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-box h2 { margin-bottom: 16px; color: var(--gold); }
.rel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #3a3128;
}
.rel-row .rel-emoji { font-size: 1.6rem; }
.rel-row .rel-name { flex: 1; font-weight: 700; }
.rel-bar {
  width: 110px;
  height: 10px;
  background: var(--card2);
  border-radius: 999px;
  overflow: hidden;
}
.rel-bar-fill { height: 100%; background: linear-gradient(90deg, var(--orange), var(--gold)); }
.rel-tier { font-size: 0.85rem; color: var(--muted); min-width: 64px; text-align: left; }
.modal-box .btn { margin-top: 16px; width: 100%; }

/* ===== מובייל ===== */
@media (max-width: 560px) {
  .prep-body { grid-template-columns: 1fr; }
  .pita { max-width: 100%; min-height: 140px; }
  .ing-grid { grid-template-columns: repeat(3, 1fr); }
  .game-title { font-size: 2.4rem; }
  .story-card { padding: 24px 18px; }
}
