/* ============================================================
   QUINT KI SCHULE – Stylesheet
   ============================================================ */

:root {
  /* QUINT Gold-on-Void – vereinheitlicht mit quint-marketplace.de */
  --bg: #0A0A0B;
  --bg-2: #121216;
  --panel: #17171d;
  --panel-2: #1f1f28;
  --border: #2c2820;
  --text: #EDE7D9;
  --text-dim: #8f887a;
  --accent: #F5D78E;
  --accent-2: #6c8cff;
  --green: #3ddc84;
  --red: #ff5d6c;
  --shadow: 0 18px 60px rgba(0, 0, 0, .6);
  font-size: 16px;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  overflow: hidden;
}

.hidden { display: none !important; }

button { font-family: inherit; cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 10px;
  padding: .6rem 1.1rem;
  font-size: .95rem;
  transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, #ffd447, #ffb347);
  border: none;
  color: #1b1400;
  font-weight: 700;
}
.btn-ghost { background: transparent; }
.btn-big { font-size: 1.15rem; padding: .85rem 1.6rem; }

/* ---------- Overlays ---------- */
.fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, .82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}

/* ---------- Intro ---------- */
.intro-card {
  max-width: 640px;
  width: 100%;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 2.4rem 2.2rem;
  text-align: center;
  box-shadow: var(--shadow);
  animation: pop .4s ease;
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.intro-logo { font-size: 4rem; }
.intro-card h1 {
  font-size: 2.4rem;
  letter-spacing: .12em;
  margin: .4rem 0 .6rem;
}
.ki-glow {
  color: var(--accent);
  text-shadow: 0 0 18px rgba(255, 212, 71, .8);
}
.intro-sub { color: var(--text-dim); line-height: 1.55; margin-bottom: 1.6rem; }

.intro-form { display: flex; flex-direction: column; gap: .7rem; align-items: center; }
.intro-form label { color: var(--text-dim); font-size: .95rem; }
.intro-form input {
  width: min(320px, 100%);
  padding: .75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1.1rem;
  text-align: center;
  outline: none;
}
.intro-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,212,71,.18); }

.intro-controls {
  margin-top: 1.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.4rem;
  justify-content: center;
  color: var(--text-dim);
  font-size: .85rem;
}
.intro-controls b { color: var(--accent); }

/* ---------- HUD ---------- */
#game-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
}

#hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem 1rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.hud-left, .hud-right { display: flex; align-items: center; gap: .55rem; }
.hud-logo { font-weight: 800; letter-spacing: .04em; }
.hud-chip {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .25rem .8rem;
  font-size: .85rem;
  white-space: nowrap;
}
.level-chip { border-color: var(--accent); color: var(--accent); }
.hud-btn {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: .3rem .6rem;
}

.hud-center { flex: 1 1 200px; min-width: 160px; }
.xp-bar-wrap {
  position: relative;
  height: 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.xp-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6c8cff, #3ddc84);
  transition: width .4s ease;
}
.xp-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,.7);
}

/* ---------- Stage / Canvas ---------- */
#stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(108,140,255,.10), transparent),
    var(--bg);
  overflow: hidden;
  padding: .6rem;
}
#game-canvas {
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1104 / 720;
  border-radius: 14px;
  box-shadow: var(--shadow);
  image-rendering: pixelated;
}

.toast {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 26, 40, .95);
  border: 1px solid var(--accent);
  color: var(--text);
  border-radius: 12px;
  padding: .55rem 1.2rem;
  font-size: .95rem;
  z-index: 5;
  animation: pop .25s ease;
  max-width: 90%;
  text-align: center;
}

.interact-hint {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #1b1400;
  font-weight: 700;
  border-radius: 10px;
  padding: .45rem 1rem;
  z-index: 5;
  animation: bounce 1s infinite alternate;
}
@keyframes bounce { from { transform: translate(-50%, 0); } to { transform: translate(-50%, -6px); } }

#hint-bar {
  padding: .45rem 1rem;
  text-align: center;
  color: var(--text-dim);
  font-size: .85rem;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
}
#hint-bar b { color: var(--accent); }

/* ---------- Touch Controls ---------- */
#touch-controls {
  position: absolute;
  inset: auto 0 10px 0;
  display: none;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 6;
  pointer-events: none;
}
@media (pointer: coarse) {
  #touch-controls { display: flex; }
}
.dpad {
  display: grid;
  grid-template-areas: ". up ." "left down right";
  gap: 6px;
  pointer-events: auto;
}
.dpad button, #touch-action {
  width: 54px; height: 54px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(28, 35, 51, .85);
  color: var(--text);
  font-size: 1.2rem;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.dpad button[data-dir="up"] { grid-area: up; }
