:root {
  
  --background: 240 21% 15%;
  --foreground: 0 0% 98%;
  --card: 240 18% 18%;
  --card-foreground: 0 0% 98%;
  --popover: 240 18% 18%;
  --popover-foreground: 0 0% 98%;
  --primary: 280 100% 70%;
  --primary-foreground: 0 0% 98%;
  --secondary: 195 100% 50%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 12% 25%;
  --muted-foreground: 240 5% 65%;
  --accent: 45 100% 60%;
  --accent-foreground: 240 21% 15%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 98%;
  --success: 142 76% 36%;
  --success-foreground: 0 0% 98%;
  --border: 240 12% 25%;
  --input: 240 12% 25%;
  --ring: 280 100% 70%;

  
  --option-a: 0 100% 65%;
  --option-b: 45 100% 60%;
  --option-c: 195 100% 50%;
  --option-d: 280 100% 70%;

  
  --gradient-primary: linear-gradient(135deg, hsl(280 100% 70%), hsl(195 100% 50%));
  --gradient-success: linear-gradient(135deg, hsl(142 76% 36%), hsl(120 100% 25%));
  --gradient-danger: linear-gradient(135deg, hsl(0 84% 60%), hsl(15 100% 55%));

  
  --radius: 1rem;
  --container-padding: 1rem;
  --max-width: 1200px;

  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
  overflow-x: hidden;
}

@keyframes bounce-in {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes slide-up {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

@keyframes fade-in {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-bounce-in {
  animation: bounce-in 0.6s var(--transition-bounce);
}

.animate-slide-up {
  animation: slide-up 0.3s var(--transition-smooth);
}

.animate-fade-in {
  animation: fade-in 0.5s var(--transition-smooth);
}

.animate-pulse-ring {
  animation: pulse-ring 1s var(--transition-smooth) infinite;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: var(--container-padding);
}

.screen.active {
  display: block;
}

.loading-screen {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: hsl(var(--background));
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.loading-screen.active {
  display: flex;
}

.loading-content {
  text-align: center;
}

.pulse-ring {
  width: 4rem;
  height: 4rem;
  background: hsl(var(--primary));
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: pulse-ring 1s var(--transition-smooth) infinite;
}

.loading-text {
  font-size: 1.25rem;
  color: hsl(var(--muted-foreground));
}

.results-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--container-padding);
  min-height: 100vh;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  gap: 2rem;
}

.results-title-section h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.results-meta {
  display: flex;
  gap: 1rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
}

.results-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-controls label {
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground));
}

.filter-select {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  color: hsl(var(--foreground));
  font-size: 0.9rem;
}

.results-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition-smooth);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px hsl(var(--primary) / 0.3);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: hsl(var(--primary));
  margin-bottom: 0.5rem;
}

.stat-label {
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
}

.no-results {
  text-align: center;
  padding: 4rem 2rem;
}

.no-results-content {
  max-width: 400px;
  margin: 0 auto;
}

.no-results-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.no-results h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: hsl(var(--foreground));
}

.no-results p {
  color: hsl(var(--muted-foreground));
}

.results-table-container {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
}

.table-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

.export-actions {
  display: flex;
  gap: 0.5rem;
}

.results-table {
  overflow-x: auto;
}

.results-table table {
  width: 100%;
  border-collapse: collapse;
}

.results-table th,
.results-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid hsl(var(--border));
}

.results-table th {
  background: hsl(var(--muted));
  font-weight: 600;
  color: hsl(var(--foreground));
  font-size: 0.9rem;
}

.results-table tr:hover {
  background: hsl(var(--muted) / 0.5);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.9rem;
}

.rank-1 {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
}

.rank-2 {
  background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
  color: #000;
}

