/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:    #080e1c;
  --bg2:   #0c1428;
  --bg3:   #101d34;
  --card:  #0f1c30;
  --card2: #152438;
  --border:      #1c3050;
  --border-glow: #284878;
  --accent:      #ccff00;   /* neon yellow-green */
  --accent-ink:  #050d18;   /* dark text ON accent bg */
  --accent-dim:  #99cc00;
  --cyan:        #00e5ff;
  --gold:   #ffd700;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
  --text:   #ffffff;
  --text2:  #4a6888;
  --text3:  #8aaac8;
  --green:  #00e676;
  --red:    #ff5577;
  --radius:    14px;
  --radius-sm: 8px;
  --radius-xs: 5px;
}

::selection { background: rgba(204,255,0,0.2); color: var(--text); }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-glow); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  overflow-x: hidden;
}

#app { min-height: 100vh; }

/* ── Screens ── */
.screen { display: none; min-height: 100vh; padding: 24px; }
.screen.active { display: flex; flex-direction: column; animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1); }

/* ── START SCREEN ── */
#screen-start {
  position: relative;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.start-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(204,255,0,0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 50%, rgba(0,229,255,0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(204,255,0,0.04) 0%, transparent 50%);
  animation: bgPulse 9s ease-in-out infinite alternate;
}
.start-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(204,255,0,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 72%);
}
@keyframes bgPulse {
  0%   { opacity: 0.55; transform: scale(1); }
  100% { opacity: 1;    transform: scale(1.05); }
}

.start-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

/* ── Logo ── */
.logo { text-align: center; line-height: 1; }

.logo-gif {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(72px, 20vw, 120px);
  letter-spacing: 4px;
  display: block;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 50%, var(--accent) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 28px rgba(204,255,0,0.35));
  animation: logoShimmer 5s ease-in-out infinite;
}
@keyframes logoShimmer {
  0%,100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.logo-battle {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(36px, 10vw, 60px);
  color: var(--text);
  letter-spacing: 14px;
  display: block;
  margin-top: -10px;
  opacity: 0.8;
}

.logo-fire {
  font-size: 36px;
  animation: bounce 1.8s ease-in-out infinite;
  display: inline-block;
  margin-top: 4px;
}
@keyframes bounce {
  0%,100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-9px) rotate(4deg); }
}

/* ── Start Card ── */
.start-card {
  width: 100%;
  background: rgba(15,28,48,0.75);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  backdrop-filter: blur(24px);
  box-shadow: 0 8px 48px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.04);
}

/* ── Inputs ── */
input[type="text"] {
  width: 100%;
  background: rgba(8,14,28,0.9);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 17px;
  font-weight: 700;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(204,255,0,0.08);
}
input[type="text"]::placeholder { color: var(--text2); font-weight: 600; }

.start-buttons { display: flex; flex-direction: column; gap: 12px; }

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-glow), transparent);
}

.join-section { display: flex; flex-direction: column; gap: 12px; }
.code-boxes { display: flex; gap: 10px; justify-content: center; }

.code-box {
  width: 60px;
  height: 68px;
  background: rgba(8,14,28,0.9);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 34px;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  caret-color: transparent;
}
.code-box:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(204,255,0,0.08);
  transform: translateY(-2px);
}
.code-box.filled {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Buttons ── */
.btn {
  display: block;
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 4px 20px rgba(204,255,0,0.25);
}
.btn-primary:hover {
  background: #d8ff1a;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(204,255,0,0.4);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--card2);
  color: var(--text3);
  border: 1px solid var(--border-glow);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm { padding: 10px 16px; font-size: 14px; width: auto; }

.error-msg { color: var(--red); font-weight: 700; font-size: 14px; min-height: 20px; text-align: center; }

/* ── LOBBY ── */
#screen-lobby {
  /* center the inner column */
  align-items: center;
  justify-content: flex-start;
  padding: 32px 20px;
}

.lobby-inner {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

/* Header row: title block + settings gear */
.lobby-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.lobby-title-block { display: flex; flex-direction: column; gap: 4px; }
.lobby-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px;
  letter-spacing: 2px;
  color: var(--accent);
  line-height: 1;
}
.lobby-tagline {
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  letter-spacing: 0.2px;
}

/* Invite code — poster treatment */
.invite-poster {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
/* Subtle accent corner glow */
.invite-poster::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(204,255,0,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.invite-poster-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--text2);
  text-transform: uppercase;
}
.invite-code-wrap { display: flex; align-items: center; gap: 10px; }
.invite-code {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 52px;
  letter-spacing: 10px;
  color: var(--accent);
  text-shadow: 0 0 24px rgba(204,255,0,0.4);
  line-height: 1;
}
.btn-copy {
  background: rgba(204,255,0,0.06);
  border: 1px solid rgba(204,255,0,0.18);
  border-radius: var(--radius-xs);
  color: var(--text2);
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-copy:hover { color: var(--accent); border-color: var(--accent); }

.invite-poster-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  font-style: italic;
}

.btn-icon {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  padding: 7px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--text2);
  flex-shrink: 0;
}
.btn-icon:hover { border-color: var(--border-glow); color: var(--accent); transform: rotate(25deg); }