.dpad button[data-dir="left"] { grid-area: left; }
.dpad button[data-dir="down"] { grid-area: down; }
.dpad button[data-dir="right"] { grid-area: right; }
#touch-action {
  background: var(--accent);
  color: #1b1400;
  font-weight: 800;
  font-size: 1.4rem;
  align-self: flex-end;
}

/* ---------- Raum-Panel ---------- */
.room-panel {
  width: min(1000px, 96vw);
  height: min(760px, 92vh);
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pop .3s ease;
}
.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}
.room-kicker {
  font-size: .75rem;
  letter-spacing: .2em;
  color: var(--accent);
  font-weight: 700;
}
.room-header h2 { font-size: 1.45rem; }
.room-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.3rem 1.5rem 2rem;
  line-height: 1.6;
}

/* ---------- Kurs-UI ---------- */
.course-intro { color: var(--text-dim); margin-bottom: 1.2rem; }
.lesson-list { display: flex; flex-direction: column; gap: .7rem; }
.lesson-item {
  display: flex;
  align-items: center;
  gap: .9rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: .9rem 1.1rem;
  cursor: pointer;
  transition: transform .1s, border-color .15s;
}
.lesson-item:hover { transform: translateX(4px); border-color: var(--accent-2); }
.lesson-item.done { border-color: var(--green); }
.lesson-icon { font-size: 1.5rem; }
.lesson-meta { flex: 1; }
.lesson-meta h4 { font-size: 1.02rem; }
.lesson-meta small { color: var(--text-dim); }
.lesson-check { font-size: 1.2rem; color: var(--green); }
.lesson-xp { font-size: .8rem; color: var(--accent); white-space: nowrap; }

.quiz-item { border-style: dashed; border-color: var(--accent); }

.lesson-content h3 { margin: 1.1rem 0 .5rem; color: var(--accent); }
.lesson-content p { margin-bottom: .85rem; }
.lesson-content ul { margin: 0 0 .9rem 1.3rem; }
.lesson-content li { margin-bottom: .35rem; }
.lesson-content .factbox {
  background: rgba(108, 140, 255, .12);
  border-left: 4px solid var(--accent-2);
  border-radius: 8px;
  padding: .8rem 1rem;
  margin: 1rem 0;
  font-size: .93rem;
}
.lesson-content .warnbox {
  background: rgba(255, 93, 108, .1);
  border-left: 4px solid var(--red);
  border-radius: 8px;
  padding: .8rem 1rem;
  margin: 1rem 0;
  font-size: .93rem;
}
.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.6rem;
  flex-wrap: wrap;
}

/* ---------- Quiz ---------- */
.quiz-progress { color: var(--text-dim); font-size: .85rem; margin-bottom: .6rem; }
.quiz-question { font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; }
.quiz-answers { display: flex; flex-direction: column; gap: .6rem; }
.quiz-answer {
  text-align: left;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: .8rem 1rem;
  font-size: .98rem;
  transition: border-color .15s, background .15s;
}
.quiz-answer:hover:not(:disabled) { border-color: var(--accent-2); }
.quiz-answer.correct { border-color: var(--green); background: rgba(61,220,132,.15); }
.quiz-answer.wrong { border-color: var(--red); background: rgba(255,93,108,.15); }
.quiz-answer:disabled { cursor: default; }
.quiz-explain {
  margin-top: 1rem;
  background: rgba(255, 212, 71, .1);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: .8rem 1rem;
  font-size: .93rem;
}
.quiz-result { text-align: center; padding: 2rem 1rem; }
.quiz-result .big { font-size: 3rem; }
.quiz-result h3 { margin: .6rem 0; }

/* ---------- Newsroom ---------- */
.news-tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.news-tab {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 999px;
  padding: .45rem 1rem;
  font-size: .9rem;
}
.news-tab.active {
  background: var(--accent);
  color: #1b1400;
  font-weight: 700;
  border-color: var(--accent);
}
.news-status { color: var(--text-dim); font-size: .85rem; margin-bottom: .8rem; }
.news-list { display: flex; flex-direction: column; gap: .6rem; }
.news-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .8rem 1rem;
}
.news-card a { color: var(--text); text-decoration: none; font-weight: 600; }
.news-card a:hover { color: var(--accent); text-decoration: underline; }
.news-card .meta { color: var(--text-dim); font-size: .8rem; margin-top: .25rem; }

.ticker-table { width: 100%; border-collapse: collapse; }
.ticker-table th, .ticker-table td {
  text-align: left;
  padding: .55rem .6rem;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
}
.ticker-table th { color: var(--text-dim); font-weight: 600; font-size: .8rem; }
.ticker-up { color: var(--green); font-weight: 700; }
.ticker-down { color: var(--red); font-weight: 700; }
.coin-cell { display: flex; align-items: center; gap: .5rem; }
.coin-cell img { width: 20px; height: 20px; border-radius: 50%; }

