/* =========================================================================
   Kapitänskajüte (#hub-screen.quarters) – Seite nach dem Login, gleiche
   Sprache wie die Startseite: kaltes Nachtmeer, Laternenlicht als einzige
   Wärme, Cinzel für Titel und Zahlen, Crimson Pro für Text.
   Panels (Markt, Bestenliste, Einstellungen …) behalten ihre Regeln in hub.css.
   ========================================================================= */
#hub-screen.quarters {
  --abyss: #061019;
  --tide: #0c1f2b;
  --storm: #263844;
  --brass: #b8893f;
  --lantern: #f0b85a;
  --bone: #ebe1cc;
  --spray: #93b3b6;
  --hair: rgba(184, 137, 63, 0.28);
  --serif: 'Crimson Pro', Georgia, serif;
  --title: 'Cinzel', 'Crimson Pro', Georgia, serif;
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--abyss);
  color: var(--bone);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
}
#hub-screen.quarters.hidden { display: none !important; }
#hub-screen.quarters *, #hub-screen.quarters *::before, #hub-screen.quarters *::after { box-sizing: border-box; }
#hub-screen.quarters h1, #hub-screen.quarters h2, #hub-screen.quarters h3,
#hub-screen.quarters p, #hub-screen.quarters ul, #hub-screen.quarters dl, #hub-screen.quarters dd, #hub-screen.quarters figure { margin: 0; padding: 0; }
#hub-screen.quarters :focus-visible { outline: 2px solid var(--lantern); outline-offset: 3px; border-radius: 4px; }

/* ---------- Navigation ---------- */
.quarters .q-nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 12px clamp(16px, 4vw, 48px);
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: rgba(6, 16, 25, 0.94);
  border-bottom: 1px solid var(--hair);
  position: relative;
  z-index: 3;
}
.quarters .q-wordmark { font-family: var(--title); font-weight: 700; font-size: 20px; letter-spacing: 0.06em; color: var(--lantern); white-space: nowrap; }
.quarters .q-nav-links { display: flex; gap: 4px; }
.quarters .q-link {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 38px; padding: 0 12px; border: 0; border-radius: 4px;
  background: none; color: var(--spray); font: 17px var(--serif); cursor: pointer;
  transition: color .2s, background-color .2s;
}
.quarters .q-link:hover { color: var(--bone); background: rgba(147, 179, 182, 0.08); }
.quarters .q-ic { font-size: 16px; line-height: 1; display: inline-flex; }
.quarters .q-ic img, .quarters .q-icon-btn img { width: 18px; height: 18px; }
.quarters .q-nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.quarters .q-res { font: 600 16px var(--serif); color: var(--bone); font-variant-numeric: tabular-nums; white-space: nowrap; padding: 0 6px; }
.quarters .q-res img { width: 18px; height: 18px; vertical-align: -3px; }
.quarters .q-icon-btn {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(235, 225, 204, 0.22); border-radius: 4px; background: none;
  color: var(--bone); font-size: 16px; cursor: pointer; transition: border-color .2s, color .2s;
}
.quarters .q-icon-btn:hover { border-color: var(--lantern); color: var(--lantern); }
.quarters .q-icon-btn.hidden { display: none; }

/* ---------- Scrollbereich ---------- */
.quarters #hub-content { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.quarters #hub-inner { width: 100%; }

