/* --- Mitster Card Creator — 80s Synthwave Edition --- */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@400;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --- Welcome Overlay --- */
.welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 1, 24, 0.95);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.welcome-card {
  max-width: 550px;
  background: linear-gradient(135deg, rgba(185, 77, 255, 0.08), rgba(0, 240, 255, 0.05));
  border: 1px solid rgba(185, 77, 255, 0.25);
  border-radius: 16px;
  padding: 2rem;
  text-align: left;
  font-family: 'Rajdhani', sans-serif;
  color: #e0e0e0;
  line-height: 1.6;
}

.welcome-card h2 {
  font-family: 'Orbitron', sans-serif;
  color: #ff2d95;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.welcome-card p {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.welcome-card strong {
  color: #00f0ff;
}

.welcome-signature {
  margin-top: 1rem;
  font-family: 'Orbitron', sans-serif;
  color: #b94dff;
  font-size: 1.1rem;
}

.welcome-card .btn {
  margin-top: 1.5rem;
  width: 100%;
  font-size: 1.1rem;
}

/* --- Tutorial Overlay --- */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  pointer-events: none;
}

.tutorial-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 1, 24, 0.85);
  pointer-events: auto;
  transition: clip-path 0.4s ease;
}

.tutorial-tooltip {
  position: fixed;
  max-width: 320px;
  background: linear-gradient(135deg, #1a0a3e, #0d0221);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 12px;
  padding: 1.2rem;
  color: #e0e0e0;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
  pointer-events: auto;
  z-index: 3001;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.15), 0 8px 32px rgba(0, 0, 0, 0.5);
  transition: top 0.4s ease, bottom 0.4s ease, left 0.4s ease;
}

.tutorial-tooltip.tutorial-center {
  top: 50% !important;
  left: 50% !important;
  bottom: auto !important;
  transform: translate(-50%, -50%);
}

.tutorial-text {
  margin-bottom: 1rem;
}

.tutorial-text strong {
  color: #00f0ff;
}

.tutorial-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tutorial-step-indicator {
  color: #888;
  font-size: 0.8rem;
}

.tutorial-nav .btn {
  min-width: 100px;
}

:root {
  --neon-pink: #ff2d95;
  --neon-cyan: #00f0ff;
  --neon-purple: #b94dff;
  --neon-yellow: #ffe14d;
  --dark-bg: #0d0221;
  --darker-bg: #080118;
  --card-bg: rgba(13, 2, 33, 0.8);
  --glow-pink: 0 0 10px rgba(255, 45, 149, 0.5), 0 0 30px rgba(255, 45, 149, 0.2);
  --glow-cyan: 0 0 10px rgba(0, 240, 255, 0.5), 0 0 30px rgba(0, 240, 255, 0.2);
}

body {
  font-family: 'Rajdhani', 'Segoe UI', sans-serif;
  background: var(--dark-bg);
  color: #e0d4f7;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Retro Grid Background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(transparent 0%, rgba(13, 2, 33, 0.8) 100%),
    linear-gradient(90deg, rgba(255, 45, 149, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  animation: gridScroll 20s linear infinite;
  z-index: -1;
}

@keyframes gridScroll {
  0% { background-position: 0 0, 0 0, 0 0; }
  100% { background-position: 0 0, 0 40px, 0 40px; }
}

/* Horizon glow */
body::after {
  content: '';
  position: fixed;
  bottom: -50%;
  left: -20%;
  right: -20%;
  height: 80%;
  background: radial-gradient(ellipse at center, rgba(185, 77, 255, 0.15) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
}

.hidden { display: none !important; }

/* --- Common --- */
.back-link {
  color: rgba(0, 240, 255, 0.6);
  text-decoration: none;
  font-size: 0.9rem;
  font-family: 'Orbitron', monospace;
  letter-spacing: 0.05em;
  transition: color 0.2s, text-shadow 0.2s;
}
.back-link:hover {
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: 'Orbitron', monospace;
  text-decoration: none;
  cursor: pointer;
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: transform 0.15s, box-shadow 0.3s, background 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  color: #fff;
  box-shadow: var(--glow-pink);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 20px rgba(255, 45, 149, 0.6), 0 0 50px rgba(255, 45, 149, 0.3);
}

.btn-ghost {
  background: transparent;
  color: rgba(0, 240, 255, 0.7);
  border: 1px solid rgba(0, 240, 255, 0.3);
}
.btn-ghost:hover {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.btn-small {
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
}

.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1rem;
}

.btn-add {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  color: #000;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--glow-cyan);
  font-family: inherit;
}

.badge {
  background: rgba(0, 240, 255, 0.1);
  color: var(--neon-cyan);
  padding: 0.3rem 0.8rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: 'Orbitron', monospace;
  border: 1px solid rgba(0, 240, 255, 0.2);
  text-shadow: var(--glow-cyan);
}

/* --- Start View & Login Hint --- */
#start-view,
#login-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
}

#start-view .back-link,
#login-hint .back-link {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
}

.logo {
  font-size: 5rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 20px rgba(255, 45, 149, 0.5));
  animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(255, 45, 149, 0.5)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 40px rgba(0, 240, 255, 0.6)); transform: scale(1.05); }
}

