/* ============================================================
   ESEL UND TEDDY – Das Textadventure
   style.css
   ============================================================ */

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

:root {
  --bg:         #f4f5f7;
  --text:       #00102e;
  --accent:     #233452;
  --accent-blue:#0290ce;
  --stamp-on:   #f0a500;
  --stamp-off:  #dbdbdb;
  --border:     #dbdbdb;
  --hover-bg:   #0290ce;
  --hover-fg:   #ffffff;
  --selected:   #0290ce;
  --label:      #233452;
}

html, body {
  height: 100%;
  font-family: 'Arial', sans-serif;
  background: #fff;
  color: var(--text);
  overflow: hidden;
}

/* ── Screens ────────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  z-index: 10;
}
.hidden { display: none !important; }

/* ── Prolog ─────────────────────────────────────────────── */
#prolog { background: #fff; align-items: flex-start; justify-content: flex-start; position: relative; }
#prolog-content {
  max-width: 800px;
  width: 90%;
  text-align: left;
  padding: 60px 0 40px 60px;
}
#prolog-next {
  position: absolute;
  right: 10%;
  top: 50%;
  transform: translateY(-50%);
}
#prolog-text {
  font-family: 'Georgia', serif;
  font-size: 20px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 40px;
}
#prolog-text p {
  margin-bottom: 16px;
}
#prolog-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--text);
  vertical-align: text-bottom;
  animation: blink 0.7s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Zettel ─────────────────────────────────────────────── */
#note-screen { background: #f0ede8; }
#note-wrap { text-align: center; }
#note {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 48px 56px;
  font-family: 'Georgia', serif;
  font-size: 18px;
  line-height: 2;
  color: #1a1a1a;
  transform: rotate(-1.5deg);
  box-shadow: 2px 4px 20px rgba(0,0,0,0.12);
  display: inline-block;
  text-align: left;
  margin-bottom: 36px;
}
#note p { margin-bottom: 12px; }
#note .note-sig { margin-top: 0; }
#note-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 8px;
}
#phone-dialog {
  margin-top: 28px;
  font-family: 'Georgia', serif;
  font-size: 16px;
  line-height: 1.9;
  color: #444;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
#phone-dialog p { margin-bottom: 8px; }

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 28px;
  font-size: 15px;
  font-family: 'Arial', sans-serif;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s;
}
.btn-primary:hover { background: #1a252f; }

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 12px 28px;
  font-size: 15px;
  font-family: 'Arial', sans-serif;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}
.btn-secondary:hover {
  background: var(--accent);
  color: #fff;
}

/* ── Game Layout ────────────────────────────────────────── */
#game {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

#game-header {
  flex-shrink: 0;
  padding: 11px 24px;
  border-bottom: 1px solid #0a1e3f;
  background: #00102e;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
}
.header-sep { color: #666; font-size: 13px; }
.header-sub { font-size: 13px; color: #9aa; letter-spacing: 0.04em; }

#header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

#verb-status-header {
  font-size: 13px;
  font-style: italic;
  color: #9aa;
  font-family: 'Georgia', serif;
  min-width: 180px;
  text-align: right;
}

#image-screen {
  background: #fff;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
#image-screen-img {
  max-width: 80vw;
  max-height: 80vh;
  object-fit: contain;
  cursor: pointer;
}

#reset-btn {
  font-size: 12px;
  font-family: 'Georgia', serif;
  color: #9aa;
  background: transparent;
  border: 1px solid #2a3f60;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
}
#reset-btn:hover {
  color: #fff;
  border-color: #9aa;
}

#game-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* ── Obere Reihe: Aktionen + Hauptinhalt ────────────────── */
#main-content-row {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  min-height: 0;
}

/* ── Main Area (rechts oben) ────────────────────────────── */
#main-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 20px;
  min-height: 0;
}

#room-name {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--label);
  margin-bottom: 10px;
}

#room-description {
  font-family: 'Georgia', serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  max-width: 700px;
}

/* ── Abschnitte: Gegenstände + Ausgänge ─────────────────── */
.section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--label);
  margin-bottom: 8px;
  margin-top: 24px;
}

#room-persons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.npc-btn {
  background: #fff;
  border: 1px solid #b0b8c1;
  color: var(--accent);
  font-family: 'Georgia', serif;
  font-size: 14px;
  padding: 5px 13px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.12s;
}
.npc-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.npc-btn.highlighted {
  border-color: var(--accent);
  font-weight: 600;
  background: #eef1f4;
}
.npc-btn.selected-first {
  background: var(--accent);
  color: #fff;
}

#room-objects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.obj-btn {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Georgia', serif;
  font-size: 14px;
  padding: 5px 13px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.12s;
}
.obj-btn:hover {
  background: var(--hover-bg);
  color: var(--hover-fg);
  border-color: var(--hover-bg);
}
.obj-btn.highlighted {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  font-weight: 600;
}
.obj-btn.selected-first {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

#room-exits {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 5px;
}