.rank-3 {
  background: linear-gradient(135deg, #CD7F32, #8B4513);
  color: #fff;
}

.player-name {
  font-weight: 500;
}

.score-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.score-excellent {
  background: hsl(var(--success) / 0.2);
  color: hsl(var(--success));
}

.score-good {
  background: hsl(var(--secondary) / 0.2);
  color: hsl(var(--secondary));
}

.score-fair {
  background: hsl(var(--accent) / 0.2);
  color: hsl(var(--accent));
}

.score-poor {
  background: hsl(var(--destructive) / 0.2);
  color: hsl(var(--destructive));
}

.completed-at {
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  z-index: 1001;
  transform: scale(0.9);
  transition: var(--transition-smooth);
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.25rem;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.modal-body {
  padding: 1.5rem;
}

.player-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-stat {
  text-align: center;
  padding: 1rem;
  background: hsl(var(--muted) / 0.5);
  border-radius: 0.5rem;
}

.answer-breakdown h4 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: hsl(var(--foreground));
}

.answers-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.answer-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid hsl(var(--border));
}

.answer-item.correct {
  background: hsl(var(--success) / 0.1);
  border-color: hsl(var(--success) / 0.3);
}

.answer-item.incorrect {
  background: hsl(var(--destructive) / 0.1);
  border-color: hsl(var(--destructive) / 0.3);
}

.question-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.answer-details {
  flex: 1;
}

.selected-answer {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.answer-status {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

.back-link {
  margin-top: 2rem;
  text-align: center;
}

.back-link a {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.back-link a:hover {
  color: hsl(var(--primary));
}

@media (max-width: 768px) {
  .results-header {
    flex-direction: column;
    gap: 1rem;
  }

  .results-actions {
    width: 100%;
    justify-content: stretch;
  }

  .filter-controls {
    flex: 1;
  }

  .filter-select {
    flex: 1;
  }

  .results-table {
    font-size: 0.8rem;
  }

  .results-table th,
  .results-table td {
    padding: 0.5rem;
  }

  .modal-content {
    width: 95%;
    margin: 1rem;
  }

  .player-summary {
    grid-template-columns: 1fr;
  }
}

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
  min-width: 300px;
  max-width: 400px;
  animation: slide-in-right 0.3s var(--transition-smooth);
}

.toast.success {
  border-color: hsl(var(--success));
}

.toast.error {
  border-color: hsl(var(--destructive));
}

.toast-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.toast-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

@keyframes slide-in-right {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.card {
  background: hsl(var(--card) / 0.8);
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 30px 80px -10px rgba(0, 0, 0, 0.4);
}

.card-header {
  padding: 1.5rem 1.5rem 0;
  text-align: center;
}

.card-content {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.card-description {
  color: hsl(var(--muted-foreground));
  margin-bottom: 1.5rem;
}

.card-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 2rem;
  font-weight: bold;
  transition: var(--transition-smooth);
}

.create-icon {
  background: var(--gradient-primary);
  color: white;
}

.join-icon {
  background: linear-gradient(135deg, hsl(var(--secondary)), hsl(var(--accent)));
  color: white;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 0.875rem;
  line-height: 1;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:not(:disabled):hover {
  transform: scale(1.05);
}

.btn:not(:disabled):active {
  transform: scale(0.95);
}

.btn-primary {
  background: var(--gradient-primary);
  color: hsl(var(--primary-foreground));
  box-shadow: 0 10px 30px -10px hsl(var(--primary) / 0.3);
}

.btn-secondary {
  background: linear-gradient(135deg, hsl(var(--secondary)), hsl(var(--accent)));
  color: hsl(var(--secondary-foreground));
  box-shadow: 0 10px 30px -10px hsl(var(--secondary) / 0.3);
}

.btn-success {
  background: var(--gradient-success);
  color: hsl(var(--success-foreground));
  box-shadow: 0 10px 30px -10px hsl(var(--success) / 0.3);
}

.btn-outline {
  background: transparent;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}

.btn-outline:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-quiz {
  background: var(--gradient-primary);
  color: hsl(var(--primary-foreground));
  font-weight: 700;
  font-size: 1.125rem;
  box-shadow: 0 15px 40px -10px hsl(var(--primary) / 0.4);
}

.btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
}

.btn {
  padding: 0.625rem 1rem;
}

.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1rem;
}

.btn-xl {
  padding: 1rem 3rem;
  font-size: 1.25rem;
}

.btn-option-a {
  background: hsl(var(--option-a));
  color: white;
  box-shadow: 0 10px 30px -10px hsl(var(--option-a) / 0.3);
}

.btn-option-b {
  background: hsl(var(--option-b));
  color: white;
  box-shadow: 0 10px 30px -10px hsl(var(--option-b) / 0.3);
}

.btn-option-c {
  background: hsl(var(--option-c));
  color: white;
  box-shadow: 0 10px 30px -10px hsl(var(--option-c) / 0.3);
}

.btn-option-d {
  background: hsl(var(--option-d));
  color: white;
  box-shadow: 0 10px 30px -10px hsl(var(--option-d) / 0.3);
}

.btn-icon {
  font-size: 1.25em;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: hsl(var(--foreground));
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--input));
  color: hsl(var(--foreground));
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition-smooth);
}