#start-view h1,
#login-hint h1 {
  font-family: 'Orbitron', monospace;
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-cyan), var(--neon-purple));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.subtitle {
  color: rgba(185, 77, 255, 0.7);
  margin-bottom: 2rem;
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.name-input-group {
  margin-bottom: 1.5rem;
  width: 100%;
  max-width: 300px;
}

.name-input-group label {
  display: block;
  font-size: 0.8rem;
  color: rgba(0, 240, 255, 0.6);
  margin-bottom: 0.5rem;
  font-family: 'Orbitron', monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.name-input-group input {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 45, 149, 0.3);
  background: rgba(13, 2, 33, 0.8);
  color: #fff;
  font-size: 1.1rem;
  font-family: 'Orbitron', monospace;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.name-input-group input:focus {
  border-color: var(--neon-pink);
  box-shadow: var(--glow-pink);
}

/* --- Editor View --- */
#editor-view {
  max-width: 700px;
  margin: 0 auto;
  padding: 1.5rem;
  padding-bottom: 160px;
}

.editor-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(185, 77, 255, 0.2);
}

.editor-header h2 {
  flex: 1;
  font-size: 1.3rem;
  font-weight: 700;
  font-family: 'Orbitron', monospace;
  color: var(--neon-pink);
  text-shadow: 0 0 10px rgba(255, 45, 149, 0.3);
}

/* --- Search --- */
.search-section {
  margin-bottom: 1.5rem;
  text-align: left;
}

.search-box {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  justify-content: flex-start;
}

.search-box input {
  flex: 1;
  padding: 0.7rem 1rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 240, 255, 0.2);
  background: rgba(8, 1, 24, 0.9);
  color: #fff;
  font-size: 1rem;
  font-family: 'Rajdhani', sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: left;
}

.search-box input:focus {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.search-results {
  max-height: 400px;
  overflow-y: auto;
  border-radius: 4px;
}

.search-results::-webkit-scrollbar { width: 6px; }
.search-results::-webkit-scrollbar-track { background: transparent; }
.search-results::-webkit-scrollbar-thumb { background: rgba(185, 77, 255, 0.3); border-radius: 3px; }

.search-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: 4px;
  transition: background 0.2s, box-shadow 0.2s;
  cursor: default;
  border: 1px solid transparent;
}

.search-item:hover {
  background: rgba(185, 77, 255, 0.08);
  border-color: rgba(185, 77, 255, 0.15);
}

.search-item.already-added { opacity: 0.4; }
.search-item.artist-full { opacity: 0.4; }

.search-cover, .card-cover {
  width: 44px;
  height: 44px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--darker-bg);
  border: 1px solid rgba(185, 77, 255, 0.2);
}

.search-info, .card-info { flex: 1; min-width: 0; }

