/* WELTENBRAND — dunkles Weltall-UI. Eine bewusste Ein-Themen-Optik:
   der Planet ist die Buehne, das UI haelt sich zurueck. */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: #05060d;
  color: #e8e4da;
  font: 15px/1.45 system-ui, sans-serif;
  -webkit-user-select: none; user-select: none;
  touch-action: none;
}

#welt, #effekte {
  position: fixed; inset: 0; width: 100%; height: 100%; display: block;
}
#effekte { pointer-events: none; }

.verborgen { display: none !important; }

.schicht {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto;                 /* margin:auto statt center: nichts abschneiden */
  background: rgba(4, 5, 12, 0.55);
}
.schicht > * { margin: auto; }

/* --- Menue --- */
.menuekern {
  width: min(60rem, 94vw); padding: 2rem 1rem 1.4rem; text-align: center;
}
h1 {
  margin: 0; font-size: clamp(2.2rem, 7vw, 4rem); letter-spacing: 0.14em;
  color: #f2c26b;
  text-shadow: 0 0 24px rgba(228, 116, 30, 0.55), 0 2px 2px #000;
}
.untertitel { margin: 0.2rem 0 1.6rem; color: #a89f90; }
.menuespalten {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.9rem; text-align: left;
}
.menueblock {
  background: rgba(14, 17, 30, 0.88); border: 1px solid #2a3049;
  border-radius: 8px; padding: 0.9rem 1rem 1rem;
}
.menueblock h2 {
  margin: 0 0 0.6rem; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: #f2c26b;
}
.menueblock label { display: block; margin: 0.4rem 0; color: #a89f90; font-size: 0.85rem; }
.menueblock select, .menueblock input {
  width: 100%; margin-top: 0.15rem; padding: 0.4rem 0.5rem;
  background: #0a0d18; color: #e8e4da; border: 1px solid #2a3049; border-radius: 5px;
  font: inherit;
}
.beitrittzeile { display: flex; gap: 0.5rem; margin-top: 0.55rem; }
.beitrittzeile input { text-transform: uppercase; letter-spacing: 0.2em; text-align: center; }

.szenarioKnopf {
  display: block; width: 100%; text-align: left; margin: 0.3rem 0;
  padding: 0.5rem 0.65rem; border-radius: 6px; border: 1px solid #2a3049;
  background: #131829; color: #e8e4da; font: inherit; cursor: pointer;
}
.szenarioKnopf:hover, .szenarioKnopf:focus-visible { border-color: #f2c26b; outline: none; }
.szenarioKnopf .sz-name { font-weight: 600; }
.szenarioKnopf .sz-text { display: block; font-size: 0.78rem; color: #a89f90; margin-top: 0.1rem; }
.szenarioKnopf.zu { opacity: 0.45; cursor: not-allowed; }
.szenarioKnopf.geschafft .sz-name::after { content: " ✓"; color: #7dbb8a; }

.btn {
  padding: 0.55rem 1.1rem; border-radius: 6px; border: 1px solid #f2c26b;
  background: linear-gradient(#3a2c14, #241a0b); color: #f6d99a;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-block;
}
.btn:hover, .btn:focus-visible { background: linear-gradient(#4a3a1c, #2e2210); outline: none; }
.btn.zweit { border-color: #3a4258; background: #161b2c; color: #b9b2a4; }
.btn.klein { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
.btn.portal { border-color: #3a4258; background: #161b2c; color: #b9b2a4; }

.fusszeile {
  display: flex; gap: 1rem; align-items: center; justify-content: center;
  flex-wrap: wrap; margin-top: 1.2rem; color: #a89f90; font-size: 0.85rem;
}
.lautst input { vertical-align: middle; width: 90px; }

#bestenliste { margin: 0.4rem 0 0; padding-left: 1.4rem; font-size: 0.85rem; }
#bestenliste li { margin: 0.15rem 0; }
#bestenliste .pkt { float: right; color: #f2c26b; font-variant-numeric: tabular-nums; }

/* --- Tafeln --- */
.tafel {
  background: rgba(14, 17, 30, 0.96); border: 1px solid #2a3049; border-radius: 10px;
  padding: 1.4rem 1.6rem; width: min(26rem, 92vw); text-align: center;
}
.tafel.klein { width: min(20rem, 92vw); }
.tafel h2, .tafel h3 { margin: 0 0 0.6rem; color: #f2c26b; }
.hinweisText { color: #a89f90; font-size: 0.85rem; }
.tastenzeile { display: flex; gap: 0.6rem; justify-content: center; margin-top: 0.9rem; flex-wrap: wrap; }
#lobbyMaechte { list-style: none; margin: 0.8rem 0; padding: 0; text-align: left; }
#lobbyMaechte li { padding: 0.3rem 0.4rem; border-bottom: 1px solid #222840; }
.farbfleck {
  display: inline-block; width: 0.8em; height: 0.8em; border-radius: 50%;
  margin-right: 0.5em; vertical-align: -0.05em;
}

/* --- HUD --- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud > * { pointer-events: auto; }
#kopfleiste {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  padding: 0.5rem 0.8rem; background: linear-gradient(rgba(4,5,12,0.85), transparent);
  font-size: 0.9rem;
}
#rundenAnzeige { color: #f2c26b; font-weight: 600; font-variant-numeric: tabular-nums; }
#zugAnzeige { font-weight: 600; }
#menueKnopf { margin-left: auto; }

#legende {
  position: absolute; top: 3rem; right: 0.6rem; font-size: 0.78rem;
  background: rgba(10, 13, 24, 0.82); border: 1px solid #2a3049; border-radius: 7px;
  padding: 0.45rem 0.6rem;
}
#legende div { margin: 0.12rem 0; }
#legende .tot { opacity: 0.4; text-decoration: line-through; }
#legende .dran::after { content: " ◀"; color: #f2c26b; }

#tutorialTafel {
  position: absolute; top: 3rem; left: 50%; transform: translateX(-50%);
  width: min(30rem, 92vw); background: rgba(14, 17, 30, 0.94);
  border: 1px solid #f2c26b; border-radius: 8px; padding: 0.7rem 0.9rem;
  font-size: 0.88rem;
}

#aktionsleiste {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0.5rem 0.8rem 0.7rem;
  background: linear-gradient(transparent, rgba(4,5,12,0.92) 40%);
  text-align: center;
}
#phasenHilfe { font-size: 0.85rem; color: #d8d2c4; margin-bottom: 0.4rem; min-height: 1.2em; }
#kartenHand { display: flex; gap: 0.4rem; justify-content: center; margin-bottom: 0.4rem; flex-wrap: wrap; }
.karte {
  width: 3.2rem; height: 4.4rem; border-radius: 6px; border: 1px solid #3a4258;
  background: #131829; color: #e8e4da; cursor: pointer; font: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem;
}
.karte .sym { font-size: 1.4rem; }
.karte .nm { font-size: 0.62rem; color: #a89f90; }
.karte.an { border-color: #f2c26b; box-shadow: 0 0 8px rgba(242, 194, 107, 0.5); }

#zuschauerleiste {
  position: absolute; bottom: 0; left: 0; right: 0; text-align: center;
  padding: 0.55rem; background: rgba(4,5,12,0.85); color: #f2c26b; font-size: 0.9rem;
}

#hinweise {
  position: absolute; bottom: 8.5rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 0.3rem; align-items: center;
  pointer-events: none;
}
.hinweis {
  background: rgba(14, 17, 30, 0.92); border: 1px solid #2a3049; border-radius: 6px;
  padding: 0.4rem 0.8rem; font-size: 0.85rem; animation: hinweisAuf 0.25s ease-out;
}
.hinweis.schlecht { border-color: #b04a3a; color: #f0b0a0; }
@keyframes hinweisAuf { from { opacity: 0; transform: translateY(8px); } }

/* --- Mengenwahl --- */
#mengenWert { font-size: 1.6rem; font-weight: 700; color: #f2c26b; font-variant-numeric: tabular-nums; }
#mengenRegler { width: 100%; }

/* --- Wuerfel --- */
#wuerfelTafel {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%);
  z-index: 15; text-align: center; pointer-events: none;
}
.wuerfelreihe { display: flex; gap: 0.5rem; justify-content: center; margin: 0.3rem 0; }
.wuerfel {
  width: 2.6rem; height: 2.6rem; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; color: #fff;
  animation: wuerfelRoll 0.45s ease-out;
  box-shadow: 0 4px 10px rgba(0,0,0,0.6);
}
.wuerfel.a { background: linear-gradient(160deg, #c0392b, #7a1f14); }
.wuerfel.v { background: linear-gradient(160deg, #5d6d7e, #2c3949); }
.wuerfel.verlierer { opacity: 0.35; }
@keyframes wuerfelRoll {
  0% { transform: rotate(260deg) scale(0.2) translateY(-40px); opacity: 0; }
  70% { transform: rotate(-14deg) scale(1.1); }
  100% { transform: rotate(0) scale(1); opacity: 1; }
}
#wuerfelA, #wuerfelV { font-size: 1rem; font-weight: 600; text-shadow: 0 1px 3px #000; margin: 0.2rem 0; }
#wuerfelErgebnis { font-size: 0.75rem; opacity: 0.85; color: #f2c26b; text-shadow: 0 1px 2px #000; }

@media (prefers-reduced-motion: reduce) {
  .wuerfel, .hinweis { animation: none; }
}

@media (max-width: 640px) {
  #legende { display: none; }
  .menuekern { padding-top: 1rem; }
}