/* Players section */
.lobby-players-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--text2);
  text-transform: uppercase;
}

.players-list { display: flex; flex-direction: column; gap: 8px; }

.player-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  transition: border-color 0.2s, transform 0.2s;
  animation: fadeInUp 0.3s ease both;
}
.player-item:hover { border-color: var(--border-glow); transform: translateX(3px); }

.player-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 900;
  color: var(--accent-ink);
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(204,255,0,0.18);
}
.player-name { font-weight: 800; font-size: 16px; flex: 1; }
.player-host-badge {
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Settings panel */
.settings-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.settings-panel h3 { font-size: 11px; font-weight: 900; color: var(--accent); letter-spacing: 2px; text-transform: uppercase; }
.setting-row { display: flex; flex-direction: column; gap: 8px; }
.setting-row label { font-size: 13px; font-weight: 700; color: var(--text2); display: flex; justify-content: space-between; }
.setting-row label span { color: var(--text); font-weight: 900; }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 4px; cursor: pointer; }
.settings-panel.hidden { display: none; }

.lobby-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}
.lobby-status { font-size: 13px; color: var(--text2); font-weight: 600; text-align: center; }
.hidden { display: none !important; }

/* ── PHASE HEADER ── */
.phase-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 20px;
  flex-shrink: 0;
}
.phase-header--center {
  justify-content: center;
}

.phase-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text2);
  text-transform: uppercase;
}

/* Timer: big clean number, no pill */
.timer-pill {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  line-height: 1;
  color: var(--accent);
  background: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  min-width: unset;
  transition: color 0.3s;
}
.timer-label-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text2);
  letter-spacing: 0.5px;
  margin-left: 2px;
}
.timer-label-text--sm { font-size: 13px; }

.timer-pill.warning { color: #ffaa00; }
.timer-pill.danger  { color: var(--red); animation: timerPulse 0.5s ease-in-out infinite; }
@keyframes timerPulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.14); }
}

/* ── SCENARIO VOTE ── */
#screen-scenario {
  padding: 0;
  overflow: hidden;
}

/* Timer bar at top — full width */
#screen-scenario > .phase-header {
  padding: 20px 28px 16px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
}
#screen-scenario > .phase-header .timer-pill { font-size: 38px; }
#screen-scenario > .phase-header .timer-label-text { font-size: 16px; }

/* Split container */
.scenario-split {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Decorative left panel – hidden on mobile */
.vote-deco-left {
  display: none;
  flex: 0 0 38%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  border-right: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.vote-deco-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(204,255,0,0.04) 0%, transparent 70%);
}

/* Outlined "VoTe" text like the reference */
.vote-deco-word {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(72px, 7vw, 110px);
  letter-spacing: 6px;
  color: transparent;
  -webkit-text-stroke: 3px var(--accent);
  line-height: 1;
  position: relative;
}
.vote-deco-sub {
  font-family: 'Nunito', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text2);
  letter-spacing: 3px;
}
.vote-deco-stars {
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 14px;
  margin-top: 8px;
  opacity: 0.5;
  animation: starBlink 3s ease-in-out infinite;
}
@keyframes starBlink {
  0%,100% { opacity: 0.35; }
  50%      { opacity: 0.75; }
}