.spinner {
  margin: 2.5rem auto;
  width: 42px; height: 42px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Bibliothek ---------- */
.lib-section h3 { color: var(--accent); margin: 1.2rem 0 .6rem; }
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: .7rem;
}
.lib-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .8rem 1rem;
  display: block;
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, transform .1s;
}
.lib-card:hover { border-color: var(--accent-2); transform: translateY(-2px); }
.lib-card b { display: block; margin-bottom: .2rem; }
.lib-card small { color: var(--text-dim); }

/* ---------- Aula / Stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .8rem;
  margin-bottom: 1.4rem;
}
.stat-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  text-align: center;
}
.stat-card .num { font-size: 1.9rem; font-weight: 800; color: var(--accent); }
.stat-card .lbl { color: var(--text-dim); font-size: .85rem; }
.cert-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .7rem 1rem;
  margin-bottom: .55rem;
}
.cert-row.done { border-color: var(--green); }
.cert-row .flex { flex: 1; }
.cert-row small { color: var(--text-dim); }

/* ---------- Zertifikat ---------- */
.cert-card { text-align: center; }
.cert-border {
  background: linear-gradient(160deg, #fdf6dd, #f5e8b8);
  color: #3a2e00;
  border: 6px double #b8962e;
  border-radius: 16px;
  padding: 2.2rem 3rem;
  width: min(560px, 92vw);
  box-shadow: var(--shadow);
  animation: pop .35s ease;
}
.cert-logo { font-size: 2.6rem; }
.cert-school { letter-spacing: .3em; font-size: .8rem; font-weight: 700; color: #8a6d1c; }
.cert-heading { font-size: 2rem; font-weight: 900; letter-spacing: .15em; margin: .4rem 0 .8rem; }
.cert-text { font-size: .9rem; color: #6b5a17; }
.cert-name { font-size: 1.7rem; font-weight: 800; margin: .3rem 0; font-style: italic; }
.cert-course { font-size: 1.25rem; font-weight: 700; margin: .3rem 0; color: #7a5c00; }
.cert-date { margin-top: 1rem; font-size: .85rem; color: #8a6d1c; }
.cert-card .btn { margin-top: 1.2rem; }

/* ---------- Konfetti ---------- */
#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 100;
}

/* ---------- Scrollbars ---------- */
.room-body::-webkit-scrollbar { width: 10px; }
.room-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }

@media (max-width: 720px) {
  .room-header h2 { font-size: 1.1rem; }
  .room-body { padding: 1rem; }
  .cert-border { padding: 1.4rem 1.2rem; }
}

/* ============================================================
   v2 "Schulhof-Update": Dokumenten-Studio, Basketball, Kiosk
   ============================================================ */

/* ---------- Formulare (Dokumenten-Studio) ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: .8rem .9rem;
}
.field { display: flex; flex-direction: column; gap: .3rem; }
.field.full { grid-column: 1 / -1; }
.field span { font-size: .82rem; color: var(--text-dim); font-weight: 600; }
.field input[type="text"], .field textarea, .field select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  padding: .55rem .7rem;
  font-size: .92rem;
  font-family: inherit;
  outline: none;
  resize: vertical;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 212, 71, .14);
}
.field textarea { line-height: 1.45; }
.field.check {
  flex-direction: row;
  align-items: center;
  gap: .6rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: .6rem .8rem;
  cursor: pointer;
}
.field.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.field.check span { color: var(--text); font-weight: 500; }

.doc-tip {
  background: rgba(108, 140, 255, .12);
  border-left: 4px solid var(--accent-2);
  border-radius: 8px;
  padding: .8rem 1rem;
  margin-bottom: 1.1rem;
  font-size: .9rem;
  line-height: 1.5;
}

/* ---------- Basketball ---------- */
.bball-stats {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: .8rem;
  font-size: 1rem;
}
.bball-stats b { color: var(--accent); }
#bb-canvas {
  display: block;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  cursor: pointer;
  touch-action: manipulation;
}
.bball-hint {
  text-align: center;
  color: var(--text-dim);
  font-size: .88rem;
  margin-top: .8rem;
}

/* ---------- Kiosk ---------- */
.kiosk-fact {
  background: var(--panel-2);
  border: 2px dashed var(--accent);
  border-radius: 18px;
  padding: 1.6rem 1.8rem;
  text-align: center;
  max-width: 620px;
  margin: 0 auto 1.2rem;
  animation: pop .3s ease;
}
.kiosk-snack { font-size: 3rem; margin-bottom: .6rem; }
.kiosk-fact p { font-size: 1.05rem; line-height: 1.6; }
.kiosk-new {
  display: inline-block;
  margin-top: .9rem;
  background: var(--green);
  color: #06331b;
  font-weight: 800;
  border-radius: 999px;
  padding: .3rem 1rem;
  font-size: .85rem;
}
.kiosk-old {
  margin-top: .9rem;
  color: var(--text-dim);
  font-size: .85rem;
}

/* ============================================================
   v3 Campus-Upgrade
   ============================================================ */

.intro-bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 49;
  pointer-events: none;
}

.intro-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent-2), var(--green));
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  padding: .25rem .7rem;
  border-radius: 999px;
  margin-bottom: .5rem;
}

