:root {
  --bg: #14121c;
  --card: #1e1b2a;
  --card-2: #262238;
  --accent: #ff4d7e;
  --accent-2: #7c5cff;
  --gold: #ffc94d;
  --text: #f4f2fa;
  --text-dim: #a9a4bd;
  --success: #4ddb9e;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(circle at top, #201c30, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
}

.banner {
  background: #4a2a1a;
  color: #ffd9a8;
  text-align: center;
  padding: 10px;
  font-size: 14px;
}
.hidden { display: none !important; }

#app {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.screen { display: none; }
.screen.active { display: block; animation: fadeIn .3s ease; }

/* Warte-Screen mittig im Viewport statt oben angeklebt */
#screen-waiting.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - 100px);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.logo {
  text-align: center;
  font-size: 40px;
  margin-bottom: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { text-align: center; color: var(--text-dim); margin-bottom: 28px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.06);
}

.grid { display: grid; gap: 16px; }
@media (min-width: 640px) {
  .grid { grid-template-columns: 1fr 1.2fr; align-items: start; }
  #lobby-profile-card { grid-column: 1; }
  #host-settings, #player-settings-view { grid-column: 2; grid-row: 1 / span 2; }
}

label { display: block; font-size: 13px; color: var(--text-dim); margin: 14px 0 6px; }
label:first-child { margin-top: 0; }

input[type=text], input[type=number], select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: var(--card-2);
  color: var(--text);
  font-size: 15px;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .1s ease, opacity .15s ease;
}
.btn:hover { opacity: .92; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: white; }
.btn-secondary { background: var(--card-2); color: var(--text); border: 1px solid rgba(255,255,255,0.12); }
.btn-danger { background: var(--card-2); color: var(--accent); border: 1px solid rgba(255, 77, 126, 0.4); }
.btn-danger:hover { background: rgba(255, 77, 126, 0.12); border-color: var(--accent); }

/* Icon-/Werkzeug-Buttons (Abspielen, Pause, Löschen, Nudge, ...) – bisher
   liefen diese ohne eigenes Design und sahen wie nackte Browser-Buttons aus. */
.icon-btn {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .1s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.icon-btn:hover:not(:disabled) {
  background: var(--card);
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
}
.icon-btn:active:not(:disabled) { transform: scale(0.96); }
.icon-btn:disabled { opacity: 0.4; cursor: default; box-shadow: none; }
.icon-btn.icon-btn-danger:hover:not(:disabled) {
  background: rgba(255, 77, 126, 0.15);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 77, 126, 0.15);
}
.icon-btn.icon-btn-active {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: white;
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.25);
}

.full { width: 100%; margin-top: 18px; }
.btn-row { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; min-width: 140px; }

.divider {
  text-align: center;
  color: var(--text-dim);
  margin: 20px 0;
  font-size: 13px;
}

.error-text { color: var(--accent); font-size: 14px; min-height: 18px; margin-top: 10px; }

.code-badge {
  background: var(--card-2);
  padding: 4px 12px;
  border-radius: 8px;
  letter-spacing: 3px;
  font-family: monospace;
  font-size: 20px;
  color: var(--gold);
}

.hint { color: var(--text-dim); font-size: 14px; }

.player-list { list-style: none; padding: 0; margin: 12px 0; }
.player-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 10px; background: var(--card-2);
  margin-bottom: 8px; font-size: 15px;
  border: 1px solid transparent;
  transition: opacity .15s ease, border-color .15s ease;
}
.player-list .ready-tag { color: var(--success); font-size: 13px; }
.player-list .host-tag { color: var(--gold); font-size: 12px; margin-left: 6px; }
.player-list-right { display: flex; align-items: center; gap: 8px; }

/* Getrennte Spieler deutlich, aber nicht alarmierend hervorheben */
.player-list li.player-disconnected {
  opacity: 0.55;
  border-color: rgba(255, 77, 126, 0.35);
}
.player-list .disconnected-tag {
  color: var(--accent);
  font-size: 12px;
  margin-left: 8px;
  font-weight: 600;
}

.kick-btn { padding: 4px 9px; font-size: 12px; }