/* Right side: question + options */
.scenario-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 14px;
  overflow-y: auto;
}

@media (min-width: 680px) {
  .vote-deco-left { display: flex; }
}

.scenario-question {
  font-size: 12px;
  font-weight: 800;
  color: var(--text2);
  letter-spacing: 3px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.scenario-options { display: flex; flex-direction: column; gap: 12px; flex: 1; }

.scenario-btn {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.scenario-btn:hover {
  border-color: var(--accent);
  background: rgba(204,255,0,0.03);
  transform: translateY(-2px);
}
.scenario-btn.selected {
  border-color: var(--accent);
  background: rgba(204,255,0,0.06);
}
.scenario-btn.selected::after {
  content: '✓';
  position: absolute;
  top: 16px;
  right: 18px;
  font-size: 18px;
  color: var(--accent);
  font-weight: 900;
}

.option-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--text2);
  text-transform: uppercase;
}
.scenario-btn.selected .option-label { color: var(--accent); }

.option-text { font-size: clamp(18px, 2.2vw, 24px); font-weight: 800; color: var(--text); line-height: 1.5; }

.vote-badge {
  font-size: 12px;
  font-weight: 800;
  color: var(--text2);
  letter-spacing: 1px;
  margin-top: 4px;
}
.scenario-btn.selected .vote-badge { color: var(--accent); }

/* Remove the old OR divider (not in new HTML) */
.or-divider { display: none; }

/* ── SCENARIO RESULT ── */
/* Inspired by voted_setup.png: big text floating in dark space */
#screen-scenario-result {
  align-items: flex-start;
  justify-content: center;
  padding: 48px 36px;
}
.result-banner {
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  max-width: 640px;
}
.result-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--text2);
  text-transform: uppercase;
}
.result-scenario-text {
  font-size: clamp(26px, 4.5vw, 40px);
  font-weight: 900;
  line-height: 1.35;
  color: var(--text);
  /* No card/border — just raw text like the reference */
  background: none;
  border: none;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}
/* Player name highlights inside the text */
.result-scenario-text .player-highlight { color: var(--accent); background: none; padding: 0; }

.result-votes-display { display: none; }

.result-next-hint {
  font-size: 14px;
  color: var(--text2);
  font-weight: 600;
  animation: fadeInUp 0.6s ease;
}

/* ── GIF SEARCH ── */
#screen-gif-search {
  gap: 16px;
  padding: 20px;
  align-items: stretch;
}
#screen-gif-search > .terminal-card {
  flex: 1;
  min-height: 0;
}

/* Timer + Szenario untereinander, zentriert im Terminal */
.gif-terminal-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  flex-shrink: 0;
}

.gif-timer-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  justify-content: center;
}
.gif-timer-row .timer-pill { font-size: 26px; }
.gif-timer-row .timer-label-text { font-size: 13px; }

.gif-scenario-reminder-inline {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(18px, 2.8vw, 30px);
  color: var(--accent);
  letter-spacing: 2px;
  line-height: 1.25;
  text-align: center;
  max-width: 560px;
  text-shadow: 0 0 24px rgba(204,255,0,0.2);
}

.giphy-attribution-logo {
  width: clamp(90px, 14vw, 140px);
  opacity: 0.8;
  margin-top: 2px;
  pointer-events: none;
  display: block;
  align-self: flex-start;
}

/* Mobile: oben verstecken, unten zeigen */
.giphy-attribution-mobile {
  display: none;
  padding: 12px 20px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .gif-terminal-info .giphy-attribution-logo {
    display: none;
  }
  .giphy-attribution-mobile {
    display: flex;
    justify-content: center;
  }
  .giphy-attribution-mobile .giphy-attribution-logo {
    width: 110px;
    align-self: auto;
  }
}

/* Terminal / code-editor card */
.terminal-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.35);
  min-height: 0;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--card2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.terminal-dots { display: flex; gap: 6px; align-items: center; }
