:root {
  --primary-blue: #3b82f6;
  --primary-dark: #1e40af;
  --primary-light: #60a5fa;
  --secondary-purple: #8b5cf6;
  --secondary-pink: #ec4899;
  --accent-yellow: #fcd34d;
  --accent-green: #34d399;
  --accent-red: #f87171;
  --bg-dark: #0f172a;
  --bg-medium: #1e293b;
  --bg-light: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
}

[x-cloak] {
  display: none !important;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Main Content */
.main-container {
  margin-top: 80px;
  /* just larger than nav */
  padding: 2rem;
  position: relative;
  z-index: 10;
  /* min-height: calc(100vh - 80px); */
  flex: 1;
}

.logo {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(
    135deg,
    var(--primary-light) 0%,
    var(--secondary-purple) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-medium) 100%);
  color: var(--text-primary);
  min-height: calc(100vh - 80px);
  /* remove navbar height plus some */
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Animated Background */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(
      circle at 20% 80%,
      rgba(59, 130, 246, 0.3) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(139, 92, 246, 0.3) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 40%,
      rgba(236, 72, 153, 0.2) 0%,
      transparent 50%
    );
  animation: backgroundShift 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes backgroundShift {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }

  33% {
    transform: translate(-20px, -20px) rotate(120deg);
  }

  66% {
    transform: translate(20px, -10px) rotate(240deg);
  }
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  height: 75px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  animation: slideDown 0.5s ease-out;
  transition: opacity 0.3s ease;
}

/* BAUK */
.grid-container {
  display: grid;
  gap: 1.5rem;
  animation: fadeIn 0.8s ease-out;
}

.grid-container h3 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
  background: linear-gradient(
    135deg,
    var(--text-primary) 0%,
    var(--primary-light) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.grid-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  align-items: center;
}

