/* CSS Custom Properties for Theme */
:root {
  --bg-primary: #0a0b0d;
  --bg-secondary: #12141c;
  --card-bg: rgba(22, 25, 35, 0.65);
  --card-border: rgba(255, 255, 255, 0.07);
  --card-border-glow: rgba(255, 179, 0, 0.3);
  
  --color-primary: #ffb300; /* Bier-Gold */
  --color-primary-rgb: 255, 179, 0;
  --color-secondary: #ff7600; /* Neon Orange */
  --color-success: #00e676; /* Bright Green */
  --color-danger: #ff1744; /* Bright Red */
  --color-info: #00e5ff; /* Cyan */
  
  --text-main: #f5f6f9;
  --text-muted: #8e9aa8;
  --text-dark: #0a0b0d;
  
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Animated Bubble Background */
.bubble-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at 50% 10%, #1e1b15 0%, #0a0b0d 100%);
}

.bubble {
  position: absolute;
  bottom: -100px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 179, 0, 0.15) 0%, rgba(255, 118, 0, 0.02) 70%, rgba(255, 255, 255, 0.05) 100%);
  border-radius: 50%;
  animation: floatUp 8s infinite linear;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1), 0 0 15px rgba(255, 179, 0, 0.05);
}

@keyframes floatUp {
  0% {
    transform: translateY(0) scale(0.3) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-110vh) scale(1.1) rotate(360deg);
    opacity: 0;
  }
}

/* App Layout */
.app-container {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* fallback */
  min-height: calc(var(--vh, 1vh) * 100);
  padding: 16px 16px calc(76px + var(--safe-bottom) + 16px) 16px;
  position: relative;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 8px 4px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-emoji {
  font-size: 2.2rem;
  filter: drop-shadow(0 0 8px rgba(255, 179, 0, 0.4));
  animation: cheers 1.5s infinite alternate ease-in-out;
}

@keyframes cheers {
  0% { transform: rotate(-5deg) scale(1); }
  100% { transform: rotate(10deg) scale(1.1); }
}

.app-header h1 {
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--text-main) 30%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app-header .subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.session-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 179, 0, 0.1);
  border: 1px solid rgba(255, 179, 0, 0.2);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
  backdrop-filter: blur(10px);
}

.badge-dot {
  width: 6px;
  height: 6px;
  background-color: var(--color-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-primary);
  animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* Navigation */
.app-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  background: rgba(18, 20, 28, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-around;
  padding: 8px 12px calc(8px + var(--safe-bottom));
  z-index: 100;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 12px;
  transition: var(--transition-fast);
  flex: 1;
}

.nav-item:hover {
  color: var(--text-main);
}

.nav-item.active {
  color: var(--color-primary);
  font-weight: 700;
}

.nav-icon {
  transition: transform var(--transition-fast);
}

.nav-item.active .nav-icon {
  transform: translateY(-2px);
  filter: drop-shadow(0 0 5px rgba(255, 179, 0, 0.4));
}

.nav-label {
  font-size: 0.7rem;
  font-weight: 600;
}

/* Tabs Visibility */
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.tab-content.active {
  display: block;
}

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

/* Cards & Containers */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.card:focus-within {
  border-color: rgba(255, 179, 0, 0.2);
}

.card-title {
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
}

.card-title h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Buttons */
.btn {
  font-family: var(--font-display);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.95rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: var(--text-dark);
  box-shadow: 0 4px 15px rgba(255, 179, 0, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 179, 0, 0.5);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-success {
  background: var(--color-success);
  color: var(--text-dark);
  box-shadow: 0 4px 15px rgba(0, 230, 118, 0.2);
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 230, 118, 0.4);
}

.btn-success:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

.btn-danger {
  background: var(--color-danger);
  color: var(--text-main);
}

.btn-danger:hover {
  background: #ff3d00;
}

.btn-danger-text {
  background: none;
  color: var(--color-danger);
  border: 1px solid rgba(255, 23, 68, 0.2);
  padding: 6px 12px;
  border-radius: 8px;
}

.btn-danger-text:hover {
  background: rgba(255, 23, 68, 0.1);
}

.btn-large {
  padding: 18px 36px;
  font-size: 1.25rem;
  border-radius: 50px;
  letter-spacing: 0.05em;
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-icon-only {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
}

/* TIMER CARD & CONTROLS */
.timer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 30px 20px 20px;
}

.timer-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

.timer-display {
  font-family: monospace;
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 179, 0, 0.3), 0 0 40px rgba(255, 179, 0, 0.1);
  margin-bottom: 24px;
  user-select: none;
  font-variant-numeric: tabular-nums;
}