.search-title, .card-title {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.search-artist, .card-artist {
  color: rgba(0, 240, 255, 0.6);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.added-badge {
  color: var(--neon-cyan);
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
  text-shadow: var(--glow-cyan);
}

.loading, .empty, .error, .empty-cards {
  text-align: center;
  color: rgba(185, 77, 255, 0.5);
  padding: 1.5rem;
  font-size: 0.95rem;
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
}

.error a {
  color: var(--neon-pink);
  text-shadow: 0 0 8px rgba(255, 45, 149, 0.4);
}

/* --- Anecdote Dialog --- */
.anecdote-dialog {
  position: fixed;
  inset: 0;
  background: rgba(8, 1, 24, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.anecdote-content {
  background: var(--dark-bg);
  border-radius: 4px;
  padding: 1.5rem;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid rgba(255, 45, 149, 0.3);
  box-shadow: 0 0 30px rgba(255, 45, 149, 0.15), 0 0 60px rgba(185, 77, 255, 0.1);
  animation: dialogIn 0.3s ease-out;
}

@keyframes dialogIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.song-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
  font-size: 0.95rem;
}

.preview-cover {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.anecdote-content label {
  display: block;
  font-size: 0.75rem;
  color: rgba(0, 240, 255, 0.6);
  margin-bottom: 0.4rem;
  font-family: 'Orbitron', monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.anecdote-content textarea {
  width: 100%;
  padding: 0.7rem;
  border-radius: 4px;
  border: 1px solid rgba(185, 77, 255, 0.2);
  background: rgba(8, 1, 24, 0.9);
  color: #fff;
  font-size: 0.95rem;
  font-family: 'Rajdhani', sans-serif;
  resize: vertical;
  outline: none;
  margin-bottom: 1rem;
  box-sizing: border-box;
}

.anecdote-content textarea:focus {
  border-color: var(--neon-purple);
  box-shadow: 0 0 10px rgba(185, 77, 255, 0.3);
}

.anecdote-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.anecdote-actions .btn {
  flex: 1 1 auto;
  text-align: center;
  white-space: nowrap;
  padding: 0.5rem 0.8rem;
  font-size: 0.65rem;
  letter-spacing: 0.02em;
  font-family: 'Rajdhani', sans-serif;
}

/* --- Cards List --- */
.cards-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.cards-list::-webkit-scrollbar { width: 6px; }
.cards-list::-webkit-scrollbar-track { background: transparent; }
.cards-list::-webkit-scrollbar-thumb { background: rgba(185, 77, 255, 0.3); border-radius: 3px; }

.card-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  background: rgba(13, 2, 33, 0.6);
  border-radius: 4px;
  border: 1px solid rgba(185, 77, 255, 0.12);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card-item:hover {
  border-color: rgba(255, 45, 149, 0.3);
  box-shadow: 0 0 15px rgba(255, 45, 149, 0.08);
}

.card-number {
  color: var(--neon-purple);
  font-size: 0.8rem;
  font-weight: 700;
  font-family: 'Orbitron', monospace;
  min-width: 28px;
  text-shadow: 0 0 8px rgba(185, 77, 255, 0.4);
}

.card-anecdote {
  color: var(--neon-yellow);
  font-size: 0.8rem;
  font-style: italic;
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-added-by {
  font-size: 0.75rem;
  color: var(--neon-purple);
  opacity: 0.7;
}

.btn-remove {
  background: none;
  border: none;
  color: rgba(255, 45, 149, 0.4);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 50%;
  transition: color 0.2s, text-shadow 0.2s;
  flex-shrink: 0;
}

.btn-remove:hover {
  color: var(--neon-pink);
  text-shadow: var(--glow-pink);
}

/* --- Footer --- */
.editor-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  background: linear-gradient(transparent, var(--dark-bg) 30%);
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  pointer-events: none;
  z-index: 50;
}

.editor-footer .btn {
  pointer-events: all;
}

.editor-footer .btn-primary {
  box-shadow: 0 0 20px rgba(255, 45, 149, 0.4), 0 0 50px rgba(185, 77, 255, 0.2);
  animation: footerGlow 3s ease-in-out infinite;
}

.editor-footer .btn-ghost {
  box-shadow: none;
  animation: none;
}

.editor-footer .tooltip-wrap {
  pointer-events: all;
}

@keyframes footerGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 45, 149, 0.4), 0 0 50px rgba(185, 77, 255, 0.2); }
  50% { box-shadow: 0 0 30px rgba(0, 240, 255, 0.5), 0 0 60px rgba(185, 77, 255, 0.3); }
}

/* --- Existing Sessions (Start View) --- */
.existing-sessions {
  margin-top: 2.5rem;
  width: 100%;
  max-width: 500px;
  text-align: left;
}

.existing-sessions h3 {
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  text-align: center;
  text-shadow: var(--glow-cyan);
}

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.session-item {
  background: rgba(13, 2, 33, 0.6);
  border: 1px solid rgba(185, 77, 255, 0.15);
  border-radius: 4px;
  padding: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.session-item:hover {
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.08);
}

.session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.session-player {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--neon-pink);
  text-shadow: 0 0 8px rgba(255, 45, 149, 0.3);
}

.session-meta {
  font-size: 0.8rem;
  color: rgba(185, 77, 255, 0.6);
}

.session-songs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.session-song-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  background: rgba(0, 240, 255, 0.08);
  color: rgba(0, 240, 255, 0.7);
  border: 1px solid rgba(0, 240, 255, 0.15);
}