.form-input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.form-input::placeholder {
  color: hsl(var(--muted-foreground));
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: hsl(var(--primary));
}

.checkbox-label {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
}

.form-hint {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.25rem;
  font-style: italic;
}

.home-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 0;
  animation: slide-up 0.3s var(--transition-smooth);
}

.hero-section {
  text-align: center;
  margin-bottom: 4rem;
}

.hero-title-container {
  position: relative;
  display: inline-block;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 4rem;
  font-weight: 800;
  background: var(--gradient-primary);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  line-height: 1.1;
}

.sparkle-icon {
  position: absolute;
  top: -0.5rem;
  right: -1rem;
  font-size: 2rem;
  animation: pulse-ring 1s var(--transition-smooth) infinite;
}

.hero-description {
  font-size: 1.25rem;
  color: hsl(var(--muted-foreground));
  max-width: 48rem;
  margin: 0 auto;
}

.action-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.action-card {
  cursor: pointer;
  transition: var(--transition-smooth);
}

.action-card:hover {
  transform: scale(1.02);
}

.action-card:hover .card-icon {
  animation: pulse-ring 1s var(--transition-smooth) infinite;
}

.join-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.features-section {
  background: hsl(var(--card) / 0.5);
  border-radius: calc(var(--radius) * 1.5);
  padding: 2rem;
  backdrop-filter: blur(10px);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  text-align: center;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.feature-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.feature-icon-a {
  background: hsl(var(--option-a) / 0.2);
  color: hsl(var(--option-a));
}

.feature-icon-b {
  background: hsl(var(--option-b) / 0.2);
  color: hsl(var(--option-b));
}

.feature-icon-c {
  background: hsl(var(--option-c) / 0.2);
  color: hsl(var(--option-c));
}

.feature-title {
  font-weight: 600;
  margin: 0;
}

.feature-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin: 0;
}

.creator-container {
  max-width: 64rem;
  margin: 0 auto;
  animation: slide-up 0.3s var(--transition-smooth);
}

.creator-header {
  text-align: center;
  margin-bottom: 2rem;
}

.creator-title {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  margin-bottom: 1rem;
}

.creator-description {
  font-size: 1.25rem;
  color: hsl(var(--muted-foreground));
}

.creator-card {
  background: hsl(var(--card) / 0.5);
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 1.5);
  margin-bottom: 2rem;
  box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.creator-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  padding: 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
}

.creator-card .card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.format-guide {
  background: hsl(var(--muted) / 0.5);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.format-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.format-example {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  white-space: pre-wrap;
  margin: 0;
}

.quiz-textarea {
  width: 100%;
  min-height: 18rem;
  padding: 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--input));
  color: hsl(var(--foreground));
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  resize: vertical;
  transition: var(--transition-smooth);
}