.exit-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 14px;
  font-family: 'Georgia', serif;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 2px;
  letter-spacing: 0.02em;
  transition: background 0.12s;
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
}
#room-exits[data-passage=""] .exit-btn { width: 100%; }
#room-exits[data-passage="1"] .exit-btn { width: auto; }
.exit-btn::before { content: '▶'; font-size: 9px; opacity: 0.7; flex-shrink: 0; }
.exit-btn:hover { background: #00102e; }

/* ── Reaktionsstreifen – immer sichtbar ─────────────────── */
#reaction-strip {
  flex-shrink: 0;
  min-height: 72px;
  max-height: 100px;
  padding: 12px 32px;
  background: #fff;
  border-top: 2px solid var(--accent-blue);
  border-bottom: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  align-items: center;
}

#reaction-text {
  font-family: 'Georgia', serif;
  font-size: 16px;
  line-height: 1.7;
  color: #333;
  transition: opacity 0.2s;
  width: 100%;
}

/* ── UI Area (bottom) ───────────────────────────────────── */
#ui-area {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: #fff;
}

#bottom-row {
  display: flex;
  flex-direction: row;
  min-height: 80px;
}

/* ── Verb Panel (links oben) ────────────────────────────── */
#verb-panel {
  flex-shrink: 0;
  width: 220px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px 8px;
  gap: 0;
  overflow-y: auto;
  background: #fff;
}

.verb-btn {
  background: transparent;
  border: none;
  text-align: left;
  padding: 3px 10px;
  font-size: 15px;
  line-height: 1.6;
  font-family: 'Georgia', serif;
  color: var(--text);
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.1s;
  white-space: normal;
  flex-shrink: 0;
}
.verb-btn:hover {
  background: var(--hover-bg);
  color: var(--hover-fg);
}
.verb-btn.active {
  background: var(--accent-blue);
  color: #fff;
  font-weight: 600;
}

/* ── Inventory + Stamp Panels ───────────────────────────── */
#inventory-panel {
  flex: 1;
  border-right: 1px solid var(--border);
  padding: 12px 16px;
  overflow-y: auto;
}

#stamp-panel {
  flex-shrink: 0;
  width: 220px;
  padding: 12px 16px;
  background: #fffbf0;
  border-left: 2px solid var(--stamp-on);
}

.panel-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--label);
  margin-bottom: 6px;
}

#inventory-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inv-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 5px 10px;
  font-size: 13px;
  font-family: 'Arial', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.12s;
  white-space: nowrap;
}
.inv-item:hover {
  background: var(--hover-bg);
  color: #fff;
  border-color: var(--hover-bg);
}
.inv-item.selected-first {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.inv-item.highlighted {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Stamp Card ─────────────────────────────────────────── */
#stamp-slots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.stamp-slot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--stamp-off);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.3s;
  border: 2px solid transparent;
}
.stamp-slot.filled {
  background: var(--stamp-on);
  border-color: #d4900a;
  animation: stampPop 0.4s ease;
}
@keyframes stampPop {
  0%   { transform: scale(0.6); opacity: 0.5; }
  70%  { transform: scale(1.2); }
  100% { transform: scale(1);   opacity: 1; }
}

/* ── Modals ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  font-family: 'Georgia', serif;
}
.modal-box p {
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 16px;
  color: var(--text);
}
#combo-input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: 24px;
  letter-spacing: 0.3em;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-family: 'Georgia', serif;
  margin-bottom: 16px;
}
#combo-input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.modal-buttons {
  display: flex;
  gap: 10px;
}

.dialog-box { max-width: 520px; }
#dialog-npc-text {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 20px;
  font-style: italic;
}
#dialog-npc-text p { margin-bottom: 6px; }
#dialog-npc-text p:last-child { margin-bottom: 0; }
#dialog-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.dialog-choice {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 10px 14px;
  font-size: 15px;
  font-family: 'Arial', sans-serif;
  text-align: left;
  cursor: pointer;
  border-radius: 2px;
  color: var(--text);
  transition: all 0.12s;
}
.dialog-choice:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Ending ─────────────────────────────────────────────── */
#ending {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
#ending-content { text-align: center; }
#ending-text {
  font-family: 'Georgia', serif;
  font-size: 22px;
  line-height: 2.2;
  color: #fff;
}
#ending-text p {
  opacity: 0;
  animation: fadeIn 1s forwards;
}
#ending-text .ende {
  font-size: 14px;
  color: #888;
  letter-spacing: 0.2em;
  margin-top: 16px;
}
#restart-btn {
  margin-top: 48px;
  border-color: #555;
  color: #999;
}
#restart-btn:hover { background: #555; color: #fff; }

/* ── Scrollbar ──────────────────────────────────────────── */
#main-area::-webkit-scrollbar { width: 4px; }
#main-area::-webkit-scrollbar-track { background: transparent; }
#main-area::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* ── Focus / Accessibility ──────────────────────────────── */
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 700px) {
  #verb-panel { width: 120px; }
  .verb-btn { font-size: 12px; padding: 2px 6px; }
  #room-description { font-size: 16px; }
  #bottom-row { min-height: 70px; }
  #stamp-panel { width: 160px; }
}