.tdot { width: 11px; height: 11px; border-radius: 50%; }
.tdot-red    { background: #ff5f57; }
.tdot-yellow { background: #febc2e; }
.tdot-green  { background: #28c840; }

.terminal-title {
  flex: 1;
  text-align: center;
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  letter-spacing: 1px;
  /* offset for visual centering against the dots */
  margin-right: 52px;
}

.gif-scenario-reminder {
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.gif-scenario-reminder strong { color: var(--text); }

.gif-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.plus-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--bg3);
  border: 2px dashed var(--border-glow);
  border-radius: 12px;
  padding: 48px 60px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.plus-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(204,255,0,0.08);
}
.plus-icon {
  font-size: 72px;
  line-height: 1;
  color: var(--accent);
  font-family: 'Bebas Neue', sans-serif;
  text-shadow: 0 0 16px rgba(204,255,0,0.3);
}
.plus-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text2);
  letter-spacing: 3px;
  text-transform: uppercase;
}

.gif-selected-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
}
.gif-selected-preview img {
  max-width: min(612px, 81vw);  /* presentation ist min(680px, 90vw) → 90% davon */
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
}

/* ── GIPHY MODAL – partielles Bottom-Sheet ── */
.giphy-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
}
.giphy-modal-inner {
  width: 100%;
  max-height: 70vh; /* Fallback; wird per JS überschrieben */
  background: var(--bg2);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid var(--border-glow);
  box-shadow: 0 -12px 60px rgba(0,0,0,0.85);
  animation: slideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.giphy-header {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.giphy-header input { flex: 1; }
.btn-close {
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text3);
  font-size: 16px;
  font-weight: 700;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-close:hover { background: var(--red); color: white; border-color: var(--red); }

.giphy-results {
  display: flex;
  flex-direction: row;
  gap: 6px;
  padding: 10px 12px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  align-items: flex-start;
}
.giphy-col { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.giphy-result-item {
  break-inside: avoid;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--card2);
  transition: all 0.15s ease;
  width: 100%;
}
.giphy-result-item:hover {
  box-shadow: 0 0 0 3px var(--accent), 0 4px 16px rgba(204,255,0,0.15);
  transform: scale(1.02);
}
.giphy-result-item img { width: 100%; height: auto; display: block; }

/* Player highlight */
.player-highlight { color: var(--accent); font-weight: 900; background: rgba(204,255,0,0.07); border-radius: 3px; padding: 0 3px; }
.giphy-loading { text-align: center; color: var(--text2); padding: 40px; font-weight: 700; }

/* ── GIF PRESENTATION ── */
/* Inspired by presentation_of_all_gifs.png: stacked card depth effect */
#screen-gif-presentation { align-items: center; justify-content: center; gap: 16px; }
#screen-gif-presentation > .phase-header { margin-bottom: 0; }

.presentation-counter {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--text2);
  text-transform: uppercase;
}

/* Stacked card effect */
.presentation-gif-wrap {
  width: 100%;
  max-width: min(680px, 90vw);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-glow);
  background: var(--card);
  position: relative;
  /* Two card shadows behind to create depth */
  box-shadow:
    10px 10px 0px 0px var(--border),
    20px 20px 0px 0px rgba(204,255,0,0.06);
}
.presentation-gif-wrap img { width: 100%; height: auto; display: block; }

.presentation-progress {
  width: 100%;
  max-width: min(680px, 90vw);
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  /* align with the card left edge */
  margin-left: 0;
}
.presentation-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width linear;
  box-shadow: 0 0 8px rgba(204,255,0,0.4);
}

/* ── GIF VOTING – Desktop optimiert ── */
#screen-gif-voting {
  gap: 10px;
  padding: 20px;
}

.voting-scenario {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(18px, 2.8vw, 30px);
  color: var(--accent);
  letter-spacing: 2px;
  line-height: 1.25;
  text-align: center;
  text-shadow: 0 0 24px rgba(204,255,0,0.2);
  flex-shrink: 0;
}

.vote-status {
  font-size: 13px;
  color: var(--text2);
  font-weight: 700;
  text-align: center;
  margin-top: 4px;
}

.voting-grid {
  display: flex;
  flex-direction: row;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  align-items: flex-start;
  min-height: 0;
  padding: 8px 4px;
}

