/* Secret HQ Showroom — UI */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --gold: #e8c368;
  --gold-dim: #a8893f;
  --ink: #0b0b12;
  --panel: rgba(16, 15, 26, 0.96);
}
html, body { height: 100%; overflow: hidden; background: #000; }
body { font-family: 'Segoe UI', system-ui, sans-serif; color: #eee; user-select: none; }
#app, #game { position: absolute; inset: 0; width: 100%; height: 100%; }
.hidden { display: none !important; }

/* ---------- Overlays ---------- */
.overlay {
  position: absolute; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 35%, #1a1730 0%, #0b0a14 65%, #050408 100%);
}
#pause { background: rgba(5, 4, 10, 0.82); backdrop-filter: blur(6px); }
.loader-inner, .start-inner { text-align: center; max-width: 720px; padding: 24px; }
.palace-icon { font-size: 64px; margin-bottom: 12px; filter: drop-shadow(0 0 24px rgba(232,195,104,.5)); }
.title-gold {
  font-size: 42px; letter-spacing: 6px; font-weight: 800;
  background: linear-gradient(180deg, #fff3c9 0%, var(--gold) 45%, #8a6a25 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 30px rgba(232, 195, 104, 0.25);
}
.title-gold.small { font-size: 24px; letter-spacing: 3px; margin-bottom: 10px; }
.subtitle { color: #b9b3d0; margin: 10px 0 22px; font-size: 15px; letter-spacing: 1px; }
.progress { width: 380px; max-width: 82vw; height: 10px; margin: 0 auto 12px; border-radius: 6px; background: #232038; overflow: hidden; border: 1px solid #3a3560; position: relative; }
#progress-bar { width: 0%; height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); transition: width .25s ease; }
/* Licht-Schimmer läuft IMMER über die Leiste — auch wenn gerade kein Byte ankommt,
   sieht der Loader nie „eingefroren" aus */
.progress::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 20%, rgba(255, 243, 201, 0.28) 50%, transparent 80%);
  transform: translateX(-100%); animation: shq-shimmer 1.7s ease-in-out infinite;
}
@keyframes shq-shimmer { to { transform: translateX(100%); } }
#loader-status { color: #8f88ad; font-size: 13px; }
#loader-detail { color: #6f6890; font-size: 12px; margin-top: 4px; min-height: 1.2em; font-variant-numeric: tabular-nums; }
#loader-tip { color: #a99f68; font-size: 12.5px; font-style: italic; margin-top: 16px; min-height: 1.3em; opacity: .85; }
#loader-2d { display: inline-block; margin-top: 12px; color: var(--gold); font-size: 13px; text-decoration: underline; }
.start-stats { display: flex; gap: 26px; justify-content: center; margin-bottom: 26px; color: #cfc8e8; font-size: 14px; }
.start-stats b { color: var(--gold); font-size: 20px; display: block; }
#enter-btn, #resume-btn {
  font-size: 20px; padding: 14px 44px; cursor: pointer; border-radius: 10px;
  border: 1px solid var(--gold-dim); color: var(--ink); font-weight: 700; letter-spacing: 1px;
  background: linear-gradient(180deg, #f4dc9a, var(--gold) 55%, #b98f3e);
  box-shadow: 0 4px 30px rgba(232, 195, 104, 0.35);
  transition: transform .12s, box-shadow .12s;
}
#enter-btn:hover, #resume-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 40px rgba(232,195,104,.5); }
.controls-grid {
  display: grid; grid-template-columns: repeat(5, auto); gap: 8px 22px; justify-content: center;
  margin: 26px 0 18px; color: #a49dc4; font-size: 13px;
}
.controls-grid b { color: #efe9ff; background: #2a2545; border: 1px solid #453d70; border-radius: 5px; padding: 1px 7px; margin-right: 5px; font-size: 12px; }
.credits-line { color: #6e6890; font-size: 11.5px; line-height: 1.6; margin-top: 8px; }
.pause-opts { margin: 20px 0 14px; display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: center; color: #cfc8e8; font-size: 14px; }
.pause-opts label { display: flex; align-items: center; gap: 6px; }
.pause-opts input { accent-color: var(--gold); }
/* Qualitäts-Dropdown klar sichtbar (war ungestylt → dunkel auf dunkel / übersehen) */
.pause-opts select {
  background: #1a1430; color: #f2dfa0; border: 1px solid var(--gold); border-radius: 8px;
  padding: 7px 12px; font: 600 14px 'Segoe UI', sans-serif; cursor: pointer; -webkit-appearance: menulist;
}
.pause-opts select:focus { outline: 2px solid var(--gold); }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
#crosshair {
  position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px;
  border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 0 6px rgba(0,0,0,.8);
}
#interact-hint {
  position: absolute; left: 50%; top: 56%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--gold-dim); border-radius: 8px;
  padding: 8px 16px; font-size: 14px; color: #e8e2f8;
}
#interact-hint b { color: var(--ink); background: var(--gold); border-radius: 4px; padding: 1px 8px; margin-right: 8px; }
#stamina-wrap {
  position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%);
  width: 240px; height: 7px; border-radius: 5px; background: rgba(20,18,34,.7);
  border: 1px solid rgba(120,110,170,.35); opacity: 0; transition: opacity .35s;
}
#stamina-bar { width: 100%; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #7ee08a, #c8e87a); transition: background .2s; }
#stamina-bar.low { background: linear-gradient(90deg, #e0655c, #e8a05c); }
#room-toast {
  position: absolute; left: 50%; top: 12%; transform: translateX(-50%); text-align: center;
  font-size: 30px; letter-spacing: 4px; font-weight: 700; color: var(--gold);
  text-shadow: 0 2px 18px rgba(0,0,0,.9); animation: roomfade 3.4s forwards;
}
#room-toast small { display: block; font-size: 13px; letter-spacing: 2px; color: #cfc8e8; font-weight: 400; margin-top: 6px; }
@keyframes roomfade { 0% {opacity:0; transform:translateX(-50%) translateY(14px);} 12% {opacity:1; transform:translateX(-50%);} 78% {opacity:1;} 100% {opacity:0;} }
#achievement {
  position: absolute; right: 26px; top: 22%; max-width: 300px;
  background: var(--panel); border: 1px solid var(--gold); border-radius: 10px;
  padding: 12px 18px; font-size: 14px; color: #f5f0e2;
  box-shadow: 0 4px 30px rgba(232,195,104,.25); animation: achfade 4.5s forwards;
}
@keyframes achfade { 0% {opacity:0; transform:translateX(30px);} 8% {opacity:1; transform:none;} 85% {opacity:1;} 100% {opacity:0;} }
#hud-stats {
  position: absolute; left: 18px; bottom: 14px; color: #b6afd2; font-size: 12.5px;
  background: rgba(10,9,18,.55); padding: 6px 12px; border-radius: 8px; letter-spacing: .4px;
}
#track-toast {
  position: absolute; right: 18px; bottom: 14px; color: #b6afd2; font-size: 12.5px;
  background: rgba(10,9,18,.55); padding: 6px 12px; border-radius: 8px; animation: achfade 5s forwards;
}
/* HUD-Identität + Punkte */
#hud-id {
  position: absolute; left: 16px; top: 14px; display: flex; align-items: center; gap: 10px;
  background: rgba(10,9,18,.6); border: 1px solid rgba(232,195,104,.35); border-radius: 30px;
  padding: 5px 16px 5px 6px;
  /* rechts Platz für den Punktestand lassen — verhindert Überlapp auf schmalen Screens
     ohne fixe Breakpoints; der Name schrumpft per Flex-Ellipse */
  max-width: calc(100vw - 210px); box-sizing: border-box;
}
#hud-avatar {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--gold);
  background: #2a2545; object-fit: cover;
}
/* min-width:0 + flex-shrink lässt den Namen im begrenzten Container schrumpfen (Ellipse greift) */
#hud-name { color: #efe9ff; font-size: 14px; font-weight: 600; max-width: 180px; min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Online-Zähler separat: darf NICHT unter die Namens-Ellipse fallen */
#hud-online { color: var(--gold); font-size: 12px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
#hud-online:empty { display: none; }
#hud-points {
  position: absolute; right: 16px; top: 14px; text-align: right;
  background: rgba(10,9,18,.6); border: 1px solid rgba(232,195,104,.35); border-radius: 10px;
  padding: 6px 16px; max-width: 170px; box-sizing: border-box; overflow: hidden;
}
#hud-points-value { color: var(--gold); font-size: 20px; font-weight: 800; letter-spacing: .5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hud-points-label { display: block; color: #8f88ad; font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#quest-toast {
  position: absolute; left: 50%; top: 22%; transform: translateX(-50%); text-align: center;
  background: linear-gradient(180deg, rgba(40,33,14,.95), rgba(24,20,10,.95));
  border: 1px solid var(--gold); border-radius: 12px; padding: 14px 30px;
  color: #f5f0e2; font-size: 17px; box-shadow: 0 6px 40px rgba(232,195,104,.35);
  animation: achfade 5s forwards;
}
#quest-toast small { display: block; color: var(--gold); font-size: 15px; font-weight: 700; margin-top: 4px; }
/* Quest-Log */
#quest-overlay {
  position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  background: rgba(4,3,9,.8); backdrop-filter: blur(5px);
}
#quest-list { text-align: left; max-width: 620px; max-height: 62vh; overflow-y: auto; }
.quest-row {
  display: flex; gap: 12px; align-items: baseline; padding: 9px 12px; border-bottom: 1px solid #2a2545;
  font-size: 14px; color: #cfc8e8;
}
.quest-row.done { opacity: .55; }
.quest-row .q-icon { font-size: 18px; }
.quest-row .q-body { flex: 1; min-width: 0; }
.quest-row .q-title { color: #efe9ff; font-weight: 700; }
.quest-row.done .q-title { text-decoration: line-through; }
.quest-row .q-desc { font-size: 12.5px; color: #8f88ad; margin-top: 2px; }
.quest-row .q-bar { height: 5px; background: #221d3a; border-radius: 3px; margin-top: 6px; overflow: hidden; }
.quest-row .q-bar > span { display: block; height: 100%; background: linear-gradient(90deg, #b98f3e, var(--gold)); border-radius: 3px; }
.quest-row .q-prog { font-size: 11px; color: var(--gold); margin-top: 3px; opacity: .85; }
.quest-row.summary { border-top: 1px solid rgba(232,195,104,.35); border-bottom: none; margin-top: 4px; }
.quest-row.summary .q-title { color: var(--gold); }
.quest-row .q-pts { color: var(--gold); font-weight: 700; white-space: nowrap; }

#narrator {
  position: absolute; left: 50%; bottom: 15%; transform: translateX(-50%);
  max-width: 640px; text-align: center; font-family: Georgia, serif; font-style: italic;
  font-size: 19px; color: #efe7d0; line-height: 1.5; padding: 10px 26px;
  text-shadow: 0 2px 14px rgba(0,0,0,.95), 0 0 4px rgba(0,0,0,.9);
  animation: narrfade 7s forwards; pointer-events: none;
}
@keyframes narrfade {
  0% { opacity: 0; transform: translateX(-50%) translateY(8px); }
  6% { opacity: 1; transform: translateX(-50%); }
  86% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- Art Panel ---------- */
#art-panel {
  position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  background: rgba(4, 3, 9, 0.78); backdrop-filter: blur(5px);
}
.panel-card {
  position: relative; display: flex; gap: 0; max-width: min(1150px, 94vw); max-height: 88vh;
  background: var(--panel); border: 1px solid #3a3560; border-radius: 14px; overflow: hidden;
  box-shadow: 0 10px 60px rgba(0,0,0,.7);
}
.panel-img-wrap { flex: 1.4; min-width: 320px; display: flex; align-items: center; justify-content: center; background: #08070e; }
#panel-img { max-width: 100%; max-height: 88vh; object-fit: contain; }
.panel-meta { flex: 1; padding: 30px 28px; overflow-y: auto; min-width: 300px; max-width: 420px; }
#panel-close {
  position: absolute; top: 10px; right: 12px; z-index: 2; background: rgba(30,27,50,.8); color: #cfc8e8;
  border: 1px solid #453d70; border-radius: 50%; width: 34px; height: 34px; font-size: 15px; cursor: pointer;
}
.rarity-badge { display: inline-block; font-size: 11px; letter-spacing: 2px; font-weight: 700; padding: 4px 12px; border-radius: 20px; margin-bottom: 14px; text-transform: uppercase; }
.panel-meta h2 { font-size: 24px; color: #fff; margin-bottom: 6px; line-height: 1.25; }
#panel-artist { color: var(--gold); font-size: 15px; margin-bottom: 14px; }
#panel-desc { color: #b9b3d0; font-size: 14px; line-height: 1.55; margin-bottom: 16px; font-style: italic; }
#panel-facts { font-size: 13.5px; color: #cfc8e8; line-height: 1.9; margin-bottom: 20px; }
#panel-facts b { color: #8f88ad; font-weight: 600; display: inline-block; min-width: 108px; }
.panel-actions { display: flex; gap: 12px; }
.panel-actions button, .panel-actions a {
  flex: 1; text-align: center; padding: 10px 12px; border-radius: 8px; font-size: 14px; cursor: pointer;
  border: 1px solid #453d70; background: #221e3c; color: #e8e2f8; text-decoration: none; pointer-events: auto;
}
.panel-actions button.faved { border-color: #e0655c; color: #ff9a93; }
.panel-actions a { border-color: var(--gold-dim); color: var(--gold); }
.panel-actions button:hover, .panel-actions a:hover { filter: brightness(1.25); }

/* ---------- Map / Help ---------- */
#map-overlay, #help-overlay {
  position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  background: rgba(4,3,9,.8); backdrop-filter: blur(5px);
}
.map-card {
  background: var(--panel); border: 1px solid #3a3560; border-radius: 14px; padding: 22px 26px; text-align: center;
  max-width: 94vw; max-height: 92vh; overflow: auto;
}
#map-canvas { border-radius: 8px; cursor: pointer; max-width: 100%; }
.map-hint { color: #8f88ad; font-size: 12.5px; margin-top: 10px; }
#help-content { text-align: left; color: #cfc8e8; font-size: 14px; line-height: 1.8; max-width: 640px; }
#help-content h3 { color: var(--gold); margin: 14px 0 4px; font-size: 15px; }
#help-content b { color: #efe9ff; }

@media (max-width: 900px) {
  .panel-card { flex-direction: column; overflow-y: auto; }
  .panel-img-wrap { min-width: 0; flex: none; }
  #panel-img { max-height: 46vh; }
  .panel-meta { max-width: none; flex: none; overflow-y: visible; }
  .controls-grid { grid-template-columns: repeat(3, auto); }
  .title-gold { font-size: 30px; }
}