/* ---------- Titelbild mit eigenem Schiff ---------- */
.quarters .q-hero { position: relative; overflow: hidden; isolation: isolate; }
.quarters .q-hero-sea, .quarters .q-hero-sea img { position: absolute; inset: 0; width: 100%; height: 100%; }
.quarters .q-hero-sea img { object-fit: cover; object-position: 70% 50%; }
.quarters .q-hero::after {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(6,16,25,0.92) 0%, rgba(6,16,25,0.6) 38%, rgba(6,16,25,0) 66%),
    linear-gradient(180deg, rgba(6,16,25,0) 70%, var(--abyss) 100%);
}
.quarters .q-hero-inner {
  position: relative; z-index: 1;
  width: min(1180px, calc(100% - 2 * clamp(16px, 4vw, 48px))); margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) 0 clamp(36px, 5vw, 64px);
}
.quarters .q-welcome {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center; gap: 24px; min-height: clamp(360px, 52vh, 520px);
}
.quarters .q-greet { font-style: italic; font-size: 22px; color: var(--spray); }
.quarters #hub-username {
  font-family: var(--title); font-weight: 700; font-size: clamp(40px, 6vw, 78px);
  line-height: 1.02; letter-spacing: 0.01em; color: var(--bone);
  text-shadow: 0 0 40px rgba(240, 184, 90, 0.22);
  overflow-wrap: anywhere;
}
.quarters .q-rank { display: flex; align-items: center; gap: 16px; margin-top: 26px; max-width: 460px; }
.quarters .q-level { font-family: var(--title); font-weight: 700; font-size: 22px; color: var(--lantern); white-space: nowrap; }
.quarters .q-exp { flex: 1; min-width: 0; }
.quarters #hub-exp-bar-channel { height: 6px; border-radius: 3px; background: rgba(147, 179, 182, 0.16); overflow: hidden; }
.quarters #hub-exp-bar { height: 100%; width: 0; background: var(--lantern); box-shadow: 0 0 12px rgba(240, 184, 90, 0.6); transition: width .4s ease-out; }
.quarters #hub-exp-text { display: block; margin-top: 4px; font-size: 14px; color: var(--spray); font-variant-numeric: tabular-nums; }
.quarters .q-waters { margin-top: 10px; color: var(--spray); }
.quarters .q-waters strong { color: var(--bone); font-weight: 600; }
.quarters .hub-hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