.char-creator {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  justify-content: center;
  margin: 1.2rem 0;
  flex-wrap: wrap;
}

#char-preview {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 14px;
  image-rendering: pixelated;
}

.char-options {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  text-align: left;
}

.char-options label { color: var(--text-dim); font-size: .85rem; }
.char-options input {
  padding: .6rem .8rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  outline: none;
}
.char-options input:focus { border-color: var(--accent); }

.color-row {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .82rem;
  color: var(--text-dim);
}
.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .1s, border-color .15s;
}
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }

.daily-chip { border-color: var(--green); color: var(--green); animation: pulse-chip 2s infinite; }
@keyframes pulse-chip { 0%,100% { opacity: 1; } 50% { opacity: .65; } }

.quest-chip { border-color: var(--accent-2); color: var(--accent-2); cursor: pointer; }
.quest-chip:hover { filter: brightness(1.2); }

.quest-panel {
  position: absolute;
  top: 12px;
  left: 12px;
  width: min(340px, 90vw);
  max-height: calc(100% - 80px);
  background: rgba(13, 17, 23, .94);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  z-index: 8;
  overflow: hidden;
  animation: slide-in .25s ease;
}
@keyframes slide-in { from { transform: translateX(-20px); opacity: 0; } to { transform: none; opacity: 1; } }

.quest-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}
.quest-panel-head h3 { font-size: .95rem; }
.btn-sm { padding: .3rem .6rem; font-size: .8rem; }