.grid-buttons-large {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.centered-form {
  max-width: 400px;
  margin: 2rem auto;
  padding: 2rem;
  background-color: white;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.overlay-form {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  padding: 1.5rem 3rem;
  border-radius: 50px;
  background-color: var(--bg-medium);
  z-index: 2000;
  animation: fadeInCenter 1s ease-in-out forwards;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;

  width: 90%;
  max-width: 500px;
}

.overlay-form form {
  margin-bottom: 1rem;
}

.overlay-form h3 {
  font-size: 1.5rem;
  font-weight: 700;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInCenter {
  from {
    opacity: 0;
    transform: translate(-50%, 50%);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.full-width {
  width: 100%;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  padding: 2rem;
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s ease-out;
  transition: all 0.3s ease;
}

.glass-section {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  padding: 2rem;
  margin-bottom: 2rem;
}

.fade-in-when-visible {
  opacity: 0.1;
  transform: translateY(30px);
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}

.fade-in-when-visible.visible {
  opacity: 1;
  transform: translateY(0);
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 40px rgba(59, 130, 246, 0.2);
  border-color: var(--primary-blue);
}

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  background: linear-gradient(
    135deg,
    var(--text-primary) 0%,
    var(--primary-light) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  align-self: center;
  text-align: center;
}

.title {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(
    135deg,
    var(--text-primary) 0%,
    var(--primary-light) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  align-self: center;
  text-align: center;
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.footer {
  /* background: #f8f9fa; Light gray, change if you have a dark theme */
  background: var(--bg-dark);
  /* color: #555; */
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  position: relative;
  bottom: 0;
  width: 100%;
}

a {
  color: var(--accent-color, #007bff);
  text-decoration: none;
  cursor: pointer;
}

.footer a:hover {
  text-decoration: underline;
}

/* === LOADER === */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.15);
  /* subtle dim — adjust alpha for strength */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: 9999;
  backdrop-filter: blur(2px);
  /* optional soft blur */
}

.loader-overlay.visible {
  opacity: 1;
}

.loader-hybrid {
  position: relative;
  width: 50vw;
  height: 50vh;
}

.loader-hybrid .ball {
  position: absolute;
  width: 3vw;
  height: 3vw;
  border-radius: 50%;
  opacity: 0;
  animation: fall 1.5s ease-in infinite;
}

@keyframes fall {
  0% {
    transform: translateY(-40px) scale(1);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    transform: translateY(50vh) scale(0.7);
    opacity: 0;
  }
}

.sub-loader {
  --s: 40px;
  --g: 5px;

  height: calc(2 * (var(--s) + var(--g)));
  aspect-ratio: 1;
  background:
    radial-gradient(
      calc(var(--s) / sqrt(2)) at calc(50% - 0.1 * var(--s))
        calc(50% - 0.2 * var(--s)),
      #0000 5%,
      60%,
      #111 98%
    ),
    linear-gradient(#fe4365 0 0) no-repeat #3954b2;
  background-size: 50% 50%;
  mask: radial-gradient(calc(var(--s) / 2), #000 calc(100% - 1px), #0000) 0
    0/50% 50%;
  animation: subloader steps(3) 1.5s infinite;
}

@keyframes subloader {
  0%,
  12.5% {
    background-position: 0 0;
  }

  12.6%,
  37.5% {
    background-position:
      0 0,
      100% 0;
  }

  37.6%,
  62.5% {
    background-position:
      0 0,
      100% 100%;
  }

  62.6%,
  87.5% {
    background-position:
      0 0,
      0 100%;
  }

  87.6%,
  100% {
    background-position: 0 0;
  }
}

/* Competition view styles */
.competition-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  margin-top: 2rem;
}

@media (max-width: 800px) {
  .competition-content {
    grid-template-columns: 1fr;
  }
}

.main-area {
  display: flex;
  flex-direction: column;
}

.points-control {
  padding: 1.5rem;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.points-control h3 {
  margin-bottom: 1rem;
}

.points-view {
  width: 100%;
}

.points-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  position: relative;
  margin-bottom: 1rem;
}

.clickable {
  transition: filter 0.5s ease;
}

.clickable:hover {
  filter: brightness(85%);
}

/* Buttone */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-inline {
  padding: 0.2rem 0.2rem;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.6;
  /* visually dim the button */
  cursor: not-allowed;
  /* show disabled cursor */
  pointer-events: none;
  /* completely block clicks */
  transition: opacity 0.2s;
}

.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition:
    width 0.6s,
    height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-blue) 0%,
    var(--primary-dark) 100%
  );
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: var(--glass-border);
  transform: translateY(-2px);
}

.btn-accent {
  background: linear-gradient(
    135deg,
    var(--secondary-purple) 0%,
    var(--secondary-pink) 100%
  );
  color: white;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-green) 0%, #10b981 100%);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-red) 0%, #dc2626 100%);
  color: white;
}

.btn-close {
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-back:hover {
  transform: translateX(-5px);
}

/* Visualization Controls */

#buckets-container {
  width: 100%;
  max-height: 100%;
  aspect-ratio: 1/1;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-medium) 100%);
  box-shadow: inset 0 0 50px rgba(59, 130, 246, 0.2);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 50;
}

#buckets-container::before {
  content: "Interactive 3D Visualization";
  position: absolute;
  top: 1rem;
  left: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 10;
  pointer-events: none;
}

/* Pointers */
.quick-points-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.quick-points-buttons button {
  padding: 3vh 1vw;
  font-size: 2rem;
  font-weight: 700;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.quick-points-buttons button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition:
    width 0.6s,
    height 0.6s;
}

.quick-points-buttons button:hover::before {
  width: 300px;
  height: 300px;
}