.session-song-tag.more {
  background: rgba(185, 77, 255, 0.08);
  color: rgba(185, 77, 255, 0.7);
  border-color: rgba(185, 77, 255, 0.15);
}

.session-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.btn-delete-session {
  color: rgba(255, 45, 149, 0.5) !important;
  border-color: rgba(255, 45, 149, 0.2) !important;
}
.btn-delete-session:hover {
  color: var(--neon-pink) !important;
  border-color: var(--neon-pink) !important;
}

/* --- Duplicate Hint in Search --- */
.search-duplicate {
  font-size: 0.75rem;
  color: var(--neon-yellow);
  margin-top: 0.15rem;
}

/* --- Tooltips --- */
.tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.btn-tooltip {
  background: none;
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: rgba(0, 240, 255, 0.5);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.btn-tooltip:hover {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.tooltip {
  display: none;
  position: absolute;
  right: 0;
  left: auto;
  top: calc(100% + 8px);
  transform: none;
  background: var(--darker-bg);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.8rem;
  color: rgba(224, 212, 247, 0.9);
  line-height: 1.4;
  width: max-content;
  max-width: min(260px, calc(100vw - 2rem));
  z-index: 300;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 240, 255, 0.1);
  pointer-events: none;
  white-space: normal;
}

.tooltip-up {
  top: auto;
  bottom: calc(100% + 8px);
}

/* Tooltip im Progress Ring: mittig öffnen */
.dash-progress .tooltip {
  right: auto;
  left: 50%;
  transform: translateX(-50%);
}
.dash-progress .tooltip::before {
  right: auto;
  left: 50%;
  transform: translateX(-50%);
}

/* Tooltips links im Layout: nach rechts öffnen */
.dash-decades .tooltip {
  right: auto;
  left: 0;
}
.dash-decades .tooltip::before {
  right: auto;
  left: 6px;
}

/* Such-Tooltip nach links öffnen */
.search-box .tooltip {
  right: 0;
  left: auto;
}
.search-box .tooltip::before {
  right: 6px;
  left: auto;
}

.tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 6px;
  left: auto;
  transform: none;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid rgba(0, 240, 255, 0.3);
}

.tooltip-up::before {
  top: auto;
  bottom: -6px;
  border-bottom: none;
  border-top: 6px solid rgba(0, 240, 255, 0.3);
}

.btn-tooltip:hover + .tooltip,
.btn-tooltip:focus + .tooltip {
  display: block;
  animation: tooltipIn 0.2s ease-out;
}

@keyframes tooltipIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Session Detail Overlay --- */
.session-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 1, 24, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.session-detail {
  background: var(--dark-bg);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 4px;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.15), 0 0 60px rgba(185, 77, 255, 0.1);
  animation: dialogIn 0.3s ease-out;
}

.session-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(185, 77, 255, 0.2);
}

.session-detail-header h2 {
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
}

.btn-close-detail {
  background: none;
  border: none;
  color: rgba(255, 45, 149, 0.5);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.3rem;
  transition: color 0.2s;
}

.btn-close-detail:hover {
  color: var(--neon-pink);
}

.session-detail-list {
  padding: 1rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* --- Deck Overlay --- */
.deck-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 1, 24, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.deck-panel {
  background: var(--dark-bg);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 4px;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.15), 0 0 60px rgba(185, 77, 255, 0.1);
  animation: dialogIn 0.3s ease-out;
}