.quiz-textarea:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.creator-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.created-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
}

.created-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  text-align: center;
  animation: bounce-in 0.6s var(--transition-bounce);
}

.created-header {
  margin-bottom: 2rem;
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: pulse-ring 1s var(--transition-smooth) infinite;
}

.created-title {
  font-size: 2rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.created-subtitle {
  color: hsl(var(--muted-foreground));
  font-size: 1.1rem;
}

.quiz-code-section {
  background: hsl(var(--muted) / 0.2);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.quiz-code-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 1rem;
}

.quiz-code-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: hsl(var(--background));
  border: 2px solid hsl(var(--primary));
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

#quiz-code-text {
  font-family: 'Courier New', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--primary));
  letter-spacing: 0.1em;
}

.quiz-code-description {
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
}

.created-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.player-setup {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.setup-card {
  max-width: 28rem;
  width: 100%;
  background: hsl(var(--card) / 0.8);
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  animation: bounce-in 0.6s var(--transition-bounce);
}

.setup-header {
  text-align: center;
  padding: 1.5rem 1.5rem 0;
}

.setup-title {
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient-primary);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

.setup-description {
  color: hsl(var(--muted-foreground));
}

.setup-content {
  padding: 1.5rem;
}

.setup-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.setup-stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-icon {
  font-size: 1rem;
}

.setup-actions {
  display: flex;
  gap: 0.5rem;
}

.setup-actions .btn {
  flex: 1;
}

.game-interface {
  max-width: 64rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 1rem;
}

.game-header {
  display: flex;
  justify-content: between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.player-icon {
  font-size: 1.25rem;
}

.game-stats {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.question-counter {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.timer-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.timer-icon {
  font-size: 1.25rem;
}

.timer {
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--accent));
}

.progress-container {
  margin-bottom: 2rem;
}

.progress-bar {
  width: 100%;
  height: 0.75rem;
  background: hsl(var(--muted));
  border-radius: var(--radius);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius);
  transition: width 0.3s var(--transition-smooth);
}

.question-card {
  flex: 1;
  background: hsl(var(--card) / 0.8);
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  animation: bounce-in 0.6s var(--transition-bounce);
}

.question-header {
  padding: 2rem;
  text-align: center;
  border-bottom: 1px solid hsl(var(--border));
}

.question-text {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.question-content {
  padding: 2rem;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.option-button {
  min-height: 4rem;
  padding: 1.5rem;
  text-align: left;
  justify-content: flex-start;
  font-size: 1.125rem;
  border-radius: var(--radius);
  transition: var(--transition-smooth);
}

.option-button:hover {
  transform: scale(1.02);
}

.option-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.option-label {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}

.option-text {
  font-size: 1.125rem;
  flex: 1;
}

.results-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.results-card {
  max-width: 32rem;
  width: 100%;
  background: hsl(var(--card) / 0.8);
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  animation: bounce-in 0.6s var(--transition-bounce);
}

.results-header {
  text-align: center;
  padding: 1.5rem 1.5rem 0;
}

.trophy-icon {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 2.5rem;
}

.results-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.results-subtitle {
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
}

.results-content {
  padding: 1.5rem;
}

.score-display {
  text-align: center;
  margin-bottom: 2rem;
}

.score-numbers {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.score-percentage {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.score-message {
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
}

.score-excellent {
  color: hsl(var(--success));
}

.score-good {
  color: hsl(var(--accent));
}

.score-poor {
  color: hsl(var(--destructive));
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: hsl(var(--muted) / 0.5);
  border-radius: var(--radius);
}

.stat-item .stat-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: hsl(var(--primary));
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detailed-results {
  margin-bottom: 2rem;
}

.detailed-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.detailed-list {
  max-height: 15rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detailed-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius);
}

.detailed-item.correct {
  background: hsl(var(--success) / 0.2);
}

.detailed-item.incorrect {
  background: hsl(var(--destructive) / 0.2);
}

.detailed-number {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: white;
}

.detailed-item.correct .detailed-number {
  background: hsl(var(--success));
}

.detailed-item.incorrect .detailed-number {
  background: hsl(var(--destructive));
}

.detailed-status.correct {
  color: hsl(var(--success));
}

.detailed-status.incorrect {
  color: hsl(var(--destructive));
}

.results-actions {
  display: flex;
  gap: 0.75rem;
}

.results-actions .btn:first-child {
  flex: 1;
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 3rem;
  }

  .action-cards {
    grid-template-columns: 1fr;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .game-header {
    justify-content: space-between;
  }

  .game-stats {
    gap: 1rem;
  }

  .options-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .results-actions {
    flex-direction: column;
  }

  .results-actions .btn {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .question-text {
    font-size: 1.25rem;
  }

  .option-button {
    min-height: 3.5rem;
    padding: 1rem;
    font-size: 1rem;
  }

  .option-text {
    font-size: 1rem;
  }
}

.detailed-list::-webkit-scrollbar {
  width: 6px;
}

.detailed-list::-webkit-scrollbar-track {
  background: hsl(var(--muted));
  border-radius: 3px;
}

.detailed-list::-webkit-scrollbar-thumb {
  background: hsl(var(--muted-foreground));
  border-radius: 3px;
}

.detailed-list::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--foreground));
}

.player-name {
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 0.5rem;
    border-radius: 0.25rem;
}

.player-name:hover {
    background: hsl(var(--primary) / 0.1);
    transform: translateX(5px);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    z-index: 1001;
    transform: scale(0.7) translateY(-50px);
    transition: var(--transition-bounce);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid hsl(var(--border));
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: var(--transition-smooth);
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: hsl(var(--destructive));
    color: white;
    transform: scale(1.1);
}

.modal-body {
    padding: 1.5rem;
}

.contestant-details {
    animation: fadeInUp 0.5s ease-out;
}

.detail-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid hsl(var(--border));
}

.detail-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.detail-rank {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 1rem;
}

.detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.meta-item {
    text-align: center;
    padding: 1rem;
    background: hsl(var(--muted) / 0.3);
    border-radius: 0.5rem;
    transition: var(--transition-smooth);
}

.meta-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px -5px hsl(var(--primary) / 0.3);
}

