/* ==========================================
   Modern Dark UI System - Glassmorphism
   ========================================== */

/* CSS Variables */
:root {
  --bg-dark: #0b1020;
  --bg-gradient: radial-gradient(circle at 20% 30%, rgba(41, 81, 180, 0.18), transparent 60%),
                 radial-gradient(circle at 80% 70%, rgba(99, 48, 180, 0.12), transparent 55%);
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-hover: rgba(255, 255, 255, 0.10);
  --text-primary: #f6f7fb;
  --text-secondary: rgba(246, 247, 251, 0.75);
  --accent-primary: rgba(99, 102, 241, 0.90);
  --accent-hover: rgba(99, 102, 241, 1);
  --success: #4ade80;
  --error: #ff7a7a;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 20px;
  --shadow-lg: 0 24px 90px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg-dark);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* Typography */
h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.container-sm {
  max-width: 680px;
}

.container-lg {
  max-width: 1400px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stack-sm {
  gap: 0.5rem;
}

.stack-lg {
  gap: 1.5rem;
}

.row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Centered Layout */
.centered {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

/* Glass Panels & Cards */
.panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.panel-sm {
  padding: 1rem;
  border-radius: var(--radius-sm);
}

.panel-lg {
  padding: 2rem;
  border-radius: var(--radius-lg);
}

.card {
  width: 100%;
  max-width: 520px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.topbar-title {
  font-size: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.chip {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-hover);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  border-color: var(--glass-border);
}

.btn-ghost:hover {
  background: var(--glass-bg);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--error);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.6);
}

.btn-block {
  width: 100%;
  display: flex;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

/* Form Elements */
.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.input,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="url"],
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
  font-size: 0.9375rem;
  outline: none;
  transition: all 0.2s ease;
}

.input:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-primary);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input::placeholder,
input::placeholder,
textarea::placeholder {
  color: rgba(246, 247, 251, 0.4);
}

.select,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
  font-size: 0.9375rem;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.select:hover,
select:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* Alerts */
.alert {
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  border: 1px solid;
  font-size: 0.9375rem;
  line-height: 1.5;
}

.alert-success {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.3);
  color: var(--success);
}

.alert-error {
  background: rgba(255, 122, 122, 0.12);
  border-color: rgba(255, 122, 122, 0.3);
  color: var(--error);
}

.alert-info {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  color: rgba(147, 197, 253, 1);
}

.alert-warning {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.table thead {
  background: rgba(0, 0, 0, 0.3);
}

.table th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--glass-border);
}

.table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.table tbody tr {
  transition: background 0.15s ease;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Table Actions */
.table-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Dashboard Tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.tile {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tile:hover {
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tile-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tile-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Hints & Helper Text */
.hint {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.text-muted {
  color: var(--text-secondary);
}

.text-small {
  font-size: 0.875rem;
}

.text-center {
  text-align: center;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--glass-border);
  margin: 1.5rem 0;
}

/* Responsive Adjustments */
@media (max-width: 767px) {
  .container {
    padding: 1rem;
  }

  .panel, .card {
    padding: 1.25rem;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .table {
    font-size: 0.875rem;
  }

  .table th,
  .table td {
    padding: 0.625rem 0.75rem;
  }

  .tiles {
    grid-template-columns: 1fr;
  }
}

/* Print Styles */
/* ==========================================
   Playercard KPI Components
   ========================================== */

/* Profile Card */
.pc-profile-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.pc-avatar {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid var(--glass-border);
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.pc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pc-info {
  flex: 1;
  min-width: 250px;
  order: 1;
}

.pc-name {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.pc-username {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(99, 102, 241, 0.95);
  background: rgba(99, 102, 241, 0.12);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.pc-overall-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  order: 2;
}

@media (max-width: 767px) {
  .pc-avatar {
    order: 1;
    width: 160px;
    height: 160px;
    margin: 0 auto;
  }

  .pc-info {
    order: 2;
    text-align: center;
  }

  .pc-overall-badge {
    order: 3;
    margin: 0 auto;
  }
}

.pc-overall-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.pc-overall-value {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text-primary);
}

/* KPI Grid */
.pc-kpi-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .pc-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .pc-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* KPI Card */
.kpi-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transition: all 0.3s ease;
}

.kpi-card:hover {
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.20);
  transform: translateY(-2px);
}

/* Dot Ring Container */
.dot-ring {
  position: relative;
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
}

.kpi-value {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text-primary);
  z-index: 2;
  position: relative;
}

.dots {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
  left: 50%;
  top: 50%;
  margin-left: -4px;
  margin-top: -4px;
}

.dot.active {
  background: rgba(99, 102, 241, 0.95);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.3;
}

/* Debug Box */
.pc-debug-box {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 82, 82, 0.3);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.pc-debug-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 82, 82, 0.9);
  margin-bottom: 0.75rem;
}

.pc-debug-content {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

@media print {
  body {
    background: white;
    color: black;
  }

  .panel, .card {
    border: 1px solid #ccc;
    box-shadow: none;
  }

  .btn, .topbar-actions {
    display: none;
  }
}

/* ==========================================
   Playercard 2-Spalten Layout
   ========================================== */

/* Main Grid: Links (Analyse) + Rechts (Foto) */
.pc-main-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
  margin-bottom: 2rem;
}

@media (min-width: 1024px) {
  .pc-main-grid {
    grid-template-columns: 2fr 1fr;
    align-items: start;
  }
}

/* Linke Spalte */
.pc-left {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Rechte Spalte */
.pc-right {
  display: flex;
  flex-direction: column;
}

/* Overall Card (groß, oben links) */
.pc-overall-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.pc-overall-card .pc-overall-label {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.pc-overall-card .pc-overall-value {
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text-primary);
  text-shadow: 0 0 40px rgba(99, 102, 241, 0.3);
}

.pc-player-meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.pc-player-meta .pc-name {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.pc-player-meta .pc-username {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(99, 102, 241, 0.95);
  background: rgba(99, 102, 241, 0.12);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

/* Foto Card (groß, rechts) */
.pc-photo-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 1024px) {
  .pc-photo-card {
    position: sticky;
    top: 1.5rem;
  }
}

.pc-photo-box {
  width: 100%;
  height: 100%;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
}

.pc-photo {
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: cover;
  object-position: center;
}

.pc-photo-placeholder {
  font-size: 5rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.15);
  text-transform: uppercase;
}

/* Responsive Anpassungen */
@media (max-width: 1023px) {
  .pc-main-grid {
    grid-template-columns: 1fr;
  }

  .pc-photo-card {
    min-height: 400px;
  }

  .pc-photo-box {
    min-height: 400px;
  }

  .pc-photo {
    min-height: 400px;
  }

  .pc-overall-card .pc-overall-value {
    font-size: 4rem;
  }
}

@media (max-width: 640px) {
  .pc-photo-card {
    min-height: 320px;
  }

  .pc-photo-box {
    min-height: 320px;
  }

  .pc-photo {
    min-height: 320px;
  }

  .pc-overall-card {
    padding: 1.5rem;
  }

  .pc-overall-card .pc-overall-value {
    font-size: 3.5rem;
  }

  .pc-photo-placeholder {
    font-size: 3.5rem;
  }
}