.timer-controls {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
  width: 100%;
  justify-content: center;
}

#btn-trigger {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-primary) 0%, var(--color-secondary) 100%);
  font-size: 1.3rem;
  box-shadow: 0 0 30px rgba(255, 179, 0, 0.4), inset 0 0 15px rgba(255, 255, 255, 0.3);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

#btn-trigger:hover {
  transform: scale(1.03);
  box-shadow: 0 0 40px rgba(255, 179, 0, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.4);
}

#btn-trigger.running {
  background: radial-gradient(circle, var(--color-danger) 0%, #d50000 100%);
  animation: pulse-danger 1.5s infinite;
  box-shadow: 0 0 30px rgba(255, 23, 68, 0.4);
  color: white;
}

@keyframes pulse-danger {
  0% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 23, 68, 0.4); }
  50% { transform: scale(1.02); box-shadow: 0 0 35px rgba(255, 23, 68, 0.7); }
  100% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 23, 68, 0.4); }
}

.speedrun-mode-toggle {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  width: 100%;
  padding-top: 16px;
  display: flex;
  justify-content: center;
}

/* Switch Styling */
.switch-container {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.switch-container input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 34px;
  margin-right: 12px;
  transition: var(--transition-fast);
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: var(--transition-fast);
}

input:checked + .slider {
  background-color: var(--color-primary);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--color-primary);
}

input:checked + .slider:before {
  transform: translateX(22px);
  background-color: var(--bg-primary);
}

.switch-label {
  font-size: 0.8rem;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
}

.switch-label .tooltip {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Tap Overlay (Fullscreen timing zone) */
.tap-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh; /* fallback */
  height: calc(var(--vh, 1vh) * 100);
  background-color: rgba(10, 11, 13, 0.95);
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: opacity var(--transition-normal);
}

.tap-overlay-text {
  text-align: center;
  color: white;
}

.tap-overlay-text span {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  display: block;
  margin-bottom: 20px;
  animation: pulse 1s infinite alternate;
}

.tap-timer {
  font-family: monospace;
  font-size: 5rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 30px var(--color-primary-rgb);
}

/* FORM ELEMENTS */
.form-card {
  padding: 24px;
}

.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