.meta-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.meta-label {
    font-size: 0.9rem;
    color: hsl(var(--muted-foreground));
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.answers-section h3 {
    margin-bottom: 1rem;
    color: hsl(var(--foreground));
    font-size: 1.3rem;
}

.answers-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.answer-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid hsl(var(--border));
    transition: var(--transition-smooth);
    animation: slideInRight 0.5s ease-out;
}

.answer-item:hover {
    transform: translateX(5px);
}

.answer-item.correct {
    background: hsl(var(--success) / 0.1);
    border-color: hsl(var(--success) / 0.3);
}

.answer-item.incorrect {
    background: hsl(var(--destructive) / 0.1);
    border-color: hsl(var(--destructive) / 0.3);
}

.answer-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-radius: 50%;
    font-weight: 600;
    margin-right: 1rem;
    flex-shrink: 0;
    font-size: 1rem;
}

.answer-details {
    flex: 1;
}

.answer-status {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.answer-status.correct {
    color: hsl(var(--success));
}

.answer-status.incorrect {
    color: hsl(var(--destructive));
}

.answer-meta {
    font-size: 0.9rem;
    color: hsl(var(--muted-foreground));
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes modalEnter {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    50% {
        transform: scale(1.05) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalExit {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .detail-meta {
        grid-template-columns: 1fr;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .detail-name {
        font-size: 1.5rem;
    }
    
    .meta-value {
        font-size: 1.25rem;
    }
}