.quick-points-buttons button:nth-child(1),
.quick-points-buttons button:nth-child(2) {
  background: linear-gradient(135deg, var(--accent-red) 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(248, 113, 113, 0.3);
}

.quick-points-buttons button:nth-child(3),
.quick-points-buttons button:nth-child(4) {
  background: linear-gradient(135deg, var(--accent-green) 0%, #10b981 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(52, 211, 153, 0.3);
}

.quick-points-buttons button:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.quick-points-buttons button:active {
  transform: translateY(-2px) scale(0.98);
}

.custom-points {
  gap: 1rem;
}

.custom-points input {
  flex: 1;
  padding: 1rem 1.5rem;
  background: var(--bg-light);
  border: 2px solid transparent;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.custom-points input:focus {
  outline: none;
  border-color: var(--primary-light);
  background: var(--bg-medium);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.custom-points button {
  padding: 1rem 2rem;
  background: linear-gradient(
    135deg,
    var(--primary-blue) 0%,
    var(--primary-dark) 100%
  );
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.custom-points button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Points animation feedback */
@keyframes pointsAdded {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
    background: linear-gradient(135deg, var(--accent-green) 0%, #10b981 100%);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes pointsRemoved {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
    background: linear-gradient(135deg, var(--accent-red) 0%, #dc2626 100%);
  }

  100% {
    transform: scale(1);
  }
}

.points-feedback {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 1.5rem 3rem;
  border-radius: 50px;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  z-index: 2000;
  animation: fadeInOut 1.5s ease-out forwards;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }

  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -120%) scale(1);
  }
}

/* Hidden class */
.hidden {
  display: none !important;
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--glass-border);
  border-radius: 50%;
  border-top-color: var(--primary-light);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-input-readonly {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-dark);
  border: 2px solid transparent;
  border-radius: 12px;
  color: var(--text-primary);
  opacity: 0.4;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-light);
  border: 2px solid transparent;
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-light);
  background: var(--bg-medium);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* Participant Grid */

.participant-button {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  border: 2px solid;
  border-radius: 16px;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  align-items: center;
  text-align: center;
  text-align-last: center;
}

.participant-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.participant-button:hover::before {
  left: 100%;
}

.participant-button:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.participant-button .name {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.participant-button .points {
  font-size: 2rem;
  font-weight: 700;
  opacity: 0.9;
}

/* Selected participant highlight */
#selected-participant {
  color: var(--primary-light);
  font-weight: 700;
}

/* Participants Grid */
.list-container {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}

.list-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.participant-card {
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  border-radius: 16px;
  padding: 0.5rem 1rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  align-items: center;
}

.participant-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.participant-card::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(
    45deg,
    var(--primary-blue),
    var(--secondary-purple),
    var(--secondary-pink)
  );
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.participant-color-badge {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.participant-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
  flex: 1;
  text-align: left;
  min-width: 0;
}

.participant-points {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(
    135deg,
    var(--primary-light) 0%,
    var(--secondary-purple) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.participant-points-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Points Control Panel */
.points-panel {
  background: linear-gradient(
    135deg,
    var(--bg-medium) 0%,
    var(--bg-light) 100%
  );
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid var(--glass-border);
}

.points-btn {
  padding: 1rem 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.points-btn.negative {
  background: linear-gradient(135deg, var(--accent-red) 0%, #dc2626 100%);
  color: white;
}

.points-btn.positive {
  background: linear-gradient(135deg, var(--accent-green) 0%, #10b981 100%);
  color: white;
}

.points-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.points-btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* BAUK */

.tooltip-container {
  position: relative;
  cursor: pointer;
}

/* On small screens, reduce padding so there's more space */
@media (max-width: 600px) {
  .glass-card {
    padding: 1rem;
  }

  .main-container {
    padding: 1rem;
  }

  .btn {
    padding: 0.6rem 1.2rem;
  }

  nav {
    padding: 0rem 1rem;
  }

  .grid-buttons {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
  }

  .participant-color-badge {
    width: 40px;
    height: 40px;
    margin: 0 auto 0rem;
    font-weight: 700;
  }
}

/* On very small screens, reduce padding so there's more space */
@media (max-width: 500px) {
  .main-container {
    padding: 0.5rem;
  }

  .btn {
    padding: 0.5rem 1rem;
  }

  nav {
    padding: 0rem 0.5rem;
  }
}