.pack-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* --- Modus-Toggle (VS. / Co-op) --- */
.mode-toggle { display: flex; gap: 8px; margin: 8px 0; }
.mode-btn {
  flex: 1;
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--card-2);
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.mode-btn:hover { border-color: var(--accent-2); }
.mode-btn.active {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: white;
  border-color: transparent;
}

/* --- Charakter-Auswahl (Co-op) --- */
.charsel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.charsel-card {
  background: var(--card-2);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, transform .1s ease;
}
.charsel-card:hover { border-color: var(--accent-2); }
.charsel-card:active { transform: scale(0.97); }
.charsel-card.mine { border-color: var(--success); background: rgba(80, 220, 140, 0.1); }
.charsel-card.taken { border-color: rgba(255, 77, 126, 0.5); opacity: 0.75; cursor: default; }
.charsel-card.taken:hover { border-color: rgba(255, 77, 126, 0.5); }
.charsel-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
  margin-bottom: 8px;
}
.charsel-name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.charsel-owner { font-size: 12px; color: var(--text-dim); }
.charsel-owner.mine-label { color: var(--success); font-weight: 600; }

/* --- Co-op-Zuschauer-Screen --- */
#screen-coop-watch video { opacity: 0.85; }
.pack-chip {
  padding: 8px 14px; border-radius: 20px; background: var(--card-2);
  border: 1px solid rgba(255,255,255,0.12); cursor: pointer; font-size: 14px;
}
.pack-chip.selected { background: var(--accent-2); border-color: var(--accent-2); }

video, audio { width: 100%; border-radius: var(--radius); background: black; margin: 16px 0; }

/* --- Vorschaubild + Untertitel im Studio (aus importierten Modpacks) --- */
.caption-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--card-2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 10px 0;
}
.caption-preview-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  background: #000;
}
.caption-text-wrap { min-width: 0; }
.caption-character {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 3px;
}
.caption-subtitle {
  font-size: 15px;
  line-height: 1.35;
  color: var(--text);
}

/* --- Untertitel-Overlay über dem Bewertungs-Video --- */
.video-wrap { position: relative; }
.video-wrap video { margin: 16px 0 0; }
.subtitle-overlay {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: 88%;
  background: rgba(0, 0, 0, 0.72);
  color: white;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 16px;
  text-align: center;
  line-height: 1.35;
  pointer-events: none;
}
@media (max-width: 600px) {
  .subtitle-overlay { font-size: 13.5px; bottom: 14px; padding: 6px 12px; }
  .caption-preview-img { width: 56px; height: 56px; }
}