.quarters .q-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 28px; border-radius: 4px;
  font: 600 19px var(--serif); text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, box-shadow .2s, border-color .2s;
}
.quarters .q-btn.hidden { display: none; }
.quarters .q-btn-main { border: 0; color: #1c1208; background: var(--lantern); box-shadow: 0 0 0 1px rgba(255,220,150,0.6) inset, 0 10px 34px rgba(240,160,60,0.35); }
.quarters .q-btn-main:hover { background: #ffd07a; box-shadow: 0 0 0 1px rgba(255,230,170,0.8) inset, 0 12px 44px rgba(240,160,60,0.5); }
.quarters .q-btn-main:disabled { background: var(--storm); color: var(--spray); box-shadow: none; cursor: not-allowed; }
.quarters .q-btn-ghost { border: 1px solid rgba(235,225,204,0.35); color: var(--bone); background: rgba(6,16,25,0.35); }
.quarters .q-btn-ghost:hover { border-color: var(--lantern); color: var(--lantern); }

.quarters .q-ship { justify-self: center; text-align: center; }
.quarters .q-ship img {
  width: clamp(260px, 34vw, 500px); aspect-ratio: 1; object-fit: contain;
  filter: drop-shadow(26px 34px 22px rgba(0, 6, 12, 0.65));
  animation: q-ride 7s ease-in-out infinite;
}
.quarters .q-ship figcaption { margin-top: -36px; font-style: italic; font-size: 16px; color: var(--spray); }
@keyframes q-ride { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(7px) rotate(0.7deg); } }

/* Hinweise (Sperre, Discord, Verbindung) über der Begrüßung */
.quarters .q-notices { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.quarters .q-notices > .hidden { display: none !important; }
.quarters #hub-connection-banner { padding: 10px 14px; border-left: 3px solid #e0866f; background: rgba(120, 30, 22, 0.55); font-size: 16px; }
.quarters #ban-notice, .quarters #discord-gate { margin: 0; border-radius: 6px; }
.quarters .q-notices:has(> :not(.hidden)) { margin-bottom: 28px; }

/* ---------- Kennzahlen ---------- */
#hub-screen.quarters dl.q-ledger { width: min(1180px, calc(100% - 2 * clamp(16px, 4vw, 48px))); margin: 0 auto; }
.quarters .q-ledger {
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
}
.quarters .q-ledger > div { padding: 18px 20px; }
.quarters .q-ledger > div:first-child { padding-left: 0; }
.quarters .q-ledger > div + div { border-left: 1px solid rgba(184, 137, 63, 0.16); }
.quarters .q-ledger dt { font-style: italic; font-size: 15px; color: var(--spray); }
.quarters .q-ledger dd { font-family: var(--title); font-weight: 700; font-size: clamp(22px, 2.4vw, 30px); color: var(--bone); font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ---------- Laderaum + Elite ---------- */
.quarters .q-grid {
  width: min(1180px, calc(100% - 2 * clamp(16px, 4vw, 48px))); margin: clamp(40px, 6vw, 72px) auto 0;
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start;
}
.quarters .q-panel h2, .quarters .q-log h2 { font-family: var(--title); font-weight: 700; font-size: clamp(26px, 3vw, 34px); color: var(--bone); line-height: 1.15; }
.quarters .q-panel h3 { margin-top: 22px; margin-bottom: 8px; font: italic 17px var(--serif); color: var(--spray); }
.quarters .q-items { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 22px; }
.quarters .q-item { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(147, 179, 182, 0.1); }
.quarters .q-item.hidden { display: none; }
.quarters .q-item img { width: 34px; height: 34px; border-radius: 4px; object-fit: cover; }
.quarters .q-item-glyph { width: 34px; text-align: center; font-size: 22px; }
.quarters .q-item span { font-size: 17px; line-height: 1.2; color: var(--bone); overflow-wrap: break-word; hyphens: manual; }
.quarters .q-item strong { font: 600 17px var(--serif); color: var(--lantern); font-variant-numeric: tabular-nums; }
.quarters .q-item.q-empty { opacity: 0.42; }
.quarters .q-item.q-empty strong { color: var(--spray); }
.quarters .soon-tag { font-size: 14px; color: var(--spray); }

.quarters .q-elite { padding: 26px 26px 28px; background: linear-gradient(180deg, rgba(12, 31, 43, 0.9), rgba(12, 31, 43, 0.35)); border-top: 2px solid var(--brass); }
.quarters #hub-elite-status { margin-top: 16px; }
.quarters .q-elite-lede { color: var(--spray); margin-bottom: 20px; }
.quarters .q-tier { display: flex; align-items: center; gap: 14px; }
.quarters .q-tier img { width: 150px; height: 150px; margin: -18px 0 -18px -14px; object-fit: contain; filter: drop-shadow(10px 14px 10px rgba(0, 0, 0, 0.6)); }
.quarters .q-tier-label { display: block; font-style: italic; font-size: 15px; color: var(--spray); }
.quarters .q-tier strong { font-family: var(--title); font-weight: 700; font-size: 46px; line-height: 1; color: var(--lantern); }
.quarters .q-tier-bar { margin-top: 18px; height: 6px; border-radius: 3px; background: rgba(147, 179, 182, 0.16); overflow: hidden; }
.quarters .q-tier-bar i { display: block; height: 100%; background: var(--lantern); box-shadow: 0 0 12px rgba(240, 184, 90, 0.6); }
.quarters .q-tier-next { margin-top: 8px; font-size: 16px; color: var(--bone); font-variant-numeric: tabular-nums; }
.quarters .q-elite-hint { margin-top: 14px; font-size: 15px; font-style: italic; color: var(--spray); }

/* ---------- Logbuch ---------- */
.quarters .q-log { width: min(1180px, calc(100% - 2 * clamp(16px, 4vw, 48px))); margin: clamp(48px, 7vw, 88px) auto 0; }
.quarters .q-log.hidden { display: none; }
.quarters #hub-news-list { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; }
.quarters .news-item { display: block; padding: 16px 0 0; border-top: 1px solid var(--brass); }
.quarters .news-icon { display: none; }
.quarters .news-head { display: flex; flex-direction: column-reverse; gap: 2px; }
.quarters .news-head time { font-style: italic; font-size: 14px; color: var(--brass); }
.quarters .news-head strong { font-family: var(--title); font-weight: 600; font-size: 19px; line-height: 1.25; color: var(--bone); }
.quarters .news-body p { margin-top: 8px; font-size: 16px; line-height: 1.6; color: var(--spray); }

/* ---------- Fußzeile ---------- */
.quarters .q-footer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px;
  width: min(1180px, calc(100% - 2 * clamp(16px, 4vw, 48px))); margin: clamp(56px, 8vw, 96px) auto 0;
  padding: 22px 0 calc(28px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid rgba(147, 179, 182, 0.12);
  font-size: 15px; color: var(--spray);
}
.quarters .q-footer-mark { font-family: var(--title); font-weight: 700; color: var(--brass); letter-spacing: 0.05em; margin-right: 8px; }
.quarters .q-footer a { color: var(--spray); opacity: 1; text-decoration: none; }
.quarters .q-footer a:hover { color: var(--bone); text-decoration: underline; }

/* ---------- Kleinere Bildschirme ---------- */
@media (max-width: 1000px) {
  .quarters .q-nav { gap: 14px; }
  .quarters .q-link .q-lbl { display: none; }
  .quarters .q-link { padding: 0 9px; }
  .quarters .q-grid { grid-template-columns: 1fr; }
  .quarters .q-ledger { grid-template-columns: repeat(3, 1fr); }
  .quarters .q-ledger > div:nth-child(4) { border-left: 0; }
  .quarters .q-ledger > div:nth-child(n+4) { border-top: 1px solid rgba(184, 137, 63, 0.16); }
  .quarters .q-ledger > div:nth-child(4) { padding-left: 0; }
}
@media (max-width: 700px) {
  #hub-screen.quarters { font-size: 17px; }
  .quarters .q-nav { gap: 6px; padding-left: 12px; padding-right: 12px; }
  .quarters .q-wordmark { display: none; }
  .quarters .q-nav-links { gap: 0; }
  .quarters .q-nav-actions { gap: 4px; }
  .quarters .q-res { font-size: 14px; padding: 0 3px; }
  .quarters .q-icon-btn { width: 34px; height: 34px; border-color: transparent; }
  /* Kopfleiste passt immer: Links scrollen waagrecht, Gold/Perlen/Knöpfe bleiben stehen */
  .quarters .q-nav-links { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .quarters .q-nav-links::-webkit-scrollbar { display: none; }
  .quarters .q-link { flex: 0 0 auto; padding: 0 7px; }
  .quarters .q-nav-actions { flex: 0 0 auto; margin-left: 0; }
  .quarters .q-hero::after { background: linear-gradient(180deg, rgba(6,16,25,0.2) 0%, rgba(6,16,25,0.75) 48%, var(--abyss) 100%); }
  .quarters .q-hero-sea img { object-position: 50% 30%; }
  .quarters .q-welcome { grid-template-columns: 1fr; min-height: 0; gap: 4px; }
  .quarters .q-ship { order: -1; }
  .quarters .q-ship img { width: min(70vw, 300px); }
  .quarters .q-ship figcaption { margin-top: -18px; }
  .quarters .hub-hero-actions .q-btn { flex: 1 1 100%; }
  .quarters .q-ledger { grid-template-columns: repeat(2, 1fr); }
  .quarters .q-ledger > div { padding: 14px 14px; }
  .quarters .q-ledger > div:nth-child(odd) { padding-left: 0; }
  .quarters .q-ledger > div + div { border-left: 0; }
  .quarters .q-ledger > div:nth-child(even) { border-left: 1px solid rgba(184, 137, 63, 0.16); }
  .quarters .q-ledger > div:nth-child(n+3) { border-top: 1px solid rgba(184, 137, 63, 0.16); }
  .quarters .q-ledger > div:last-child { grid-column: 1 / -1; border-left: 0; }
  .quarters .q-items { grid-template-columns: 1fr 1fr; gap: 0 14px; }
  .quarters .q-item { grid-template-columns: 28px 1fr auto; gap: 8px; }
  .quarters .q-item img { width: 28px; height: 28px; }
  .quarters .q-item span, .quarters .q-item strong { font-size: 15px; }
  .quarters .q-elite { padding: 22px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .quarters .q-ship img { animation: none; }
  .quarters #hub-exp-bar { transition: none; }
}

/* Admin: registrierte / online Spieler in der Kopfleiste */
.quarters .q-admin-stats { position: absolute; top: calc(100% + 10px); right: 24px; z-index: 5; display: inline-flex; align-items: center; gap: 10px; padding: 4px 12px; border: 1px solid rgba(214,176,92,0.35); border-radius: 999px; background: rgba(10,16,20,0.55); font: 600 14px var(--serif); color: var(--bone); white-space: nowrap; font-variant-numeric: tabular-nums; }
.quarters .q-admin-stats.hidden { display: none; }
.quarters .q-admin-stats .qa-item { display: inline-flex; align-items: baseline; gap: 4px; }
.quarters .q-admin-stats small { font-size: 11px; font-weight: 400; opacity: 0.7; }
.quarters .q-admin-stats em { font-style: normal; font-size: 11px; opacity: 0.7; margin-left: 2px; }
.quarters .q-admin-stats .qa-dot { width: 8px; height: 8px; border-radius: 50%; background: #5fd38a; box-shadow: 0 0 6px rgba(95,211,138,0.8); align-self: center; }
@media (max-width: 380px) { .quarters .q-res { font-size: 13px; padding: 0 1px; } .quarters .q-icon-btn { width: 30px; } }
@media (max-width: 720px) { .quarters .q-admin-stats { right: 12px; top: calc(100% + 8px); gap: 8px; padding: 3px 9px; font-size: 13px; } }

/* ===== E-Mail bestätigen (Pflicht) ======================================
   Siegel-Karte über der Kajüte: Laternenlicht auf Nachtblau, ein klarer
   Schritt pro Ansicht. Ohne bestätigte E-Mail nicht schließbar. */
.quarters .eg-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(3, 8, 13, 0.82); backdrop-filter: blur(3px); }
.quarters .eg-overlay.hidden { display: none; }
.quarters .eg-card { position: relative; width: min(440px, 100%); padding: 34px 30px 22px; border: 1px solid var(--hair); border-radius: 14px; background: radial-gradient(120% 80% at 50% 0%, rgba(240,184,90,0.10), transparent 60%), var(--tide); box-shadow: 0 24px 60px rgba(0,0,0,0.55); text-align: center; }
.quarters .eg-seal { width: 64px; height: 64px; margin: -66px auto 10px; display: grid; place-items: center; font-size: 28px; border-radius: 50%; background: var(--abyss); border: 1px solid var(--brass); box-shadow: 0 0 0 6px rgba(184,137,63,0.12); }
.quarters .eg-card h2 { margin: 0 0 6px; font: 700 22px var(--title); letter-spacing: 0.04em; color: var(--lantern); }
.quarters .eg-intro { margin: 0 0 18px; font-size: 16px; color: var(--spray); }
.quarters .eg-step { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.quarters .eg-step.hidden { display: none; }
.quarters .eg-step label { font-size: 14px; color: var(--spray); }
.quarters .eg-step input { width: 100%; padding: 12px 14px; font: 17px var(--serif); color: var(--bone); background: rgba(3,8,13,0.6); border: 1px solid var(--storm); border-radius: 9px; }
.quarters .eg-step input:focus { border-color: var(--lantern); outline: none; }
.quarters #eg-code { font: 700 28px/1 'Cinzel', Georgia, serif; letter-spacing: 0.45em; text-align: center; padding: 14px 10px 14px 22px; }
.quarters .eg-btn { margin-top: 6px; width: 100%; }
.quarters .eg-sent { margin: 0 0 4px; font-size: 16px; text-align: center; }
.quarters .eg-sent strong { color: var(--bone); }
.quarters .eg-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.quarters .eg-links .auth-link:disabled { opacity: 0.5; cursor: default; }
.quarters .eg-hint { margin: 6px 0 0; font-size: 13px; color: var(--spray); opacity: 0.8; text-align: center; }
.quarters .eg-message { min-height: 1.4em; margin: 12px 0 0; font-size: 15px; color: #f08a6e; }
.quarters .eg-message.ok { color: #79d69a; }
.quarters .eg-close { position: absolute; top: 10px; right: 12px; background: none; border: 0; color: var(--spray); font-size: 18px; cursor: pointer; }
.quarters .eg-close.hidden, .quarters .eg-logout.hidden { display: none; }
.quarters .eg-logout { margin-top: 8px; font-size: 14px; }
@media (max-width: 480px) { .quarters .eg-card { padding: 32px 18px 18px; } .quarters #eg-code { font-size: 24px; letter-spacing: 0.35em; } }
@media (prefers-reduced-motion: reduce) { .quarters .eg-overlay { backdrop-filter: none; } }

/* Premium-Karte (Kajüte): gleiche Breite wie Kontobuch und Raster */
#hub-screen.quarters .q-premium { width: min(1180px, calc(100% - 2 * clamp(16px, 4vw, 48px))); margin: 26px auto 0; padding: 18px 22px; border-radius: 4px; border: 1px solid var(--hair); background: linear-gradient(120deg, rgba(38, 56, 68, 0.55), rgba(6, 16, 25, 0.6)); }
#hub-screen.quarters .q-premium.active { border-color: rgba(147, 179, 182, 0.55); box-shadow: inset 0 0 0 1px rgba(147, 179, 182, 0.12); }
#hub-screen.quarters .qp-head h2 { font-family: var(--title); font-weight: 700; font-size: 22px; color: var(--bone); }
#hub-screen.quarters .qp-state { font: italic 16px var(--serif); color: var(--spray); }
#hub-screen.quarters .q-premium.active .qp-state { color: var(--lantern); font-style: normal; }
#hub-screen.quarters .qp-perks li { font: 16px var(--serif); color: var(--bone); padding: 4px 0; border-bottom: 1px solid rgba(147, 179, 182, 0.08); }
#hub-screen.quarters .qp-perks b { font-family: var(--title); color: var(--lantern); min-width: 52px; }
#hub-screen.quarters .qp-how { font: italic 15px var(--serif); color: var(--spray); }