.voting-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.voting-item {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.voting-item img {
  width: 100%;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  background: var(--bg2);
  display: block;
}

/* Desktop: Größere Spalten, aber GIFs begrenzt */
@media (min-width: 768px) {
  .voting-grid {
    gap: 16px;
  }
  
  .voting-col {
    gap: 16px;
  }
  
  .voting-item img {
    max-height: 200px;
  }
}

@media (min-width: 1024px) {
  .voting-item img {
    max-height: 220px;
  }
}

/* Mobile: etwas kompakter */
@media (max-width: 767px) {
  .voting-grid {
    gap: 8px;
  }
  
  .voting-col {
    gap: 8px;
  }
  
  .voting-item img {
    max-height: 140px;
  }
}

.voting-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(204, 255, 0, 0.2);
  transform: scale(1.015);
}

.voting-item-label {
  padding: 7px 8px;
  font-size: 10px;
  font-weight: 800;
  color: var(--text2);
  text-align: center;
  background: var(--bg3);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.voting-item.selected .voting-item-label {
  color: var(--accent);
  background: rgba(204, 255, 0, 0.07);
}

/* ── ROUND RESULT ── */

/* ── RUNDEN-ERGEBNIS mit Szenario ── */
.round-result-scenario {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(18px, 2.8vw, 30px);
  color: var(--accent);
  letter-spacing: 2px;
  line-height: 1.25;
  text-align: center;
  text-shadow: 0 0 24px rgba(204,255,0,0.2);
  margin: 4px 0 8px 0;
}

/* ── PRÄSENTATION mit Szenario ── */
.presentation-scenario {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(204, 255, 0, 0.1);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  text-align: center;
  word-break: break-word;
}

#presentation-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ── PRESENTATION SCENARIO BIG ── */
.presentation-scenario-big {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(22px, 3.8vw, 40px);
  color: var(--accent);
  text-align: center;
  letter-spacing: 3px;
  padding: 0 32px;
  line-height: 1.25;
  flex-shrink: 0;
  text-shadow: 0 0 32px rgba(204,255,0,0.25);
  animation: scenarioReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes scenarioReveal {
  from { opacity: 0; transform: translateY(-14px); letter-spacing: 10px; filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0);     letter-spacing: 3px;  filter: blur(0); }
}

/* Inspired by round_winner_presentation.png */
#screen-round-result { justify-content: flex-start; overflow-y: auto; }
.round-result-content { display: flex; flex-direction: column; gap: 20px; max-width: 700px; margin: 0 auto; width: 100%; }

.round-result-header { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.round-result-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--text2);
  text-transform: uppercase;
}
.round-result-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(40px, 8vw, 64px);
  letter-spacing: 3px;
  color: var(--text);
  line-height: 1;
}

.round-podium { display: flex; flex-direction: column; gap: 12px; }
.podium-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 16px 22px;
  border: 1px solid var(--border);
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.podium-item:nth-child(1) { animation-delay: 0.05s; border-color: rgba(204,255,0,0.25); }
.podium-item:nth-child(2) { animation-delay: 0.12s; }
.podium-item:nth-child(3) { animation-delay: 0.19s; }
.podium-item img { width: 120px; height: auto; border-radius: 8px; flex-shrink: 0; border: 1px solid var(--border); }
.podium-rank { font-family: 'Bebas Neue', sans-serif; font-size: 44px; width: 48px; flex-shrink: 0; }
.podium-rank.gold   { color: var(--gold); }
.podium-rank.silver { color: var(--silver); }
.podium-rank.bronze { color: var(--bronze); }
.podium-info { flex: 1; min-width: 0; }
.podium-name { font-weight: 800; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium-pts { font-size: 14px; color: var(--accent); font-weight: 700; margin-top: 3px; }

.scoreboard-title {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--text2);
  text-transform: uppercase;
}
.round-scoreboard { display: flex; flex-direction: column; gap: 6px; }
.score-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  border: 1px solid var(--border);
  transition: transform 0.15s;
}
.score-item:hover { transform: translateX(3px); }
.score-name { font-weight: 800; font-size: 16px; }
.score-pts { font-family: 'Bebas Neue', sans-serif; font-size: 28px; color: var(--accent); }