.daily-block {
  padding: .8rem 1rem;
  border-bottom: 1px dashed var(--border);
  background: rgba(61, 220, 132, .06);
}
.daily-block h4 { color: var(--green); font-size: .85rem; margin-bottom: .35rem; }
.daily-block p { font-size: .82rem; color: var(--text-dim); }
.daily-progress-bar {
  height: 8px;
  background: var(--panel);
  border-radius: 999px;
  margin-top: .5rem;
  overflow: hidden;
}
.daily-progress-bar div {
  height: 100%;
  background: linear-gradient(90deg, var(--green), #7af0b0);
  transition: width .3s;
}

.quest-list { padding: .6rem; overflow-y: auto; max-height: 360px; }
.quest-item {
  display: flex;
  gap: .7rem;
  padding: .65rem .75rem;
  border-radius: 10px;
  margin-bottom: .4rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: .85rem;
}
.quest-item.done { border-color: var(--green); opacity: .7; }
.quest-item .q-icon { font-size: 1.3rem; }
.quest-item .q-meta { flex: 1; }
.quest-item .q-meta b { display: block; margin-bottom: .15rem; }
.quest-item .q-meta small { color: var(--text-dim); }
.quest-item .q-xp { color: var(--accent); font-weight: 700; white-space: nowrap; align-self: center; }

.achievement-popup {
  position: absolute;
  top: 70px;
  right: 16px;
  background: linear-gradient(135deg, #2a2040, var(--panel));
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: .9rem 1.2rem;
  z-index: 10;
  animation: ach-pop .5s ease;
  max-width: 280px;
  box-shadow: 0 8px 32px rgba(255, 212, 71, .25);
}
@keyframes ach-pop {
  0% { transform: translateX(120px) scale(.8); opacity: 0; }
  60% { transform: translateX(-8px) scale(1.05); }
  100% { transform: none; scale: 1; opacity: 1; }
}
.achievement-popup .ach-icon { font-size: 2rem; }
.achievement-popup .ach-title { font-weight: 800; color: var(--accent); margin: .2rem 0; }
.achievement-popup .ach-desc { font-size: .82rem; color: var(--text-dim); }

.touch-sprint {
  background: linear-gradient(135deg, #6c8cff, #c86cff) !important;
  color: #fff !important;
  font-weight: 800;
  align-self: flex-end;
}

/* Money Rush Arcade */
.hustle-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: .7rem;
  font-size: 1rem;
}
.hustle-stats b { color: var(--accent); }
#hustle-canvas {
  display: block;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  cursor: none;
  touch-action: none;
  background: #0a0e18;
}
.hustle-hint { text-align: center; color: var(--text-dim); font-size: .88rem; margin-top: .7rem; }

/* NPC Dialog */
.npc-dialog {
  background: var(--panel-2);
  border: 2px solid var(--accent-2);
  border-radius: 16px;
  padding: 1.4rem;
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
}
.npc-portrait { font-size: 3.5rem; margin-bottom: .5rem; }
.npc-name { color: var(--accent); font-weight: 800; margin-bottom: .6rem; }
.npc-line { font-size: 1.05rem; line-height: 1.55; margin-bottom: 1rem; }

.chest-found {
  text-align: center;
  padding: 2rem 1rem;
}
.chest-found .big { font-size: 4rem; animation: bounce 1s infinite alternate; }

/* ============================================================
   QUINT HAUPTQUARTIER (HQ) – Plattform-Anbindung
   ============================================================ */
:root { --hq: #b478ff; --hq-2: #7c5cff; }

.hq-hero {
  display: flex; gap: 1rem; align-items: center;
  background: linear-gradient(135deg, rgba(124,92,255,.22), rgba(180,120,255,.08));
  border: 1px solid rgba(180,120,255,.35);
  border-radius: 16px; padding: 1rem 1.2rem; margin-bottom: 1rem;
}
.hq-hero-logo { font-size: 3rem; filter: drop-shadow(0 0 14px rgba(180,120,255,.7)); }
.hq-hero h3 { margin-bottom: .2rem; }
.hq-hero p { color: var(--text-dim); font-size: .95rem; }

.hq-status { display: inline-block; margin-top: .5rem; font-size: .82rem; font-weight: 700; padding: .18rem .6rem; border-radius: 999px; }
.hq-status.live { color: #0b2417; background: var(--green); }
.hq-status.demo { color: #2a1c00; background: var(--accent); }

.hq-tabs { flex-wrap: wrap; }
.hq-content { margin-top: 1rem; }

.hq-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem; margin: 1rem 0; }
.hq-tile {
  text-align: left; border: 1px solid var(--border); background: var(--panel-2);
  border-radius: 14px; padding: 1rem; display: flex; flex-direction: column; gap: .2rem;
  transition: transform .1s, border-color .15s, filter .15s;
}
.hq-tile:hover { transform: translateY(-2px); border-color: var(--hq); filter: brightness(1.1); }
.hq-tile span { font-size: 1.8rem; }
.hq-tile b { font-size: 1.05rem; }
.hq-tile small { color: var(--text-dim); }

.hq-links { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin: 1.2rem 0 .4rem; }
.hq-fineprint { color: var(--text-dim); font-size: .82rem; text-align: center; margin-top: .8rem; }
.hq-loading { text-align: center; color: var(--text-dim); padding: 2.4rem 1rem; font-size: 1.05rem; }

.hq-note { border-radius: 12px; padding: .9rem 1.1rem; margin-top: 1rem; line-height: 1.5; }
.hq-note.ok { background: rgba(61,220,132,.12); border: 1px solid rgba(61,220,132,.5); }
.hq-note .btn-sm { margin-top: .5rem; }

/* ---- Community-Chat ---- */
.chat-meta { color: var(--text-dim); font-size: .82rem; margin-bottom: .5rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.chat-scroll {
  height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem;
  padding: .8rem; background: var(--bg); border: 1px solid var(--border); border-radius: 14px;
}
.chat-msg { max-width: 82%; padding: .5rem .75rem; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border); }
.chat-msg.own { align-self: flex-end; background: linear-gradient(135deg, rgba(108,140,255,.28), rgba(108,140,255,.12)); border-color: rgba(108,140,255,.5); }
.chat-msg.team { border-color: rgba(180,120,255,.55); background: linear-gradient(135deg, rgba(180,120,255,.2), rgba(180,120,255,.05)); }
.chat-head { display: flex; align-items: center; gap: .4rem; font-size: .82rem; margin-bottom: .15rem; }
.chat-head b { color: var(--text); }
.chat-head time { margin-left: auto; color: var(--text-dim); font-size: .72rem; }
.chat-emoji { font-size: 1rem; }
.chat-body { line-height: 1.4; word-break: break-word; }
.chat-input-row { display: flex; gap: .5rem; margin-top: .7rem; }
.chat-input-row input {
  flex: 1; padding: .7rem .9rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 1rem; outline: none;
}
.chat-input-row input:focus { border-color: var(--hq); box-shadow: 0 0 0 3px rgba(180,120,255,.18); }

/* ---- Marketplace ---- */
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .7rem; margin: 1rem 0; }
.market-card { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2); }
.market-card:hover { border-color: var(--hq); }
.market-emoji { font-size: 1.9rem; }
.market-info { flex: 1; min-width: 0; }
.market-info b { display: block; }
.market-info small { color: var(--text-dim); }
.market-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.market-tag { font-size: .68rem; font-weight: 700; color: #2a1c00; background: var(--accent); padding: .1rem .45rem; border-radius: 999px; }
.market-price { font-weight: 700; color: var(--green); white-space: nowrap; }

/* ---- Team ---- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin: 1rem 0; }
.team-card { text-align: center; padding: 1rem .7rem; border: 1px solid var(--border); border-radius: 14px; background: var(--panel-2); display: flex; flex-direction: column; gap: .2rem; }
.team-card:hover { border-color: var(--hq); }
.team-ava { font-size: 2.4rem; }
.team-role { color: var(--hq); font-weight: 700; font-size: .82rem; }
.team-card small { color: var(--text-dim); }

/* ---- Pitch ---- */
.pitch-deck { display: flex; flex-direction: column; gap: .7rem; margin: 1rem 0; }
.pitch-slide { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(135deg, rgba(124,92,255,.1), transparent); }
.pitch-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--hq); color: #14082a; font-weight: 800; display: grid; place-items: center; font-size: .85rem; }
.pitch-icon { font-size: 1.8rem; }
.pitch-text b { font-size: 1.05rem; }
.pitch-text p { color: var(--text-dim); margin-top: .2rem; line-height: 1.5; }

/* ============================================================
   QUINT PLANET — Multiplayer / Auth / Phone / Skins
   ============================================================ */

/* ---- Auth-Screen ---- */
.auth-card {
  max-width: 460px; width: 100%;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--border); border-radius: 22px;
  padding: 2rem 2rem 1.6rem; text-align: center;
  box-shadow: var(--shadow); animation: pop .4s ease; position: relative; z-index: 2;
}
.auth-body { display: flex; flex-direction: column; gap: .7rem; margin: 1.2rem 0 .4rem; text-align: left; }
.auth-tabs { display: flex; gap: .4rem; background: var(--bg); border-radius: 12px; padding: .3rem; }
.auth-tab { flex: 1; border: none; background: transparent; color: var(--text-dim); padding: .6rem; border-radius: 9px; font-weight: 700; }
.auth-tab.active { background: var(--panel-2); color: var(--text); }
.auth-field { display: flex; flex-direction: column; gap: .3rem; }
.auth-field span { font-size: .85rem; color: var(--text-dim); }
.auth-field input {
  padding: .7rem .9rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 1rem; outline: none;
}
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,212,71,.18); }
.auth-error { color: var(--red); font-size: .85rem; min-height: 1.1em; text-align: center; }
.auth-hint { color: var(--text-dim); font-size: .8rem; margin-top: .6rem; }
#auth-submit { width: 100%; }