.deck-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(185, 77, 255, 0.2);
  flex-shrink: 0;
}

.deck-panel-header h2 {
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
}

.deck-cards {
  padding: 1.2rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.deck-card {
  background: rgba(13, 2, 33, 0.8);
  border: 1px solid rgba(185, 77, 255, 0.2);
  border-radius: 4px;
  padding: 1rem 0.8rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.deck-card:hover {
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

.deck-card-number {
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  color: var(--neon-cyan);
  opacity: 0.6;
}

.deck-card-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--neon-pink);
  text-shadow: 0 0 8px rgba(255, 45, 149, 0.3);
  line-height: 1.2;
}

.deck-card-artist {
  font-size: 0.8rem;
  color: rgba(224, 212, 247, 0.7);
}

.deck-card-year {
  font-family: 'Orbitron', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
  margin: 0.2rem 0;
}

.deck-card-anecdote {
  font-size: 0.7rem;
  color: var(--neon-yellow);
  font-style: italic;
  line-height: 1.3;
}

.deck-card-added-by {
  font-size: 0.7rem;
  color: var(--neon-purple);
  opacity: 0.7;
}

/* --- Dashboard --- */

/* --- Chart Tabs (inside dashboard) --- */
.dash-chart-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(185, 77, 255, 0.15);
}

