/* עיצוב מסך המשתתפים - ראה docs/SPEC.md סעיף 6:
   עברית מימין לשמאל, אותיות גדולות, ניגודיות גבוהה לשמש, כפתורים גדולים. */

:root {
  --color-brand: #f2a93b;
  --color-brand-dark: #c97f12;
  --color-bg: #fffaf0;
  --color-text: #1a1a1a;
  --color-card-bg: #ffffff;
  --color-border: #d8c9a8;
  --color-error: #b3261e;
  --color-success: #2e7d32;
  --touch-target: 56px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 20px;
  line-height: 1.5;
  direction: rtl;
  /* שום רכיב לא אמור לגלוש הצידה, אבל זו רשת ביטחון למקרה שמשהו כן גולש */
  overflow-x: hidden;
  max-width: 100vw;
}

img { max-width: 100%; }

body { -webkit-tap-highlight-color: transparent; }

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

.screen[hidden] { display: none !important; }

.card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 560px;
  margin: 0 auto;
}

.card.center {
  margin: auto;
  text-align: center;
}

h1 { font-size: 1.6rem; margin-top: 0; }

.hint { color: #555; font-size: .95rem; }

button {
  font-size: 1.1rem;
  font-family: inherit;
}

.btn-primary {
  background: var(--color-brand);
  color: #1a1a1a;
  border: none;
  border-radius: 10px;
  padding: 1rem 1.5rem;
  min-height: var(--touch-target);
  width: 100%;
  font-weight: bold;
  cursor: pointer;
  margin-top: 1rem;
}

.btn-primary:active { background: var(--color-brand-dark); }

.btn-icon {
  background: none;
  border: 2px solid var(--color-brand-dark);
  border-radius: 8px;
  padding: .5rem 1rem;
  min-height: var(--touch-target);
  min-width: var(--touch-target);
  cursor: pointer;
}

/* מסך טעינה */
.progress-bar {
  background: #eee;
  border-radius: 8px;
  height: 20px;
  overflow: hidden;
  margin: 1rem 0;
}
.progress-fill {
  background: var(--color-brand);
  height: 100%;
  width: 0%;
  transition: width .2s;
}

/* מסך מוכנות */
.ready-logo {
  display: block;
  width: 140px;
  max-width: 50%;
  margin: 0 auto 1rem;
}

.error-message {
  color: var(--color-error);
  font-weight: bold;
}

/* מסך המשחק */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-brand);
}

.game-header .btn-icon {
  font-size: .95rem;
  padding: .4rem .7rem;
}

.logo {
  font-weight: bold;
  font-size: 1.3rem;
  color: var(--color-brand-dark);
}

.riddle-progress {
  font-size: 1.1rem;
  font-weight: bold;
}

.riddle-tabs {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding: .75rem 0;
}

.riddle-tabs button {
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 44px;
  border-radius: 8px;
  border: 2px solid var(--color-brand-dark);
  background: white;
  cursor: pointer;
}

.riddle-tabs button.active {
  background: var(--color-brand);
}

.riddle-tabs button:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.riddle-content {
  flex: 1;
  padding: .5rem 0 1rem;
}

.riddle-content h2 { font-size: 1.4rem; }

.riddle-content p { margin: .75rem 0; }

.riddle-content .clue {
  background: #f0f4ff;
  border-radius: 8px;
  padding: .75rem 1rem;
  margin: .75rem 0;
}

.answer-boxes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 1rem 0;
  direction: rtl; /* ברירת מחדל - נדרס ל-ltr כשצריך סדר כמו מספרים */
}

.answer-box {
  width: 26px;
  height: 34px;
  padding: 0;
  text-align: center;
  font-size: 1.1rem;
  font-family: inherit;
  border: 2px solid var(--color-border);
  border-radius: 6px;
  background: white;
  flex: 0 0 auto;
}

.answer-box-separator {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--color-brand-dark);
  flex: 0 0 auto;
  padding: 0 2px;
}

.riddle-content .images {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.riddle-content .images img {
  max-height: 110px;
  max-width: 100%;
  width: auto;
  height: auto;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: zoom-in;
}

.riddle-content .points-badge {
  display: inline-block;
  background: var(--color-brand);
  border-radius: 999px;
  padding: .2rem .8rem;
  font-size: .9rem;
  font-weight: bold;
}

.riddle-content .debug-timing {
  display: block;
  color: #7a4b00;
  background: #fff3da;
  border: 1px dashed #c97f12;
  border-radius: 6px;
  padding: .4rem .6rem;
  font-size: .85rem;
  margin: .5rem 0;
}

.opening-word-area {
  background: var(--color-card-bg);
  border: 2px solid var(--color-brand);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

#opening-word-form {
  display: flex;
  gap: .5rem;
  margin-top: .5rem;
}

#opening-word-input {
  flex: 1;
  font-size: 1.3rem;
  padding: .75rem;
  min-height: var(--touch-target);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  text-align: center;
}

/* מסך סיום */
.finished-buttons {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-top: 1rem;
}

.finished-button {
  display: block;
  text-decoration: none;
  text-align: center;
}

/* תמונת אות מוגדלת (לייטבוקס פשוט) */
.image-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.image-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  background: white;
  border-radius: 8px;
}