.timer-bar { height: 10px; background: var(--card-2); border-radius: 6px; overflow: hidden; margin: 16px 0 6px; }
.timer-fill { height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); width: 100%; transition: width 0.2s linear; }
.timer-fill.record { background: linear-gradient(90deg, var(--accent), #ff8a4d); }

.countdown-text { text-align: center; font-size: 15px; color: var(--text-dim); }
.round-badge { text-align: center; color: var(--text-dim); font-size: 13px; margin-bottom: 4px; }

.mic-indicator {
  text-align: center; font-size: 64px; margin: 20px 0;
  animation: pulse 1s infinite ease-in-out;
}
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

.side-by-side { display: grid; gap: 16px; }
@media (min-width: 640px) { .side-by-side { grid-template-columns: 1fr 1fr; } }
.label-small { color: var(--text-dim); font-size: 13px; margin-bottom: 4px; }

.stars { display: flex; justify-content: center; gap: 10px; font-size: 40px; margin: 20px 0; }
.stars .star { cursor: pointer; filter: grayscale(1) opacity(0.4); transition: filter .1s; }
.stars .star.active { filter: none; }

.results-list { list-style: none; padding: 0; counter-reset: rank; }
.results-list li {
  display: flex; justify-content: space-between; padding: 12px 16px;
  background: var(--card); border-radius: 10px; margin-bottom: 8px; font-size: 16px;
}
.results-list li .score { color: var(--gold); font-weight: 700; }

.podium-stage { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin: 30px 0; height: 220px; }
.pedestal { width: 110px; border-radius: 10px 10px 0 0; text-align: center; padding-top: 10px; position: relative; }
.pedestal .name { font-weight: 700; font-size: 14px; }
.pedestal .score { color: var(--gold); font-size: 13px; }
.pedestal .medal { font-size: 28px; }
.pedestal.p1 { height: 200px; background: linear-gradient(180deg, #7c5cff, #4a3aa8); order: 2; }
.pedestal.p2 { height: 150px; background: linear-gradient(180deg, #4d4463, #322b45); order: 1; }
.pedestal.p3 { height: 110px; background: linear-gradient(180deg, #ff8a4d, #b85a2a); order: 3; }

h1, h2, h3 { margin-top: 0; }
h2 { text-align: center; }

/* ==========================================================
   Erweiterungen: Animationen, Super-Vote, Reaktionen, Awards
   ========================================================== */

/* --- Buttons: mehr Leben --- */
.btn { transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease; }
.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.1); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }

.btn-super {
  background: linear-gradient(135deg, #ffc94d, #ff8a3d);
  color: #3a2400;
  font-weight: 700;
  box-shadow: 0 0 14px rgba(255, 201, 77, 0.35);
  margin-top: 10px;
  animation: superPulse 1.6s ease-in-out infinite;
}
@keyframes superPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 201, 77, 0.3); }
  50% { box-shadow: 0 0 22px rgba(255, 201, 77, 0.65); }
}

/* --- Sterne: Hover-Animation --- */
.stars .star { transition: transform 0.1s ease; display: inline-block; }
.stars .star:hover { transform: scale(1.3) rotate(-8deg); }
.stars .star.active { animation: starPop 0.25s ease; }
@keyframes starPop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* --- Mikrofon-Indikator: pulsiert während der Aufnahme --- */
.mic-indicator { animation: micPulse 1.1s ease-in-out infinite; }
@keyframes micPulse {
  0%, 100% { transform: scale(1); text-shadow: 0 0 0 rgba(255, 77, 126, 0); }
  50% { transform: scale(1.12); text-shadow: 0 0 24px rgba(255, 77, 126, 0.8); }
}

/* --- Splash-Overlays (Runde X / Action) --- */
.splash-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 10, 20, 0.82);
  z-index: 900;
  pointer-events: none;
}
.splash-text {
  font-size: clamp(42px, 9vw, 96px);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: splashIn 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.splash-text.action { background: linear-gradient(135deg, var(--gold), var(--accent)); -webkit-background-clip: text; background-clip: text; }
@keyframes splashIn {
  0% { transform: scale(0.3) rotate(-6deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* --- Vote-Reveal --- */
.reveal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 10, 20, 0.88);
  z-index: 920;
}
.reveal-card {
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border-radius: 22px;
  padding: 34px 48px;
  text-align: center;
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.6);
  animation: revealCard 0.45s cubic-bezier(0.2, 1.3, 0.4, 1);
  max-width: 90vw;
}
@keyframes revealCard {
  0% { transform: translateY(60px) scale(0.8); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.reveal-avatar { font-size: 54px; }
.reveal-name { font-size: 22px; font-weight: 700; margin-top: 4px; }
.reveal-stars { font-size: 30px; margin: 12px 0 4px; letter-spacing: 4px; min-height: 40px; }
.reveal-stars .rstar { opacity: 0; display: inline-block; transform: scale(0.2); }
.reveal-stars .rstar.in { animation: rstarIn 0.35s forwards cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes rstarIn { to { opacity: 1; transform: scale(1); } }
.reveal-points { font-size: 44px; font-weight: 800; color: var(--success); }
.reveal-bonus {
  margin-top: 8px;
  font-size: 15px;
  color: var(--gold);
  animation: bonusFlash 0.7s ease 0.3s both;
}
@keyframes bonusFlash {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* --- Emoji-Reaktionsleiste --- */
.reaction-bar {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  background: rgba(30, 27, 42, 0.92);
  border: 1px solid #3a3555;
  border-radius: 999px;
  padding: 7px 12px;
  z-index: 850;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}
.reaction-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 50%;
  transition: transform 0.12s ease, background 0.12s ease;
  line-height: 1;
}
.reaction-btn:hover { transform: scale(1.35); background: rgba(124, 92, 255, 0.25); }
.reaction-btn:active { transform: scale(1.1); }

.floating-reaction {
  position: fixed;
  bottom: 70px;
  font-size: 34px;
  z-index: 840;
  pointer-events: none;
  animation: floatUp 2.6s ease-out forwards;
}
.floating-reaction .who {
  display: block;
  font-size: 11px;
  text-align: center;
  color: var(--text-dim);
  margin-top: -2px;
}
@keyframes floatUp {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  12% { opacity: 1; transform: translateY(-20px) scale(1.15); }
  100% { transform: translateY(-46vh) scale(1) rotate(var(--wobble, 8deg)); opacity: 0; }
}

/* --- Avatare in Listen --- */
.player-avatar { font-size: 20px; margin-right: 7px; }

/* --- Podium: gestaffelter Aufstieg + Awards --- */
.pedestal { animation: pedestalRise 0.7s cubic-bezier(0.2, 1.2, 0.4, 1) both; }
.pedestal.p2 { animation-delay: 0.15s; }
.pedestal.p1 { animation-delay: 0.45s; }
.pedestal.p3 { animation-delay: 0s; }
@keyframes pedestalRise {
  0% { transform: translateY(90px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.pedestal .medal { animation: medalDrop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both; animation-delay: inherit; }
@keyframes medalDrop {
  0% { transform: translateY(-40px) scale(0.4); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 22px 0 10px;
}
.award-card {
  background: var(--card);
  border: 1px solid #35304e;
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  animation: awardIn 0.5s ease both;
}
.award-card:nth-child(2) { animation-delay: 0.15s; }
.award-card:nth-child(3) { animation-delay: 0.3s; }
.award-card:nth-child(4) { animation-delay: 0.45s; }
@keyframes awardIn {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.award-card .a-emoji { font-size: 30px; }
.award-card .a-title { font-weight: 700; font-size: 14px; margin-top: 4px; color: var(--gold); }
.award-card .a-who { font-size: 14px; margin-top: 2px; }
.award-card .a-detail { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* --- Rundenergebnis: animierte Einträge --- */
.results-list li { animation: resultSlide 0.4s ease both; }
.results-list li:nth-child(1) { animation-delay: 0.05s; }
.results-list li:nth-child(2) { animation-delay: 0.15s; }
.results-list li:nth-child(3) { animation-delay: 0.25s; }
.results-list li:nth-child(4) { animation-delay: 0.35s; }
.results-list li:nth-child(5) { animation-delay: 0.45s; }
.results-list li:nth-child(n+6) { animation-delay: 0.55s; }
@keyframes resultSlide {
  0% { transform: translateX(-30px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* --- Warteraum: animierte Punkte --- */
.waiting-dots::after {
  content: '…';
  animation: dots 1.4s steps(4) infinite;
}
@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

/* ==========================================================
   Responsive Design: Handy bis 2K+
   ========================================================== */

/* Basis (#app hat max-width 760px) – Handy-Anpassungen */
@media (max-width: 600px) {
  #app { padding: 18px 12px 90px; }
  h1.logo { font-size: 34px; }
  h2 { font-size: 21px; }
  .side-by-side { grid-template-columns: 1fr !important; gap: 10px; }
  .btn { padding: 14px 18px; font-size: 16px; } /* größere Touch-Ziele */
  .reaction-bar { bottom: 10px; padding: 6px 8px; gap: 3px; }
  .reaction-btn { font-size: 21px; }
  .reveal-card { padding: 26px 22px; }
  .reveal-points { font-size: 36px; }
  .stars .star { font-size: 30px; padding: 4px; }
  .podium-stage { transform: scale(0.85); transform-origin: bottom center; }
  input[type=text], input[type=number], select { font-size: 16px; } /* verhindert iOS-Zoom */
}

/* Tablet / kleine Laptops */
@media (min-width: 601px) and (max-width: 1023px) {
  #app { max-width: 700px; }
}

/* FullHD und größer: mehr Raum nutzen */
@media (min-width: 1400px) {
  #app { max-width: 900px; padding-top: 48px; }
  body { font-size: 17px; }
  h1.logo { font-size: 52px; }
  video { max-height: 46vh; object-fit: contain; }
}

/* 2K/Widescreen: noch großzügiger, aber lesbar begrenzt */
@media (min-width: 2000px) {
  #app { max-width: 1040px; }
  body { font-size: 18px; }
  .reveal-card { padding: 44px 64px; }
  .reveal-points { font-size: 54px; }
}

/* Sehr flache Widescreen-Fenster: Videos nicht über den Viewport wachsen lassen */
@media (max-height: 700px) and (min-width: 1024px) {
  video { max-height: 38vh; object-fit: contain; }
  #app { padding-top: 16px; padding-bottom: 80px; }
}

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* --- Eigene Bild-Avatare --- */
.avatar-picker { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #3a3555;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-picker-actions { display: flex; flex-direction: column; gap: 8px; }
.avatar-upload-label { cursor: pointer; text-align: center; }

.avatar-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 7px;
}
.reveal-avatar .avatar-img { width: 64px; height: 64px; margin: 0; }
.pedestal .avatar-img { width: 34px; height: 34px; margin-right: 4px; }
.floating-reaction .avatar-img { width: 18px; height: 18px; margin-right: 3px; }
h2 .avatar-img { width: 30px; height: 30px; }

/* ==========================================================
   Synchron-Studio
   ========================================================== */
.studio-transport {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}
#studio-time { min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; }

.track {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 8px;
}
.track-label {
  width: 96px;
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
}
.track-body {
  position: relative;
  flex: 1;
  background: var(--card-2);
  border-radius: 8px;
  overflow: hidden;
  min-height: 54px;
}
.wave-canvas { display: block; width: 100%; height: 54px; }
.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gold);
  left: 0;
  pointer-events: none;
  z-index: 3;
}

.own-track .track-body { cursor: grab; touch-action: none; }
.own-track .track-body:active { cursor: grabbing; }
.own-track .wave-canvas { position: relative; z-index: 1; }
.own-track .track-clip {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(124, 92, 255, 0.22);
  border-left: 2px solid var(--accent-2);
  border-right: 2px solid var(--accent-2);
  z-index: 0;
}
.track-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}
.track-controls .icon-btn { padding: 3px 8px; font-size: 12px; }
.track-offset {
  font-size: 11.5px;
  color: var(--text-dim);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Original-Spur: Mute-Button vertikal zentriert, ohne den Offset-Platzhalter */
.original-track .track-controls { justify-content: center; }

/* Stummgeschaltete Spur optisch abgesetzt (nur lokale Vorschau betroffen) */
.track-is-muted .track-body { opacity: 0.45; }
.track-is-muted .track-label { opacity: 0.6; }

.studio-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 6px;
  flex-wrap: wrap;
}
.btn-record-active {
  background: var(--accent) !important;
  animation: micPulse 1.1s ease-in-out infinite;
}

#studio-video, #vote-scene, #vote-long-scene { width: 100%; }

@media (max-width: 600px) {
  .track-label { width: 64px; font-size: 11px; }
}

/* --- Globaler Lautstärkeregler --- */
.volume-control {
  position: fixed;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 27, 42, 0.96);
  border: 1px solid var(--accent-2);
  border-radius: 999px;
  padding: 9px 14px;
  z-index: 860;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
#volume-btn {
  background: none;
  border: none;
  font-size: 19px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
#volume-slider {
  width: 90px;
  accent-color: var(--accent-2);
  cursor: pointer;
  margin: 0;
}

/* --- Encore-Karte --- */
.encore-card { max-width: min(92vw, 720px); width: 100%; }
.encore-card video { width: 100%; border-radius: 10px; margin-top: 8px; }

/* --- Avatar-Mal-Werkzeug --- */
.avatar-reco-hint { margin-top: 4px; font-size: 12.5px; }
.draw-card { max-width: min(92vw, 420px); width: 100%; }
.draw-canvas {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffffff;
  margin: 14px 0;
  cursor: crosshair;
  touch-action: none; /* verhindert Scrollen beim Malen auf dem Handy */
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}
.draw-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 12px;
}
.draw-swatches { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.draw-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 0;
  transition: transform .1s ease, border-color .15s ease;
}
.draw-swatch:hover { transform: scale(1.12); }
.draw-swatch.active { border-color: white; box-shadow: 0 0 0 2px var(--accent-2); }
.draw-color-picker {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  background: none;
}
.draw-color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.draw-color-picker::-webkit-color-swatch { border: 2px solid rgba(255,255,255,0.25); border-radius: 50%; }
#draw-eraser-btn.active { background: var(--accent-2); color: white; }
.draw-size-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.draw-size-row input[type="range"] { flex: 1; }

@media (max-width: 600px) {
  .volume-control { top: 8px; right: 8px; padding: 6px 10px; }
  #volume-slider { width: 70px; }
}

/* Großer Umschalt-Button (z. B. Original-Ton im Studio) */


/* --- Live-Regelanzeige & Wünsche (Nicht-Host) --- */
.live-settings {
  background: var(--card-2);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 8px 0 16px;
  font-size: 13.5px;
  line-height: 1.9;
}
.live-settings .ls-row { display: flex; justify-content: space-between; gap: 10px; }
.live-settings .ls-label { color: var(--text-dim); }
.live-settings .ls-value { font-weight: 600; }

.suggestion-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: -4px 0 10px;
  min-height: 0;
}
.suggestion-chip {
  font-size: 11px;
  background: rgba(255, 201, 77, 0.15);
  color: var(--gold);
  border: 1px solid rgba(255, 201, 77, 0.4);
  border-radius: 999px;
  padding: 2px 9px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease;
}
.suggestion-chip:hover { background: rgba(255, 201, 77, 0.3); transform: scale(1.05); }

.scene-wish-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #2c2840;
  font-size: 13.5px;
}
.scene-wish-row:last-child { border-bottom: none; }
.scene-wish-row .swr-name { flex: 1; }
.scene-wish-row .swr-btns { display: flex; gap: 4px; }
.wish-btn {
  background: var(--card-2);
  border: 1px solid #3a3555;
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.wish-btn:hover { transform: scale(1.15); }
.wish-btn.active-want { background: rgba(77, 219, 158, 0.25); border-color: var(--success); }
.wish-btn.active-avoid { background: rgba(255, 77, 126, 0.2); border-color: #ff4d7e; }

.pack-chip .wish-badge {
  font-size: 10.5px;
  margin-left: 6px;
  color: var(--text-dim);
}

#player-settings-view { display: none; } /* wird per JS für Nicht-Host eingeblendet */

/* --- Segment-Übersicht im Studio (lange Szenen) --- */
.segments-overview {
  display: flex;
  gap: 3px;
  margin: 10px 0 6px;
}
.segments-overview .seg-block {
  flex: 1;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: white;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0 4px;
  box-sizing: border-box;
}
.segments-overview .seg-block.speak { background: var(--accent-2); opacity: 0.55; }
.segments-overview .seg-block.skip { background: #55506e; opacity: 0.4; color: var(--text-dim); }
.segments-overview .seg-block.current {
  opacity: 1;
  transform: scaleY(1.15);
  box-shadow: 0 0 0 2px var(--gold);
}
.segments-overview .seg-block.done { opacity: 0.85; }
.segments-overview .seg-block.done.speak::after { content: ' ✓'; }

.segments-overview-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}
.legend-speak { background: var(--accent-2); }
.legend-current { background: var(--accent-2); box-shadow: 0 0 0 2px var(--gold); }
.legend-skip { background: #55506e; }

@media (max-width: 600px) {
  .segments-overview .seg-block { font-size: 0; height: 22px; } /* auf Handy nur Farbe, Titel entfällt aus Platzgründen */
}

/* --- "Zurück zum Hauptmenü"-Button während laufender Runden --- */
.leave-game-btn {
  position: fixed;
  top: 14px;
  left: 14px;
  background: rgba(30, 27, 42, 0.92);
  border: 1px solid #3a3555;
  color: var(--text-dim);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  z-index: 855;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.leave-game-btn:hover { color: #ff4d7e; border-color: #ff4d7e; }

@media (max-width: 600px) {
  .leave-game-btn { top: 8px; left: 8px; padding: 7px 11px; font-size: 12px; }
}

/* --- Globale Benachrichtigung (unabhängig vom aktuellen Screen sichtbar) --- */
.toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--card);
  border: 1px solid var(--accent-2);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 950;
  max-width: 90vw;
  text-align: center;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.toast.toast-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 600px) {
  .toast { top: 8px; font-size: 13px; padding: 10px 16px; }
}
