:root {
  color-scheme: dark;
  --filz: #075239;
  --filz-hell: #0c6b49;
  --nacht: #071d17;
  --nacht-2: #0b2b22;
  --creme: #fff8df;
  --gold: #f0c85a;
  --gold-dunkel: #b98a26;
  --gruen-team: #78e09c;
  --rot-team: #ff8e8e;
  --linie: rgba(255, 248, 223, 0.18);
  --schatten: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--creme);
  background:
    radial-gradient(circle at 50% 30%, rgba(35, 151, 103, 0.2), transparent 38%),
    linear-gradient(145deg, #041510, var(--nacht) 48%, #09261e);
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.lobby-app { min-height: 100vh; }

.lobby-topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 12px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--linie);
  background: rgba(4, 21, 16, 0.8);
  backdrop-filter: blur(16px);
}

.marke {
  display: inline-flex;
  align-items: center;
  color: var(--creme);
  text-decoration: none;
}

.marke strong, .marke small { display: block; }
.marke strong { letter-spacing: 0.01em; }
.marke small { margin-top: 2px; color: rgba(255, 248, 223, 0.65); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }

.server-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 248, 223, 0.72);
  font-size: 13px;
}

.status-punkt { width: 8px; height: 8px; border-radius: 50%; background: #e2a84a; box-shadow: 0 0 0 4px rgba(226, 168, 74, 0.12); }
.server-status.online .status-punkt { background: #69db91; box-shadow: 0 0 0 4px rgba(105, 219, 145, 0.12); }
.server-status.offline .status-punkt { background: #ff7777; box-shadow: 0 0 0 4px rgba(255, 119, 119, 0.12); }

.sekundaer-link {
  padding: 9px 13px;
  border: 1px solid var(--linie);
  border-radius: 9px;
  color: var(--creme);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.sekundaer-link:hover { border-color: var(--gold); color: var(--gold); }
.lobby-navigation { display: flex; align-items: center; gap: 7px; }

.lobby-main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: clamp(42px, 7vw, 86px) 0; }

.einstieg-kopf { max-width: 720px; margin: 0 auto 42px; text-align: center; }
.eyebrow { margin: 0 0 12px; color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 6vw, 68px); font-weight: 500; line-height: 1.02; letter-spacing: -0.035em; }
.einstieg-kopf > p:last-child { max-width: 620px; margin: 20px auto 0; color: rgba(255, 248, 223, 0.67); font-size: 17px; line-height: 1.65; }

.einstieg-optionen { display: grid; grid-template-columns: 1fr 58px 1fr; align-items: stretch; max-width: 980px; margin: 0 auto; }
.aktionskarte { position: relative; min-width: 0; padding: clamp(25px, 4vw, 42px); border: 1px solid var(--linie); border-radius: 18px; background: linear-gradient(145deg, rgba(12, 67, 49, 0.84), rgba(7, 35, 27, 0.92)); box-shadow: var(--schatten); }
.karten-nummer { position: absolute; top: 24px; right: 26px; color: rgba(240, 200, 90, 0.45); font: 700 12px/1 ui-monospace, monospace; letter-spacing: 0.12em; }
.aktionskarte h2, .raum-panel h2 { margin: 0; font-size: 20px; }
.aktionskarte > p { min-height: 48px; margin: 12px 0 28px; color: rgba(255, 248, 223, 0.62); line-height: 1.5; }
label { display: block; margin: 16px 0 7px; color: rgba(255, 248, 223, 0.82); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
input, select { width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid rgba(255, 248, 223, 0.24); border-radius: 9px; outline: none; color: var(--creme); background: rgba(0, 0, 0, 0.18); }
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(240, 200, 90, 0.12); }
input::placeholder { color: rgba(255, 248, 223, 0.34); }
.code-eingabe { font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase; }
.primaer-button { width: 100%; min-height: 48px; margin-top: 24px; border: 0; border-radius: 10px; color: #1d2416; background: linear-gradient(180deg, #ffe386, var(--gold)); box-shadow: 0 8px 25px rgba(240, 200, 90, 0.18); font-weight: 900; cursor: pointer; }
.primaer-button:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.primaer-button:disabled { cursor: not-allowed; opacity: 0.42; box-shadow: none; }
.oder { display: grid; place-items: center; color: rgba(255, 248, 223, 0.38); font-size: 12px; text-transform: uppercase; }
.oder::before { content: ""; position: absolute; width: 1px; height: 120px; background: var(--linie); }
.oder span { position: relative; padding: 8px 0; background: var(--nacht); }

.raumansicht { animation: erscheinen 240ms ease-out; }
@keyframes erscheinen { from { opacity: 0; transform: translateY(8px); } }
.raum-kopf { display: flex; align-items: end; justify-content: space-between; gap: 26px; margin-bottom: 30px; }
.raum-kopf h1 { font-size: clamp(34px, 5vw, 55px); }
.raumcode-box { width: 310px; min-width: 310px; padding: 15px 18px; border: 1px solid rgba(240, 200, 90, 0.38); border-radius: 13px; background: rgba(240, 200, 90, 0.07); }
.raumcode-box span { display: block; color: rgba(255, 248, 223, 0.55); font-size: 10px; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; }
.raumcode-box strong { display: inline-block; margin-top: 5px; color: var(--gold); font: 800 25px/1 ui-monospace, monospace; letter-spacing: 0.16em; }
.raumcode-aktionen { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 10px; }
.raumcode-box button { padding: 3px 0; border: 0; color: var(--creme); background: transparent; font-size: 12px; text-decoration: underline; cursor: pointer; }
.raumcode-box button:hover { color: var(--gold); }

.raum-inhalt { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 26px; }
.tischbereich { min-width: 0; padding: 18px; border: 1px solid var(--linie); border-radius: 20px; background: rgba(5, 27, 20, 0.72); box-shadow: var(--schatten); }
.team-legende { display: flex; justify-content: center; gap: 24px; margin: 2px 0 16px; color: rgba(255, 248, 223, 0.62); font-size: 12px; }
.team-punkt { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; }
.team-punkt.team-0 { background: var(--gruen-team); }
.team-punkt.team-1 { background: var(--rot-team); }

.jass-tisch { position: relative; min-height: 570px; border: 6px solid #5b3217; border-radius: 18px; background: radial-gradient(ellipse at center, var(--filz-hell), var(--filz) 76%); box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.45), 0 0 10px rgba(0, 0, 0, 0.55); }
.jass-tisch::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; pointer-events: none; }
.tisch-mitte { position: absolute; inset: 50% auto auto 50%; z-index: 1; display: grid; justify-items: center; transform: translate(-50%, -50%); color: rgba(255, 248, 223, 0.72); }
.tisch-mitte img { opacity: 0.7; }
.tisch-mitte .tisch-logo-ng257 {
  width: 74px;
  height: 48px;
  border: 2px solid rgba(240, 200, 90, .72);
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 50%;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .28);
  opacity: .92;
}
.tisch-mitte strong { margin-top: 5px; color: rgba(240, 200, 90, 0.8); font-family: Georgia, serif; letter-spacing: 0.18em; }
.tisch-mitte span { margin-top: 7px; font-size: 11px; }

.sitz { position: absolute; z-index: 2; width: min(250px, 35%); min-height: 106px; padding: 14px; border: 2px solid #ffd700; border-radius: 12px; background: rgba(4, 25, 18, 0.9); box-shadow: 0 0 0 2px rgba(255, 215, 0, .12), 0 10px 25px rgba(0,0,0,.28); }
.sitz-oben { top: 18px; left: 50%; transform: translateX(-50%); }
.sitz-unten { bottom: 18px; left: 50%; transform: translateX(-50%); }
.sitz-links { top: 50%; left: 18px; transform: translateY(-50%); }
.sitz-rechts { top: 50%; right: 18px; transform: translateY(-50%); }
.sitz.team-0 {
  border-color: #ffd700;
  background: linear-gradient(135deg, rgba(20, 85, 58, 0.97), rgba(4, 25, 18, 0.94));
  box-shadow: 0 0 0 2px rgba(255, 215, 0, .12), 0 10px 25px rgba(0,0,0,.28);
}
.sitz.team-1 {
  border-color: #ffd700;
  background: linear-gradient(135deg, rgba(91, 42, 39, 0.96), rgba(35, 23, 20, 0.95));
  box-shadow: 0 0 0 2px rgba(255, 215, 0, .12), 0 10px 25px rgba(0,0,0,.28);
}
.sitz.team-0 .sitz-avatar {
  color: #0a3d28;
  background: var(--gruen-team);
}
.sitz.team-1 .sitz-avatar {
  color: #52201f;
  background: var(--rot-team);
}
.sitz-kopf { display: flex; align-items: center; gap: 10px; }
.sitz-avatar { position: relative; width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--nacht); background: var(--creme); font-weight: 900; }
.sitz-avatar-frei::before,
.sitz-avatar-frei::after { content: ""; position: absolute; inset: 50% auto auto 50%; border-radius: 2px; background: currentColor; transform: translate(-50%, -50%); }
.sitz-avatar-frei::before { width: 12px; height: 2px; }
.sitz-avatar-frei::after { width: 2px; height: 12px; }
.sitz-meta { min-width: 0; }
.sitz-meta strong, .sitz-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sitz-meta span { margin-top: 2px; color: rgba(255, 248, 223, 0.5); font-size: 11px; }
.sitz-aktion { display: flex; gap: 7px; margin-top: 12px; }
.sitz button { min-height: 30px; flex: 1; border: 1px solid rgba(255, 248, 223, 0.24); border-radius: 7px; color: var(--creme); background: rgba(255,255,255,.07); font-size: 11px; font-weight: 800; cursor: pointer; }
.sitz button:hover { border-color: var(--gold); color: var(--gold); }
.du-badge { margin-left: auto; padding: 3px 6px; border-radius: 5px; color: var(--gold); background: rgba(240, 200, 90, 0.12); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.host-sitz-badge { margin-left: auto; padding: 3px 6px; border: 1px solid rgba(240, 200, 90, .55); border-radius: 5px; color: var(--gold); background: rgba(240, 200, 90, .1); font-size: 8px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.host-sitz-badge + .du-badge { margin-left: 2px; }

.raum-panel { display: flex; flex-direction: column; border: 1px solid var(--linie); border-radius: 18px; background: linear-gradient(160deg, rgba(12, 62, 46, .82), rgba(5, 29, 22, .94)); box-shadow: var(--schatten); }
.panel-block { padding: 22px; border-bottom: 1px solid var(--linie); }
.panel-block p { margin: 10px 0 0; color: rgba(255, 248, 223, 0.62); font-size: 13px; line-height: 1.5; }
.panel-titelzeile { display: flex; align-items: center; gap: 8px; }
.host-badge { margin-left: auto; padding: 4px 7px; border: 1px solid rgba(240, 200, 90, 0.35); border-radius: 999px; color: var(--gold); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.fortschritt { height: 5px; margin-top: 17px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.09); }
.fortschritt span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--gold); transition: width 200ms ease; }
.kleiner-hinweis { font-size: 11px !important; }
.start-block { margin-top: auto; }
.start-block .primaer-button { margin-top: 0; }
.sekundaer-button { width: 100%; min-height: 42px; margin-bottom: 10px; border: 1px solid rgba(240, 200, 90, .65); border-radius: 9px; color: #fff6a8; background: rgba(0, 0, 0, .18); font-weight: 800; cursor: pointer; }
.sekundaer-button:disabled { opacity: .4; cursor: not-allowed; }
.sekundaer-button.ist-bereit { color: #092116; background: #9be9a8; border-color: #9be9a8; }
.text-button { min-height: 44px; margin: 10px 18px 18px; border: 0; color: rgba(255, 248, 223, 0.58); background: transparent; cursor: pointer; }
.text-button:hover { color: var(--creme); }

.meldung { position: fixed; right: 20px; bottom: 20px; z-index: 20; max-width: min(380px, calc(100vw - 40px)); padding: 13px 16px; border: 1px solid rgba(240, 200, 90, .45); border-radius: 10px; color: var(--creme); background: #143c2f; box-shadow: var(--schatten); font-size: 13px; }
.meldung.fehler { border-color: rgba(255, 119, 119, .55); background: #4b2525; }

.einladung-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(1, 12, 9, .78);
  backdrop-filter: blur(8px);
}
.einladung-modal[hidden] { display: none; }
.einladung-dialog {
  position: relative;
  width: min(410px, 100%);
  padding: 28px;
  border: 1px solid rgba(240, 200, 90, .58);
  border-radius: 18px;
  color: var(--creme);
  background: linear-gradient(155deg, #0b4a36, #051f18);
  box-shadow: var(--schatten);
  text-align: center;
}
.einladung-dialog h2 { margin: 0; font-size: 23px; }
.einladung-dialog > p:not(.eyebrow) { margin: 14px 0 8px; color: rgba(255, 248, 223, .66); font-size: 13px; }
.einladung-schliessen { position: absolute; top: 9px; right: 12px; padding: 5px 9px; border: 0; color: rgba(255, 248, 223, .7); background: transparent; font-size: 26px; cursor: pointer; }
.einladung-schliessen:hover { color: var(--gold); }
.einladung-qr { width: 230px; height: 230px; display: grid; place-items: center; margin: 22px auto 10px; padding: 12px; border-radius: 12px; background: #fff; }
.einladung-qr svg { display: block; width: 100%; height: 100%; }
.einladung-link { display: block; overflow: hidden; color: var(--gold); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.einladung-dialog .primaer-button { margin-top: 18px; }
.beitritt-eingeladen { border-color: rgba(240, 200, 90, .65); box-shadow: 0 0 0 3px rgba(240, 200, 90, .1), var(--schatten); }

@media (max-width: 880px) {
  .lobby-topbar { flex-wrap: wrap; gap: 10px 16px; }
  .server-status { order: 3; width: 100%; margin-left: 0; }
  .lobby-navigation { margin-left: auto; }
  .einstieg-optionen { grid-template-columns: 1fr; gap: 14px; }
  .oder { min-height: 28px; }
  .oder::before { width: 120px; height: 1px; }
  .oder span { padding: 0 8px; }
  .raum-inhalt { grid-template-columns: 1fr; }
  .raum-panel { order: -1; }
}

@media (max-width: 620px) {
  .lobby-main { width: min(100% - 20px, 1180px); padding-top: 32px; }
  .marke strong { font-size: 14px; }
  .sekundaer-link { font-size: 11px; }
  .lobby-navigation { width: 100%; margin-left: 0; }
  .lobby-navigation .sekundaer-link { flex: 1; padding-inline: 7px; text-align: center; }
  .raum-kopf { align-items: stretch; flex-direction: column; }
  .raumcode-box { width: auto; min-width: 0; }
  .raumcode-aktionen { justify-content: space-between; }
  .tischbereich {
    padding: 10px;
    border-color: rgba(255, 248, 223, .2);
    background: linear-gradient(155deg, rgba(5, 32, 24, .96), rgba(2, 18, 14, .98));
    box-shadow: 0 18px 42px rgba(0, 0, 0, .34);
  }
  .jass-tisch {
    min-height: 680px;
    border-width: 5px;
    border-radius: 14px;
    background: radial-gradient(ellipse at center, #0b8255 0%, #076344 48%, #04402f 100%);
    box-shadow: inset 0 0 38px rgba(0, 0, 0, .48), 0 0 10px rgba(0, 0, 0, .55);
  }
  .sitz { width: min(86%, 340px); min-height: 91px; }
  .sitz-oben {
    top: 14px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  .sitz-unten {
    bottom: 14px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
  .sitz-links,
  .sitz-rechts {
    width: min(74%, 300px);
    bottom: auto;
    transform: none;
  }
  .sitz-links {
    top: 24%;
    left: 12px;
    right: auto;
  }
  .sitz-rechts {
    top: 62%;
    left: auto;
    right: 12px;
  }
  .tisch-mitte { opacity: .88; }
}