/* ── GAME OVER ── */
/* Inspired by screen_before_winner_presentation_after_vote.png */
#screen-game-over { align-items: center; justify-content: center; }
.game-over-content { display: flex; flex-direction: column; align-items: center; gap: 28px; max-width: 440px; width: 100%; }
.game-over-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(48px, 10vw, 72px);
  letter-spacing: 4px;
  text-align: center;
  color: var(--text);
  line-height: 1;
}

.final-podium { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.final-podium-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius);
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.final-podium-item:nth-child(1) { animation-delay: 0.1s; }
.final-podium-item:nth-child(2) { animation-delay: 0.22s; }
.final-podium-item:nth-child(3) { animation-delay: 0.34s; }
.final-podium-item.rank-1 {
  background: rgba(204,255,0,0.07);
  border: 2px solid rgba(204,255,0,0.4);
}
.final-podium-item.rank-2 {
  background: rgba(192,192,192,0.06);
  border: 1px solid rgba(192,192,192,0.22);
}
.final-podium-item.rank-3 {
  background: rgba(205,127,50,0.06);
  border: 1px solid rgba(205,127,50,0.22);
}
.final-rank-emoji { font-size: 32px; }
.final-rank-name { font-size: 19px; font-weight: 900; flex: 1; }
.final-rank-score { font-family: 'Bebas Neue', sans-serif; font-size: 32px; color: var(--accent); }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,28,48,0.96);
  border: 1px solid var(--border-glow);
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 700;
  font-size: 14px;
  z-index: 999;
  white-space: nowrap;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  animation: slideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(16px);
}
.toast.error   { border-color: var(--red); color: var(--red); background: rgba(255,85,119,0.1); }
.toast.success { border-color: var(--green); color: var(--green); background: rgba(0,230,118,0.08); }

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(18px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

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

.amanda-bonus {
  font-size: 11px;
  color: var(--accent);
  font-style: italic;
  margin-top: 4px;
  opacity: 0.9;
  letter-spacing: 0.5px;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.2s ease-out;
}

.modal-overlay.hidden {
  display: none;
}

.modal-container {
  position: relative;
  background: linear-gradient(135deg, var(--card) 0%, var(--bg2) 100%);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  padding: 32px 32px 32px 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(204, 255, 0, 0.1);
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close-x {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text2);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: all 0.2s;
  line-height: 1;
}

.modal-close-x:hover {
  color: var(--accent);
  background: rgba(204, 255, 0, 0.1);
  transform: scale(1.1);
}

.modal-message {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  padding: 8px 16px;
  word-break: break-word;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Unterschiedliche Textfarben je nach Typ */
.modal-overlay.error .modal-message {
  color: var(--red);
}

.modal-overlay.warning .modal-message {
  color: #ffaa00;
}

.modal-overlay.success .modal-message {
  color: var(--green);
}

.modal-overlay.info .modal-message {
  color: var(--accent);
}

/* ── BONUS INFO (im gleichen Container) ── */
.bonus-info {
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(204, 255, 0, 0.12);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  animation: bonusPulse 1s ease-in-out;
}

.bonus-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.3px;
  display: block;
  line-height: 1.4;
}

@keyframes bonusPulse {
  0% {
    opacity: 0;
    transform: translateX(-10px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── PLAYER BADGES ── */
.player-badge {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.player-badge:hover { transform: scale(1.12); }
.badge-initial {
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  user-select: none;
}
.badge-check-mark {
  position: absolute;
  bottom: -3px;
  right: -3px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 8px;
  font-weight: 900;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 1px solid var(--bg);
}
.player-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* ── SCENARIO VOTER BADGES ── */
.scenario-voter-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 0;
}
.scenario-voter-badges:empty { display: none; }

/* ── TERMINAL BADGES (GIF-Suche) ── */
.terminal-badges {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-left: auto;
}
.terminal-badges .player-badge {
  width: 24px;
  height: 24px;
}
.terminal-badges .badge-initial { font-size: 10px; }
.terminal-badges .badge-check-mark {
  width: 11px;
  height: 11px;
  font-size: 7px;
  bottom: -2px;
  right: -2px;
}

/* ── VOTING TOP BAR ── */
.voting-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.voting-top-info {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

/* ── VOTING IS-MINE ── */
.voting-item.is-mine {
  border-color: var(--border);
  cursor: default;
  opacity: 0.75;
}
/* Hover-Effekt für wählbare Items */
.voting-item:not(.is-mine):hover {
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(204, 255, 0, 0.2);
  transform: translateY(-3px) scale(1.015);
}
/* Hovern über das gesamte Item löst auch den Button-Effekt aus */
.voting-item:not(.is-mine):hover .vote-btn::before { left: 110%; }
.voting-item:not(.is-mine):hover .vote-btn { color: transparent; border-color: rgba(204,255,0,0.3); }
.voting-item:not(.is-mine):hover .vote-btn .vote-base { opacity: 0; }
.voting-item:not(.is-mine):hover .vote-btn::after { opacity: 1; }

/* ── VOTE BUTTON ── */
.vote-btn {
  display: block;
  width: 100%;
  padding: 9px 12px;
  background: var(--bg3);
  border: none;
  border-top: 1px solid var(--border);
  color: var(--text2);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 15px;
  letter-spacing: 2px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-align: center;
  transition: color 0.25s, border-color 0.25s;
}

/* Diagonaler Accent-Sweep */
.vote-btn::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -60%;
  width: 50%;
  height: 140%;
  background: linear-gradient(to right,
    transparent,
    rgba(204,255,0,0.3),
    transparent
  );
  transform: skewX(-18deg);
  transition: left 0.35s ease;
  pointer-events: none;
}
.vote-btn:hover::before {
  left: 110%;
}

/* Text-Swap: "Vote für mich" on hover */
.vote-base {
  position: relative;
  z-index: 1;
  transition: opacity 0.18s;
  display: inline-block;
}
.vote-btn::after {
  content: 'Vote für mich';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  color: var(--accent);
  font-size: 15px;
  letter-spacing: 2px;
  opacity: 0;
  transition: opacity 0.18s;
  pointer-events: none;
}
.vote-btn:hover { color: transparent; border-color: rgba(204,255,0,0.3); }
.vote-btn:hover .vote-base { opacity: 0; }
.vote-btn:hover::after { opacity: 1; }

/* Selected state */
.voting-item.selected .vote-btn {
  background: rgba(204,255,0,0.1);
  border-color: rgba(204,255,0,0.4);
  color: transparent;
}
.voting-item.selected .vote-btn::after {
  content: '✓ Gewählt';
  opacity: 1;
  color: var(--accent);
}
.voting-item.selected .vote-base { opacity: 0; }

/* Mein GIF Button */
.vote-btn-mine {
  display: block;
  width: 100%;
  padding: 9px 12px;
  background: rgba(204,255,0,0.06);
  border: none;
  border-top: 1px solid rgba(204,255,0,0.2);
  color: var(--accent);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 15px;
  letter-spacing: 3px;
  cursor: default;
  text-align: center;
}

/* ── GIPHY MODAL SCENARIO BAR ── */
.giphy-scenario-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(204, 255, 0, 0.06);
  border-bottom: 1px solid rgba(204, 255, 0, 0.15);
  flex-shrink: 0;
}
.giphy-scenario-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text3);
  line-height: 1.4;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}
.giphy-timer-display {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}
#giphy-timer-mirror {
  color: var(--accent);
}

/* ── Lottie: Cats (Start Screen) — position controlled by JS ── */
.lottie-cat {
  position: fixed;
  width: 130px;
  height: 130px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  /* initial off-screen to avoid flash before JS kicks in */
  left: -200px;
  top: -200px;
}

/* ── Lottie: Thumb Overlay (Voting) — positioned via JS on selected GIF ── */
.thumb-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
}
.thumb-overlay.hidden { display: none; }

/* ── Lottie: Fireworks (Game Over edges) ── */
.lottie-firework {
  position: fixed;
  top: 0;
  height: 100vh;
  /* spans from viewport edge to just before centered content (~440px) */
  width: max(80px, calc((100vw - 440px) / 2 - 24px));
  pointer-events: none;
  z-index: 2;
}
.lottie-firework-left  { left:  0; }
.lottie-firework-right { right: 0; }

/* ── Lottie: Confetti (Game Over, next to rank 1) ── */
.lottie-confetti {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  width: 130px;
  height: 130px;
  pointer-events: none;
  margin-right: 6px;
}