input[type="text"],
input[type="number"],
select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 16px; /* Prevents auto-zoom on mobile safari/chrome */
  outline: none;
  transition: var(--transition-fast);
  width: 100%;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: var(--color-primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 10px rgba(255, 179, 0, 0.15);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media(min-width: 480px) {
  .form-grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.btn-preset {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  padding: 10px 0;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-preset:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-preset.active {
  background: rgba(255, 179, 0, 0.15);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 700;
}

.custom-volume-input {
  margin-top: 8px;
  animation: slideDown 0.2s ease forwards;
}

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

.flex-grow {
  flex-grow: 1;
}

.form-inline {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

/* LEADERBOARD VIEW */
.leaderboard-filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(16px);
}

.filter-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.segmented-control {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: 10px;
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.segment {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.segment.active {
  background: var(--color-primary);
  color: var(--text-dark);
}

/* Podium Container */
.podium-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 180px;
  margin: 24px 0 16px;
  padding: 0 10px;
}

.podium-spot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 120px;
}

.podium-avatar-wrapper {
  position: relative;
  margin-bottom: 8px;
}

.podium-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #232736;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: var(--transition-slow);
}

.podium-rank-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background-color: var(--text-muted);
  color: var(--text-dark);
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.podium-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.podium-value {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.podium-bar {
  width: 100%;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: none;
  transition: height var(--transition-slow) ease-out;
}

/* Podium specific modifications */
.spot-first .podium-avatar {
  width: 60px;
  height: 60px;
  font-size: 1.3rem;
  border-color: var(--color-primary);
  box-shadow: 0 0 15px rgba(255, 179, 0, 0.4);
}
.spot-first .podium-rank-badge {
  background-color: var(--color-primary);
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
  bottom: -2px;
  right: -2px;
}
.spot-first .podium-value {
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 179, 0, 0.5);
}
.spot-first .podium-bar {
  height: 90px;
  background: linear-gradient(180deg, rgba(255, 179, 0, 0.25) 0%, rgba(255, 179, 0, 0.02) 100%);
  border-color: rgba(255, 179, 0, 0.2);
}

.spot-second .podium-avatar {
  border-color: #b0bec5;
}
.spot-second .podium-rank-badge {
  background-color: #b0bec5;
}
.spot-second .podium-bar {
  height: 60px;
  background: linear-gradient(180deg, rgba(176, 190, 197, 0.15) 0%, rgba(176, 190, 197, 0.02) 100%);
  border-color: rgba(176, 190, 197, 0.15);
}

.spot-third .podium-avatar {
  border-color: #bcaaa4;
}
.spot-third .podium-rank-badge {
  background-color: #bcaaa4;
}
.spot-third .podium-bar {
  height: 40px;
  background: linear-gradient(180deg, rgba(188, 170, 164, 0.15) 0%, rgba(188, 170, 164, 0.02) 100%);
  border-color: rgba(188, 170, 164, 0.12);
}

/* Rankings list */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: var(--transition-fast);
}

.leaderboard-item:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(2px);
}

.rank-number {
  width: 24px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: white;
  margin-right: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.player-name-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.player-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
}

.player-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.rank-value {
  font-family: monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

.no-data {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* PLAYERS TAB */
.players-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 12px;
  padding: 0 4px;
}

.players-header h3 {
  font-size: 1rem;
  color: var(--text-muted);
}

.badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.player-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  text-align: center;
  transition: all var(--transition-fast);
}

.player-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.player-card .player-avatar {
  width: 54px;
  height: 54px;
  margin-right: 0;
  margin-bottom: 10px;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.player-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-card-stat {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.player-card-volume {
  color: var(--color-primary);
  font-weight: 700;
}

.btn-delete-player {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.btn-delete-player:hover {
  color: var(--color-danger);
  background: rgba(255, 23, 68, 0.1);
}

/* STATS SUMMARY GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* HISTORY TAB */
.card-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
}

.card-header-actions h3 {
  font-size: 1.1rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.history-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  position: relative;
  gap: 10px;
}

.history-item-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: white;
  flex-shrink: 0;
}

.history-item-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0; /* allows text truncation */
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}

.history-item-name {
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-time {
  font-family: monospace;
  font-weight: 700;
  color: var(--color-primary);
  font-size: 0.85rem;
}

.history-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.history-item-comment {
  font-style: italic;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  padding-left: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-delete-run {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.btn-delete-run:hover {
  color: var(--color-danger);
  background: rgba(255, 23, 68, 0.1);
}

/* SETTINGS CARD */
.settings-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.4;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.settings-actions .btn {
  flex: 1;
  min-width: 140px;
}

.danger-zone {
  border-top: 1px dashed rgba(255, 23, 68, 0.2);
  padding-top: 16px;
  margin-top: 16px;
}

.danger-zone h4 {
  font-size: 0.9rem;
  color: var(--color-danger);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* UTILITY CLASSES */
.hidden {
  display: none !important;
}

/* Toast Notification (if added in JS) */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(18, 20, 28, 0.9);
  border: 1px solid var(--color-primary);
  border-radius: 12px;
  padding: 12px 24px;
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  pointer-events: none;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(8px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