.chart-tab {
  flex: 1;
  padding: 0.35rem 0.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: rgba(224, 212, 247, 0.45);
  font-family: 'Orbitron', monospace;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.chart-tab:hover {
  color: rgba(224, 212, 247, 0.7);
}

.chart-tab.active {
  color: var(--neon-cyan);
  border-bottom-color: var(--neon-cyan);
}

/* Standalone Leaderboard (under search) */
.dash-leaderboard-standalone {
  background: rgba(13, 2, 33, 0.7);
  border: 1px solid rgba(185, 77, 255, 0.2);
  border-radius: 6px;
  padding: 1rem;
  margin-top: 1rem;
}

.dashboard {
  background: rgba(13, 2, 33, 0.7);
  border: 1px solid rgba(185, 77, 255, 0.2);
  border-radius: 6px;
  padding: 1.2rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  animation: dialogIn 0.4s ease-out;
}

.dash-progress {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
}

.dash-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.progress-ring { width: 110px; height: 110px; transform: rotate(-90deg); }
.progress-ring-bg {
  fill: none;
  stroke: rgba(185, 77, 255, 0.1);
  stroke-width: 8;
}
.progress-ring-fill {
  fill: none;
  stroke: url(#progressGrad);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 6px rgba(255, 45, 149, 0.5));
}

.progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.progress-count {
  font-family: 'Orbitron', monospace;
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
  line-height: 1;
}
.progress-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.6rem;
  color: rgba(0, 240, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.dash-decades {
  min-width: 0;
  flex: 1 1 200px;
}
.dash-section-title {
  font-family: 'Orbitron', monospace;
  font-size: 0.65rem;
  color: rgba(0, 240, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}

.dash-section-subtitle {
  text-transform: none;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.8rem;
  color: rgba(185, 77, 255, 0.6);
  letter-spacing: normal;
  display: inline;
  word-break: break-word;
}

.decade-bars { display: flex; flex-direction: column; gap: 3px; }
.decade-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 16px;
}
.decade-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.6rem;
  color: rgba(224, 212, 247, 0.6);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}
.decade-track {
  flex: 1;
  height: 10px;
  background: rgba(185, 77, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.decade-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}
.decade-fill.low { background: linear-gradient(90deg, #ff2d95, #ff2d95); }
.decade-fill.mid { background: linear-gradient(90deg, #ffe14d, #ff7315); }
.decade-fill.good { background: linear-gradient(90deg, #00f0ff, #40ff22); }

.decade-num {
  font-family: 'Orbitron', monospace;
  font-size: 0.55rem;
  color: rgba(224, 212, 247, 0.5);
  width: 30px;
  flex-shrink: 0;
}

.dash-tips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  width: 100%;
}

.dash-player {
  width: 100%;
}
.player-stat {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--neon-yellow);
  letter-spacing: 0.02em;
}
.player-stat strong {
  font-family: 'Orbitron', monospace;
  font-size: 0.9rem;
  color: #fff;
  text-shadow: 0 0 8px rgba(255, 225, 77, 0.4);
}
.dash-tip {
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  animation: tipFade 0.5s ease-out;
}
.dash-tip.warn {
  background: rgba(255, 45, 149, 0.12);
  color: var(--neon-pink);
  border: 1px solid rgba(255, 45, 149, 0.25);
}
.dash-tip.info {
  background: rgba(0, 240, 255, 0.08);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 240, 255, 0.2);
}
.dash-tip.success {
  background: rgba(64, 255, 34, 0.08);
  color: #40ff22;
  border: 1px solid rgba(64, 255, 34, 0.2);
}
@keyframes tipFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.dash-leaderboard {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(185, 77, 255, 0.12);
  padding-top: 0.8rem;
  margin-top: 0.2rem;
}
.lb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  background: rgba(185, 77, 255, 0.05);
  border: 1px solid rgba(185, 77, 255, 0.1);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.lb-row.lb-me {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.25);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.1);
}
.lb-rank {
  font-size: 0.85rem;
  min-width: 1.2rem;
  text-align: center;
}
.lb-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(224, 212, 247, 0.85);
}
.lb-me .lb-name {
  color: var(--neon-cyan);
}
.lb-count {
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  color: var(--neon-yellow);
  margin-left: auto;
}

@media (max-width: 500px) {
  /* Dashboard: einspaltig */
  .dashboard {
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.8rem;
    gap: 0.8rem;
  }
  .dash-progress {
    width: 85px;
    height: 85px;
    align-self: center;
  }
  .dash-right {
    width: 100%;
  }
  .progress-ring { width: 85px; height: 85px; }
  .progress-ring-bg,
  .progress-ring-fill { stroke-width: 6; }
  .progress-count { font-size: 1.3rem; }
  .progress-label { font-size: 0.5rem; }
  .dash-leaderboard { padding-top: 0.6rem; width: 100%; }
  .dash-section-title { font-size: 0.6rem; }
  .dash-section-subtitle { font-size: 0.72rem; display: block; margin-top: 0.2rem; }
  .lb-list {
    flex-direction: column;
    gap: 0.3rem;
  }
  .lb-row {
    width: 100%;
    justify-content: flex-start;
  }
  #editor-view {
    padding: 1rem 0.8rem;
    padding-bottom: 130px;
  }
  .editor-header h2 { font-size: 1rem; }
  /* Footer: sauber gestapelt, gleiche Breite */
  .editor-footer {
    padding: 0.6rem 1rem;
    gap: 0.5rem;
    flex-direction: column;
    align-items: stretch;
  }
  .editor-footer .btn-large {
    padding: 0.65rem 1rem;
    font-size: 0.78rem;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
  .editor-footer .btn-primary {
    animation: none;
    box-shadow: 0 0 10px rgba(255, 45, 149, 0.3);
  }
  .editor-footer .btn-ghost {
    border-width: 1px;
  }
  .editor-footer .tooltip-wrap {
    display: none;
  }
  .search-box input { font-size: 0.9rem; padding: 0.6rem 0.8rem; }
  .anecdote-content { padding: 1rem; }
  .deck-cards {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.6rem;
    padding: 0.8rem;
  }
  .tooltip-wrap-up .tooltip {
    left: auto;
    right: 0;
  }
  .tooltip-wrap-up .tooltip::before {
    left: auto;
    right: 12px;
  }
}

@media (max-width: 360px) {
  #start-view h1,
  #login-hint h1 { font-size: 1.8rem; }
  .logo { font-size: 3.5rem; }
  .subtitle { font-size: 0.85rem; padding: 0 0.5rem; }
  .dash-progress { width: 70px; height: 70px; }
  .progress-ring { width: 70px; height: 70px; }
  .progress-count { font-size: 1.1rem; }
  .decade-label { font-size: 0.5rem; width: 28px; }
  .decade-num { font-size: 0.5rem; width: 24px; }
  .editor-footer .btn-large {
    padding: 0.5rem 0.8rem;
    font-size: 0.7rem;
  }
}
