/* Kampagne – Wahlkampf-Strategiespiel */

:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface2: #21262d;
  --text: #e8eef7;
  --muted: #8b9cb3;
  --accent: #3d8bfd;
  --accent2: #a371f7;
  --danger: #f85149;
  --ok: #3fb950;
  --warn: #f0883e;
  --party: #d2a8ff;
  --gold: #f7c948;
  --font: "Segoe UI", system-ui, sans-serif;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--accent); }

/* ===== Landing Page ===== */

.screen {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
}

.landing { text-align: center; padding-top: 1.5rem; }

.landing-logo-wrap {
  text-align: center;
  margin-bottom: 1rem;
}
.landing-logo {
  max-width: 220px;
  height: auto;
  opacity: 0.7;
}

.landing-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  margin-bottom: 1.25rem;
}
.landing-oemer {
  width: 110px;
  height: auto;
  flex-shrink: 0;
}
.landing-hero-text { flex: 1; }

.game-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.game-subtitle {
  color: var(--muted);
  font-size: 1rem;
  margin: 0.25rem 0 0.5rem;
}

.landing-desc {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0;
}

.landing-hint {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
  margin-top: 1.5rem;
  text-align: left;
  border-left: 3px solid var(--accent);
  padding-left: 0.75rem;
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #30363d;
}

.join-form {
  display: flex;
  gap: 0.5rem;
}

.code-input {
  flex: 1;
  padding: 0.85rem 1rem;
  border: 2px solid #30363d;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.25em;
  font-family: var(--font);
}
.code-input:focus {
  outline: none;
  border-color: var(--accent);
}
.code-input::placeholder {
  color: var(--muted);
  letter-spacing: 0.15em;
  font-weight: 400;
}

/* ===== Buttons ===== */

.btn {
  display: block;
  width: 100%;
  padding: 0.85rem 1rem;
  margin: 0;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  line-height: 1.35;
  font-family: var(--font);
  transition: filter 0.15s, transform 0.1s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, #238636, #1f6feb);
  color: #fff;
  text-align: center;
}

.btn-secondary {
  background: var(--accent);
  color: #fff;
  text-align: center;
  min-width: 110px;
}

.btn-large { padding: 1rem; font-size: 1.1rem; }

.btn-danger {
  background: var(--danger);
  color: #fff;
  text-align: center;
}

.btn-ghost {
  background: transparent;
  border: 1px solid #30363d;
  text-align: center;
}

.btn-small {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

/* ===== Game Header ===== */

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.game-title-small {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.session-code {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  margin-left: 0.5rem;
  letter-spacing: 0.1em;
}

.round-badge {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--surface2);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent);
}

/* ===== Player Identity Card ===== */

.player-identity {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}

.identity-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.player-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--party);
  font-size: 0.8rem;
  font-weight: 600;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  text-align: center;
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 800;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* ===== Feedback Banner ===== */

.feedback {
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-align: center;
}
.feedback-ok {
  background: rgba(63, 185, 80, 0.15);
  border: 1px solid var(--ok);
  color: var(--ok);
}
.feedback-err {
  background: rgba(248, 81, 73, 0.15);
  border: 1px solid var(--danger);
  color: var(--danger);
}

/* ===== Deltas ===== */

.delta-pos { color: var(--ok); font-weight: 700; }
.delta-neg { color: var(--danger); font-weight: 700; }
.delta-neutral { color: var(--muted); font-weight: 700; }

/* ===== Lobby ===== */

.lobby-section { text-align: center; }

.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
}

.qr-img {
  width: 180px;
  height: 180px;
  background: #fff;
  border-radius: 10px;
  padding: 6px;
}

.share-url {
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--accent);
  background: var(--surface);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  width: 100%;
  text-align: center;
}

.player-list {
  margin: 1rem 0;
  text-align: left;
}

.player-chip {
  display: inline-block;
  background: var(--surface);
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  margin: 0.2rem;
  font-size: 0.85rem;
}
.player-chip .chip-party {
  color: var(--party);
  font-weight: 600;
  margin-left: 0.3rem;
}
.player-chip.is-host {
  border: 1px solid var(--gold);
}

/* ===== Action Phase ===== */

.round-intro {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--accent);
}
.round-intro h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.round-intro p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.4; }

.action-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}
.action-btn:hover { border-color: #30363d; }
.action-btn.selected { border-color: var(--accent); background: rgba(61, 139, 253, 0.1); }
.action-btn.locked { opacity: 0.35; cursor: not-allowed; }
.action-btn .action-icon { font-size: 1.5rem; flex-shrink: 0; }
.action-btn .action-info { flex: 1; min-width: 0; }
.action-btn .action-name { font-weight: 700; font-size: 0.95rem; }
.action-btn .action-desc { font-size: 0.8rem; color: var(--muted); margin-top: 0.1rem; }
.action-btn .action-cost { font-size: 0.85rem; font-weight: 700; color: var(--gold); flex-shrink: 0; }
.action-btn .action-cost.free { color: var(--ok); }

.target-select {
  margin: 0.5rem 0;
  padding: 0.75rem;
  background: var(--surface2);
  border-radius: var(--radius);
}
.target-select label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.target-select select {
  width: 100%;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid #30363d;
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
}

.submit-bar {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.submit-bar .btn { flex: 1; text-align: center; }
.action-slots {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 0.4rem;
}

.submitted-banner {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  margin-top: 1rem;
}
.submitted-banner .check { font-size: 2rem; }
.submitted-banner p { color: var(--muted); margin: 0.5rem 0 0; }

/* ===== Results Phase ===== */

.results-section { margin-bottom: 1rem; }

/* Ömer Card – PNG + Sprechblase + Audio */
.oemer-card {
  background: linear-gradient(135deg, #1a2332, #1e293b);
  border: 1px solid var(--accent2);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
  transition: transform 0.1s;
}
.oemer-card:active { transform: scale(0.99); }
.oemer-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.oemer-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent2);
  flex-shrink: 0;
}
.oemer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.oemer-info { flex: 1; min-width: 0; }
.oemer-name {
  font-weight: 700;
  font-size: 0.95rem;
}
.oemer-role {
  font-size: 0.8rem;
  color: var(--muted);
}
.oemer-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent2);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}
.oemer-play-btn:hover { background: var(--accent); transform: scale(1.1); }
.oemer-play-btn:active { transform: scale(0.95); }
.oemer-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #c9d1d9;
}
.oemer-text p { margin: 0.4rem 0; }

