:root {
    --color-background-start: #1a145c;
    --color-background-end: #0c0a2b;
    --color-primary: #eab308; /* yellow-500 */
    --color-primary-dark: #ca8a04; /* yellow-600 */
    --color-secondary: #5b21b6; /* purple-800 */
    --color-secondary-dark: #4c1d95; /* purple-900 */
    --color-border: #8b5cf6; /* purple-500 */
    --color-text-light: #ffffff;
    --color-text-dark: #000000;
    --color-correct: #16a34a; /* green-600 */
    --color-wrong: #dc2626; /* red-600 */
    --color-gray: #4b5563; /* gray-600 */
  }
  
  @keyframes pulse {
    50% {
      opacity: .7;
    }
  }
  
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
  
  @keyframes fadeInDown {
    from {
      opacity: 0;
      transform: translate(-50%, -60%);
    }
    to {
      opacity: 1;
      transform: translate(-50%, -50%);
    }
  }
  
  
  body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: var(--color-text-light);
    background-color: var(--color-background-end);
    background-image: radial-gradient(circle at top, var(--color-background-start), var(--color-background-end));
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
  }
  
  #app-container {
    width: 100%;
    height: 100%;
    position: relative;
  }
  
  .mute-button {
      position: absolute;
      top: 1rem;
      right: 1rem;
      z-index: 100;
      background-color: rgba(0, 0, 0, 0.5);
      border: 1px solid var(--color-primary);
      color: white;
      font-size: 1.25rem;
      width: 3rem;
      height: 3rem;
      border-radius: 50%;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
  }
  
  .mute-button:hover {
      background-color: var(--color-primary);
      color: var(--color-text-dark);
      transform: scale(1.1);
  }
  
  .screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: calc(100vh - 2rem);
    width: 100%;
  }
  
  .screen.active {
    display: flex;
  }
  
  .title {
    font-size: 3.75rem;
    font-weight: 900;
    color: var(--color-primary);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 1rem;
  }
  
  .subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
  }
  
  .action-button {
    padding: 1rem 3rem;
    background-color: var(--color-primary);
    color: var(--color-text-dark);
    font-weight: bold;
    font-size: 1.5rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
  }
  
  .action-button:hover {
    transform: scale(1.05);
  }
  
  /* Game Screen */
  .game-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    max-width: 1280px;
    margin: auto;
  }
  
  .panel {
    display: flex;
    justify-content: center;
  }
  
  .panel-center {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
  }
  
  /* Joker Panel */
  .joker-panel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    width: 100%;
    max-width: 24rem;
  }
  
  .joker-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 2px solid var(--color-primary);
    background-color: rgba(76, 29, 149, 0.7);
    color: var(--color-text-light);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
  }
  
  .joker-button:hover:not(:disabled) {
    background-color: var(--color-primary);
    color: var(--color-text-dark);
  }
  
  .joker-button:disabled {
    background-color: #374151;
    border-color: #6b7280;
    cursor: not-allowed;
    color: #9ca3af;
  }
  
  .joker-icon {
    font-size: 1.25rem;
    margin-right: 0.5rem;
  }
  .joker-name {
      display: none;
  }
  
  .joker-button.used::after {
    content: 'X';
    position: absolute;
    inset: 0;
    background-color: rgba(153, 27, 27, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-size: 2rem;
    font-weight: bold;
    color: white;
  }
  
  
  /* Game Content */
  #game-content {
      width: 100%;
  }
  
  .loading-spinner {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 24rem; /* 384px */
  }
  .spinner {
      animation: spin 1s linear infinite;
      border-radius: 50%;
      width: 8rem;
      height: 8rem;
      border-top: 2px solid var(--color-primary);
      border-bottom: 2px solid var(--color-primary);
  }
  .loading-spinner p {
      margin-top: 1rem;
      font-size: 1.25rem;
  }
  
  .question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1rem;
  }
  
  .category-display {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    color: var(--color-primary);
    font-weight: 600;
  }
  
  .timer {
    position: relative;
    width: 5rem;
    height: 5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 4px solid var(--color-primary);
    background-color: var(--color-secondary-dark);
  }
  .timer.warning {
      border-color: var(--color-wrong);
  }
  
  #timer-text {
    font-size: 2.25rem;
    font-weight: bold;
    color: white;
  }
  
  .question-box {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 2px solid var(--color-border);
    text-align: center;
    width: 100%;
    box-sizing: border-box;
  }
  
  #question-text {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.6;
    margin: 0;
  }
  
  .options-container {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
  }
  
  .option-button {
    width: 100%;
    padding: 1rem;
    border-radius: 9999px;
    border: 2px solid var(--color-border);
    background-color: rgba(91, 33, 182, 0.8);
    color: var(--color-text-light);
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s;
  }
  .option-button:not(.hidden):hover:not(:disabled) {
      background-color: var(--color-primary);
      color: var(--color-text-dark);
      transform: scale(1.05);
  }
  .option-button.hidden {
      visibility: hidden;
  }
  .option-button:disabled {
      opacity: 0.7;
      cursor: not-allowed;
  }
  
  .option-key {
    font-weight: bold;
    color: var(--color-primary);
    margin-right: 1rem;
  }
  
  /* Option states */
  .option-button.selected {
    background-color: var(--color-primary);
    border-color: #fde047; /* yellow-300 */
    color: var(--color-text-dark);
  }
  .option-button.correct {
    background-color: var(--color-correct);
    border-color: #4ade80; /* green-400 */
    animation: pulse 1s infinite;
  }
  .option-button.wrong {
    background-color: var(--color-wrong);
    border-color: #f87171; /* red-400 */
  }
  
  .walk-away-button {
    margin-top: 1rem;
    padding: 0.5rem 2rem;
    background-color: var(--color-wrong);
    color: white;
    font-weight: bold;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
  }
  .walk-away-button:hover:not(:disabled) {
    transform: scale(1.05);
  }
  .walk-away-button:disabled {
    background-color: #6b7280;
  }
  
  
  /* Prize Ladder */
  .prize-ladder {
    width: 100%;
    max-width: 24rem;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--color-border);
  }
  
  .prize-ladder ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.25rem;
  }
  
  .prize-ladder li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.3s;
    color: white;
    font-size: 0.875rem;
  }
  
  .prize-ladder li.current {
    background-color: var(--color-primary);
    color: var(--color-text-dark);
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--color-primary);
  }
  .prize-ladder li.achieved {
    color: #9ca3af;
  }
  .prize-ladder li.milestone {
    font-weight: bold;
  }
  .prize-ladder .prize-question {
      font-weight: bold;
  }
  .prize-ladder .prize-amount {
      font-weight: 600;
  }
  .prize-ladder .current .prize-question,
  .prize-ladder .current .prize-amount {
      font-weight: bold;
  }
  
  
  /* Modal */
  .modal-overlay {
      position: fixed;
      inset: 0;
      background-color: rgba(0, 0, 0, 0.75);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 50;
      padding: 1rem;
      display: none; /* Initially hidden */
  }
  .modal-overlay.active {
      display: flex;
  }
  
  .modal-content {
      background: linear-gradient(to bottom right, var(--color-secondary-dark), #3730a3); /* indigo-900 */
      border-radius: 0.5rem;
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
      padding: 1.5rem;
      border: 1px solid var(--color-primary);
      color: white;
      width: 100%;
      max-width: 32rem; /* 512px */
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      animation: fadeInDown 0.3s ease-out;
  }
  
  .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1rem;
  }
  
  #modal-title {
      font-size: 1.5rem;
      font-weight: bold;
      color: var(--color-primary);
      margin: 0;
  }
  
  #modal-close-button {
      background: none;
      border: none;
      color: white;
      font-size: 1.5rem;
      cursor: pointer;
      transition: color 0.2s;
  }
  #modal-close-button:hover {
      color: var(--color-primary);
  }
  #modal-body {
      white-space: pre-wrap;
      font-size: 1.125rem;
      font-family: 'Inter', sans-serif;
  }
  
  /* Audience Poll */
  .audience-poll-chart {
      display: flex;
      justify-content: space-around;
      align-items: flex-end;
      height: 8rem;
      margin-top: 1rem;
      gap: 0.5rem;
      width: 100%;
  }
  .audience-poll-chart .bar-container {
      display: flex;
      flex-direction: column;
      align-items: center;
      flex: 1;
  }
  .audience-poll-chart .bar {
      width: 100%;
      background-color: var(--color-primary);
      border-top-left-radius: 0.375rem;
      border-top-right-radius: 0.375rem;
      transition: height 0.5s ease-out;
  }
  .audience-poll-chart .bar-label {
      font-weight: bold;
      color: white;
  }
  .audience-poll-chart .bar-value {
      font-size: 0.875rem;
      color: var(--color-primary);
  }
  
  /* Responsive Design */
  @media (min-width: 768px) {
      .joker-name {
          display: inline;
      }
      .joker-panel {
          grid-template-columns: repeat(4, 1fr);
      }
       .options-container {
          grid-template-columns: repeat(2, 1fr);
      }
  }
  
  @media (min-width: 1024px) {
      .game-layout {
          flex-direction: row;
          align-items: flex-start;
      }
      .panel-left {
          width: 16rem;
          order: 1;
      }
      .panel-center {
          width: 50%;
          order: 2;
      }
      .panel-right {
          width: 16rem;
          order: 3;
      }
      .joker-panel {
          grid-template-columns: repeat(2, 1fr);
          max-width: none;
      }
  }