/* ---- HUD-Ergänzungen ---- */
.coins-chip { background: rgba(255,212,71,.14); border-color: rgba(255,212,71,.4); color: var(--accent); font-weight: 700; }
.online-chip { background: rgba(61,220,132,.12); border-color: rgba(61,220,132,.4); }

/* ---- Chat-Bubble-Eingabe (Taste T) ---- */
.chat-bubble-input {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  z-index: 60; width: min(520px, 90vw);
}
.chat-bubble-input input {
  width: 100%; padding: .8rem 1.1rem; border-radius: 14px;
  border: 2px solid var(--accent); background: rgba(20,26,40,.96); color: var(--text);
  font-size: 1.05rem; outline: none; box-shadow: 0 10px 40px rgba(0,0,0,.5);
}

/* ---- Skin-Editor ---- */
.skin-editor { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.skin-preview-wrap { background: radial-gradient(circle at 50% 40%, #2a3350, #161b26); border: 1px solid var(--border); border-radius: 16px; padding: .6rem; flex: none; }
.skin-controls { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: .7rem; }
.skin-row { display: flex; flex-direction: column; gap: .3rem; }
.skin-label { font-size: .82rem; color: var(--text-dim); }
.skin-choices { display: flex; flex-wrap: wrap; gap: .35rem; }
.skin-chip { border: 1px solid var(--border); background: var(--panel-2); color: var(--text); border-radius: 8px; padding: .35rem .6rem; font-size: .82rem; }
.skin-chip.active { border-color: var(--accent); background: rgba(255,212,71,.15); color: var(--accent); }
.skin-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.skin-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }

/* ---- Quint Phone ---- */
.phone-overlay {
  position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center;
  background: rgba(5,8,15,.55); backdrop-filter: blur(3px);
}
.phone-frame {
  width: 320px; height: 640px; max-height: 92vh; background: #0e1220;
  border: 3px solid #2a3348; border-radius: 40px; position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,.6); padding: 14px; display: flex; flex-direction: column;
}
.phone-notch { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 120px; height: 22px; background: #0e1220; border-radius: 0 0 14px 14px; z-index: 3; }
.phone-statusbar { display: flex; justify-content: space-between; font-size: .7rem; color: var(--text-dim); padding: .3rem .8rem .5rem; }
.phone-screen {
  flex: 1; border-radius: 26px; overflow-y: auto;
  background: linear-gradient(180deg, #171d2e, #10141f); padding: 1rem .9rem; position: relative;
}
.phone-home { width: 44px; height: 44px; margin: .5rem auto 0; border-radius: 50%; border: 2px solid #2a3348; background: #171d2e; cursor: pointer; }
.phone-apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.phone-app { display: flex; flex-direction: column; align-items: center; gap: .3rem; border: none; background: none; color: var(--text); cursor: pointer; }
.phone-app .ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem; background: linear-gradient(135deg, var(--panel-2), var(--panel)); border: 1px solid var(--border); }
.phone-app span { font-size: .72rem; color: var(--text-dim); }
.phone-app:hover .ico { border-color: var(--accent); }
.phone-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .8rem; }
.phone-back { border: none; background: var(--panel-2); color: var(--text); border-radius: 8px; padding: .3rem .6rem; cursor: pointer; }
.phone-title { font-weight: 700; }
.phone-list { display: flex; flex-direction: column; gap: .5rem; }
.phone-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: .6rem .7rem; font-size: .85rem; }

/* ---- Arcade-Kolosseum ---- */
.arcade-hero { text-align: center; }
.arcade-badge { display: inline-block; background: linear-gradient(135deg,#ff9f47,#ff5d6c); color: #2a1200; font-weight: 800; padding: .3rem .9rem; border-radius: 999px; margin-bottom: .6rem; }
.arcade-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: .8rem; margin: 1rem 0; }
.arcade-card { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: 1.1rem .7rem; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(160deg,var(--panel-2),var(--panel)); color: var(--text); cursor: pointer; transition: transform .1s, border-color .15s; }
.arcade-card:hover, .arcade-card.active { transform: translateY(-3px); border-color: var(--accent); }
.arcade-emoji { font-size: 2.4rem; }
.arcade-card small { color: var(--text-dim); font-size: .75rem; text-align: center; }
.arcade-play { margin-top: .3rem; font-size: .8rem; font-weight: 700; color: var(--accent); }

/* ---- Minispiel-Rahmen ---- */
.mini-wrap { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin-top: 1rem; }
.mini-bar { display: flex; gap: 1.2rem; flex-wrap: wrap; justify-content: center; font-size: .9rem; color: var(--text-dim); }
.mini-bar b { color: var(--text); }
.mini-wrap canvas { border-radius: 12px; border: 1px solid var(--border); background: #10141f; max-width: 100%; }
.mini-hint { color: var(--text-dim); font-size: .8rem; text-align: center; }

/* ---- Tic-Tac-Toe ---- */
.ttt-board { display: grid; grid-template-columns: repeat(3, 74px); grid-template-rows: repeat(3, 74px); gap: 6px; }
.ttt-cell { font-size: 2.2rem; font-weight: 800; border: 1px solid var(--border); background: var(--panel-2); border-radius: 12px; color: var(--text); cursor: pointer; }
.ttt-cell.filled { cursor: default; }
.ttt-cell.x { color: var(--accent-2); }
.ttt-cell.o { color: var(--red); }
.ttt-cell:hover:not(.filled) { border-color: var(--accent); }

/* ---- Roulette ---- */
.roulette-wrap { display: flex; flex-direction: column; align-items: center; gap: .7rem; margin-top: .5rem; }
.roulette-bar { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; align-items: center; font-size: .95rem; }
.roulette-bal { font-weight: 800; color: var(--accent); }
.bet-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; max-width: 460px; }
.bet-cell { padding: .5rem 0; text-align: center; border-radius: 6px; font-weight: 700; font-size: .8rem; cursor: pointer; border: 1px solid var(--border); color: #fff; }
.bet-cell.red { background: #c0392b; } .bet-cell.black { background: #222; } .bet-cell.green { background: #1e8a4c; }
.bet-cell:hover { outline: 2px solid var(--accent); }
.bet-outside { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; max-width: 460px; }
.bet-btn { padding: .5rem .8rem; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font-weight: 700; cursor: pointer; }
.bet-btn:hover { border-color: var(--accent); }
.bet-btn.active { background: rgba(255,212,71,.2); border-color: var(--accent); }
.roulette-chips { display: flex; gap: .4rem; align-items: center; }
.chip-btn { width: 42px; height: 42px; border-radius: 50%; border: 2px dashed rgba(255,255,255,.5); font-weight: 800; cursor: pointer; color: #1a1a2a; }
.chip-btn.active { outline: 3px solid var(--accent); }
.roulette-msg { min-height: 1.4em; font-weight: 700; }
.pending-bets { font-size: .8rem; color: var(--text-dim); min-height: 1.2em; }

/* ---- Blackjack ---- */
.bj-wrap { display: flex; flex-direction: column; align-items: center; gap: .7rem; margin-top: .5rem; }
.bj-table {
  width: 100%; max-width: 560px; cursor: pointer;
  background: radial-gradient(ellipse at 50% 45%, #1e6b45, #123528);
  border: 6px solid #5a3d22; border-radius: 120px/70px; padding: 1.2rem 1rem;
  display: flex; flex-direction: column; gap: 1.1rem;
}
.bj-side { display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.bj-label { color: rgba(255,255,255,.75); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.bj-label b { color: var(--accent); }
.bj-cards { display: flex; gap: .35rem; min-height: 62px; }
.bj-card {
  width: 44px; height: 62px; border-radius: 7px; background: #f5f0e8; color: #141a26;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.bj-card.red { color: #c0392b; }
.bj-card.back { background: repeating-linear-gradient(45deg, #2c2352, #2c2352 5px, #3a2f66 5px, #3a2f66 10px); border: 2px solid #ffd447; }
.bj-msg { min-height: 1.4em; font-weight: 700; }
.bj-actions { justify-content: center; gap: .5rem; flex-wrap: wrap; }

/* ---- Poker ---- */
.poker-wrap { display: flex; flex-direction: column; gap: .7rem; align-items: center; margin-top: .5rem; }
.poker-info { color: var(--text-dim); font-size: .9rem; text-align: center; }
.poker-table { width: 100%; max-width: 640px; background: radial-gradient(ellipse at 50% 50%, #1e6b45, #14432c); border: 6px solid #5a3d22; border-radius: 120px/70px; padding: 1.4rem 1rem; }
.poker-board { display: flex; gap: .4rem; justify-content: center; margin-bottom: .5rem; }
.poker-pot { text-align: center; color: #fff; font-size: .9rem; margin-bottom: .8rem; }
.poker-seats { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.pseat { background: rgba(10,14,22,.7); border: 1px solid var(--border); border-radius: 10px; padding: .4rem .6rem; min-width: 110px; text-align: center; }
.pseat.turn { border-color: var(--accent); box-shadow: 0 0 12px rgba(255,212,71,.5); }
.pseat.me { border-color: var(--accent-2); }
.pseat.folded { opacity: .45; }
.pseat-name { font-size: .8rem; font-weight: 700; }
.pseat-cards { display: flex; gap: .2rem; justify-content: center; margin: .2rem 0; min-height: 22px; }
.pseat-stack { font-size: .72rem; color: var(--text-dim); }
.pcard { background: #f5f0e8; color: #1a1a2a; border-radius: 5px; padding: .25rem .4rem; font-weight: 800; font-size: 1.1rem; min-width: 26px; display: inline-block; text-align: center; }
.pcard.sm { font-size: .85rem; padding: .15rem .3rem; min-width: 18px; }
.pcard.red { color: #c0392b; }
.poker-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; min-height: 40px; }
.poker-result { min-height: 1.4em; font-weight: 700; text-align: center; color: var(--accent); }

/* ---- Voice-Banner ---- */
.voice-banner {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  background: rgba(20,26,40,.96); border: 1px solid var(--green); color: var(--text);
  border-radius: 12px; padding: .5rem 1rem; z-index: 80; display: flex; align-items: center; gap: .8rem;
  box-shadow: 0 10px 40px rgba(0,0,0,.5); animation: pop .25s ease;
}
.voice-hang { background: var(--red); border: none; color: #fff; border-radius: 8px; padding: .35rem .7rem; font-weight: 700; cursor: pointer; }

/* ---- Apartment ---- */
.apartment-room { display: flex; justify-content: center; margin: .8rem 0; }
.apartment-room canvas { border-radius: 14px; border: 2px solid var(--border); box-shadow: var(--shadow); max-width: 100%; }

/* ---- Handgezeichneter Polish (dezent) ---- */
#game-canvas {
  filter: saturate(1.06) contrast(1.02);
}
.room-panel, .auth-card, .phone-frame, .hq-hero, .arcade-card, .market-card, .team-card {
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,.02);
}
.btn-primary { box-shadow: 0 2px 0 rgba(180,120,0,.4); }
.hud-logo { text-shadow: 0 0 10px rgba(108,140,255,.4); }