/* Ömer Mini – PNG + Sprechblase (für Kontext-Kommentare) */
.oemer-mini {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.75rem 0;
}
.oemer-mini-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent2);
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.oemer-mini-bubble {
  flex: 1;
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 0.6rem 0.85rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
  position: relative;
}
.oemer-mini-bubble::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 8px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid var(--surface);
}
.oemer-mini-play {
  display: inline-block;
  margin-left: 0.4rem;
  cursor: pointer;
  color: var(--accent2);
  font-size: 0.9rem;
}
.oemer-mini-play:hover { color: var(--accent); }

.event-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  border-left: 4px solid var(--warn);
}
.event-card h4 { margin: 0 0 0.3rem; font-size: 0.95rem; }
.event-card p { margin: 0; color: var(--muted); font-size: 0.85rem; }
.event-affected {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--warn);
}

.player-result {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  border-radius: 8px;
  margin-bottom: 0.35rem;
}
.player-result .pr-name { font-weight: 600; font-size: 0.9rem; }
.player-result .pr-party { color: var(--party); font-size: 0.8rem; margin-left: 0.3rem; }
.player-result .pr-stats { text-align: right; font-size: 0.85rem; }
.player-result .pr-delta { font-size: 0.8rem; }
.player-result.is-me { border-left: 3px solid var(--accent); }

/* ===== Leaderboard ===== */

.leaderboard { margin: 0.75rem 0; }

.lb-entry {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface);
  border-radius: 8px;
  margin-bottom: 0.3rem;
}
.lb-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.lb-rank.gold { background: var(--gold); color: #000; }
.lb-rank.silver { background: #c0c0c0; color: #000; }
.lb-rank.bronze { background: #cd7f32; color: #000; }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-weight: 600; font-size: 0.9rem; }
.lb-party { color: var(--party); font-size: 0.8rem; margin-left: 0.3rem; }
.lb-values { text-align: right; }
.lb-followers { font-weight: 700; }
.lb-score { font-size: 0.8rem; color: var(--muted); }
.lb-entry.is-me { border-left: 3px solid var(--accent); }

/* ===== Final Results ===== */

.final-champion {
  text-align: center;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}
.champion-emoji { font-size: 2.5rem; }
.champion-title {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.3rem 0 0.1rem;
}
.champion-name {
  font-size: 1.3rem;
  font-weight: 800;
}

/* Final Hero (Ömer + Logo) */
.final-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 1.5rem 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.08), rgba(255, 215, 0, 0.08));
  border-radius: var(--radius);
}
.final-oemer-full {
  height: 140px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}
.final-logo {
  height: 80px;
  width: auto;
  object-fit: contain;
  opacity: 0.85;
}

/* Lobby Logo */
.lobby-logo {
  display: block;
  margin: 0.5rem auto 1rem;
  height: 90px;
  width: auto;
  object-fit: contain;
  opacity: 0.85;
}

.ranking-tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}
.ranking-tab {
  flex: 1;
  padding: 0.5rem;
  border: none;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  text-align: center;
}
.ranking-tab.active {
  background: var(--accent);
  color: #fff;
}

/* ===== Lessons Carousel ===== */

.carousel { position: relative; margin: 0.75rem 0; }

.carousel-track {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: #484f58 transparent;
}

.card {
  flex: 0 0 min(300px, 82vw);
  scroll-snap-align: start;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.card h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.card p { margin: 0; color: #c9d1d9; line-height: 1.45; font-size: 0.9rem; }

/* ===== Host Controls ===== */

.host-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0;
  padding: 0.75rem;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px dashed #30363d;
}
.host-controls .btn {
  flex: 1;
  min-width: 100px;
  text-align: center;
  font-size: 0.85rem;
  padding: 0.55rem 0.5rem;
}
.host-label {
  width: 100%;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 0.2rem;
}

/* ===== Status Banners ===== */

.status-banner {
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  background: var(--surface2);
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  text-align: center;
}

.hint {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
  border-left: 3px solid var(--accent);
  padding-left: 0.75rem;
  margin: 0.75rem 0;
}

/* ===== Waiting dots ===== */

.waiting-dots::after {
  content: "";
  animation: dots 1.5s steps(4) infinite;
}
@keyframes dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

/* ===== Utility ===== */

.mt-1 { margin-top: 0.75rem; }
.mb-1 { margin-bottom: 0.75rem; }
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-small { font-size: 0.85rem; }
.hidden { display: none !important; }
