/* ================== CSS Variables ================== */
/* Updated: 2025-07-25 - Form visibility improvements */
  :root {
    --primary-color: #2e7d32;
    --secondary-color: #388E3C;
    --accent-color: #FFEB3B;
    --background-color: #e0f7fa;
    --text-color: #333;
    --button-hover-color: #66BB6A;
    --error-color: #E53935;
    --success-color: #43A047;
    --font-primary: 'Roboto', sans-serif;
    --font-secondary: 'Arial Black', Gadget, sans-serif;
    --shadow-color: rgba(0, 0, 0, 0.3);
  }

  /* ================== Reset and Basic Styles ================== */
  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  body {
    font-family: var(--font-primary);
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    color: var(--text-color);
    padding: 10px 0 120px 0; /* Reduced top padding for better form visibility */
  }

  /* ================== Setup Form Styles ================== */
  .setup-form {
    max-width: 800px;
    width: 90%;
    margin: 10px auto;
    padding: 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    max-height: 95vh;
    overflow-y: auto;
  }

  .setup-header {
    background: linear-gradient(135deg, #2e7d32, #4caf50);
    color: white;
    padding: 20px;
    text-align: center;
  }

  .setup-header h2 {
    margin: 0;
    font-size: 2.2em;
    font-weight: 700;
    color: white;
  }

  #form-title {
    color: white !important;
  }

  .setup-subtitle {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1em;
  }

  /* Progress Indicator */
  .progress-container {
    padding: 20px 30px;
    background: white;
    border-bottom: 1px solid #e9ecef;
  }

  .progress-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
  }

  .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #2e7d32);
    border-radius: 3px;
    width: 16.67%;
    transition: width 0.3s ease;
  }

  .step-indicators {
    display: flex;
    justify-content: space-between;
    gap: 10px;
  }

  .step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
  }

  .step-label {
    font-size: 12px;
    color: #6c757d;
    text-align: center;
    line-height: 1.2;
  }

  .step-indicator.active .step-number {
    background: #4caf50;
    color: white;
  }

  .step-indicator.active .step-label {
    color: #4caf50;
    font-weight: 600;
  }

  .step-indicator.completed .step-number {
    background: #2e7d32;
    color: white;
  }

  .step-indicator.completed .step-label {
    color: #2e7d32;
  }

  .setup-form h2 {
    text-align: center;
    margin-bottom: 20px;
    font-family: var(--font-secondary);
    color: var(--primary-color);
    font-size: 2em;
  }

  .step {
    display: none;
  }

  .step.active {
    display: block;
  }

  .step-content {
    padding: 25px;
    background: white;
    min-height: auto;
  }

  .step-header {
    text-align: center;
    margin-bottom: 25px;
  }

  .step-header h3 {
    font-size: 1.8em;
    margin: 0 0 10px 0;
    color: #2e7d32;
  }

  .step-header p {
    margin: 0;
    color: #6c757d;
    font-size: 1.1em;
  }

  /* Form Groups */
  .form-group {
    margin-bottom: 25px;
  }

  .form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.1em;
  }

  .label-icon {
    font-size: 1.2em;
  }

  /* Radio Cards */
  .radio-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
  }

  .radio-card {
    position: relative;
    display: block;
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .radio-card:hover {
    background: #e9ecef;
    border-color: #4caf50;
    transform: translateY(-2px);
  }

  .radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  .radio-card input[type="radio"]:checked + .card-content {
    color: #4caf50;
  }

  .radio-card:has(input:checked) {
    background: #e8f5e8;
    border-color: #4caf50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
  }

  .card-title {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1.1em;
  }

  .card-desc {
    font-size: 0.9em;
    color: #6c757d;
    line-height: 1.3;
  }

  /* Duration Cards */
  .duration-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .duration-card {
    position: relative;
    display: block;
    padding: 25px 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid #e9ecef;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
  }

  .duration-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  }

  .duration-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  .duration-card:has(input:checked) {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c8);
    border-color: #4caf50;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
  }

  .duration-time {
    font-size: 2.5em;
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 5px;
  }

  .duration-desc {
    font-size: 0.95em;
    color: #495057;
    margin-bottom: 10px;
    line-height: 1.4;
  }

  .duration-icon {
    font-size: 2em;
    opacity: 0.7;
  }

  /* Advanced Settings */
  .advanced-settings {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
  }

  .settings-header h4 {
    margin: 0 0 20px 0;
    color: #495057;
    font-size: 1.2em;
  }

  .number-inputs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px !important;
    margin-bottom: 10px !important;
  }

  .range-helper {
    margin-top: 8px;
    padding: 10px;
    background: rgba(76, 175, 80, 0.1);
    border-left: 4px solid #4caf50;
    border-radius: 0 8px 8px 0;
  }

  .range-helper p {
    margin: 0;
    color: #2e7d32;
    font-size: 0.95em;
    line-height: 1.4;
  }

  .input-field {
    display: flex;
    flex-direction: column;
  }

  .input-field.full-width {
    width: 100%;
  }

  .input-field label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
    font-size: 0.9em;
  }

  .input-field input {
    padding: 8px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.3s ease;
  }

  .input-field input:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
  }

  /* Checkbox Options */
  .checkbox-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
  }

  .checkbox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
  }

  .checkbox-option:hover {
    background: rgba(76, 175, 80, 0.1);
  }

  .checkbox-option input[type="checkbox"] {
    display: none;
  }

  .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
  }

  .checkbox-option input[type="checkbox"]:checked + .checkmark {
    background: #4caf50;
    border-color: #4caf50;
  }

  .checkbox-option input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    font-weight: bold;
    left: 3px;
    top: -2px;
  }

  /* Step Actions */
  .step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
  }

  /* Button Styles */
  .btn-primary, .btn-secondary, .btn-success {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
  }

  .btn-primary {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
  }

  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
  }

  .btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #e9ecef;
  }

  .btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
  }

  .btn-success {
    background: linear-gradient(135deg, #ff6f00, #e65100);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 111, 0, 0.3);
  }

  .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 111, 0, 0.4);
  }

  .btn-icon {
    font-size: 1.2em;
  }

  /* Options Selector */
  .options-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
  }

  .option-card {
    position: relative;
    display: block;
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
  }

  .option-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }

  .option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  .option-card:has(input:checked) {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c8);
    border-color: #4caf50;
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.3);
  }

  .option-number {
    font-size: 2.5em;
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 8px;
  }

  .option-desc {
    font-size: 0.9em;
    color: #6c757d;
    line-height: 1.3;
  }

  /* Time Slider */
  .time-slider-container {
    text-align: center;
  }

  .slider-wrapper {
    margin-bottom: 20px;
  }

  .time-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
    margin: 20px 0;
  }

  .time-slider::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  }

  .time-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  }

  .slider-value {
    font-size: 1.5em;
    font-weight: 600;
    color: #2e7d32;
    margin-bottom: 15px;
  }

  .time-suggestions {
    display: flex;
    justify-content: center;
    gap: 15px;
  }

  .time-preset {
    padding: 12px 16px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-align: center;
    min-width: 60px;
  }

  .time-preset:hover {
    background: #e9ecef;
    transform: translateY(-2px);
  }

  .time-preset.active {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c8);
    border-color: #4caf50;
    color: #2e7d32;
  }

  .time-preset small {
    display: block;
    font-size: 0.8em;
    opacity: 0.7;
    margin-top: 2px;
  }

  /* Teams Container */
  .teams-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: start;
  }

  .team-setup {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
  }

  .team-setup:hover {
    border-color: #4caf50;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }

  .team-header h4 {
    margin: 0 0 20px 0;
    font-size: 1.3em;
    text-align: center;
  }

  .vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: 700;
    color: #2e7d32;
    background: linear-gradient(135deg, #e8f5e8, #c8e6c8);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #4caf50;
  }

  .vs-text {
    font-size: 0.8em;
  }

  .image-upload-area {
    margin-top: 8px;
  }

  .upload-box {
    border: 2px dashed #e9ecef;
    border-radius: 12px;
    padding: 12px !important;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .upload-box:hover {
    border-color: #4caf50;
    background: #f0f8f0;
  }

  .upload-placeholder {
    color: #6c757d;
  }

  .upload-icon {
    font-size: 1.5em;
    margin-bottom: 5px;
    display: block;
  }

  .upload-text {
    font-weight: 600;
    font-size: 0.9em;
  }

  .image-preview {
    width: 100%;
    height: 120px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
  }

  /* Game Mode Card */
  .operation-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
  }

  .game-mode-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: linear-gradient(135deg, #e8f5e8, #c8e6c8);
    border: 2px solid #4caf50;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
  }

  .game-mode-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
  }

  .game-mode-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
  }

  .game-mode-card input[type="radio"]:checked + .card-content {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    color: white;
    border-radius: 10px;
    padding: 15px;
    margin: -15px;
  }

  .game-mode-card input[type="radio"]:checked + .card-content h4,
  .game-mode-card input[type="radio"]:checked + .card-content p {
    color: white;
  }

  .card-content {
    flex: 1;
    text-align: center;
    transition: all 0.3s ease;
  }

  .card-icon {
    font-size: 3em;
    opacity: 0.8;
  }

  .game-mode-card h4 {
    margin: 0 0 8px 0;
    font-size: 1.4em;
    color: #2e7d32;
  }

  .game-mode-card p {
    margin: 0;
    color: #495057;
    line-height: 1.4;
  }

  /* Legacy buttons support */
  .buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
  }

  .buttons button {
    padding: 12px 24px;
    background: linear-gradient(145deg, var(--secondary-color), var(--primary-color));
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 4px 6px var(--shadow-color);
    outline: none;
    font-weight: 700;
    flex: 1;
    margin: 0 5px;
  }

  .buttons button:first-child {
    margin-left: 0;
  }

  .buttons button:last-child {
    margin-right: 0;
  }

  .buttons button:hover,
  .buttons button:focus {
    background: linear-gradient(145deg, var(--button-hover-color), #43A047);
    transform: translateY(-3px);
  }

  .checkbox-group, .input-group {
    margin-bottom: 20px;
  }

  .checkbox-group label,
  .input-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 1em;
  }

  .radio-group {
    margin-top: 10px;
  }

  .radio-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
    cursor: pointer;
  }

  .radio-group input[type="radio"] {
    margin-right: 8px;
  }

  .input-group input {
    width: 100%;
    padding: 10px 12px;
    font-size: 1em;
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    outline: none;
    transition: border-color 0.3s;
  }

  .input-group input:focus {
    border-color: var(--secondary-color);
  }

  /* ================== Team Images Upload ================== */
.team-images-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.team-image-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.team-image-upload label {
  margin-bottom: 10px;
  font-size: 1.1em;
  color: var(--primary-color);
}

.team-image-upload input {
  margin-bottom: 10px;
}

.team-image-upload input[type="text"] {
  width: 100%;
  padding: 8px;
  margin-bottom: 15px;
  border: 2px solid var(--primary-color);
  border-radius: 5px;
  font-size: 1em;
}

.team-image-upload input[type="text"]:focus {
  border-color: var(--secondary-color);
  outline: none;
  box-shadow: 0 0 5px rgba(46, 125, 50, 0.3);
}

.image-preview {
  width: 150px;
  height: 150px;
  border: 2px dashed var(--secondary-color);
  border-radius: 10px;
  background-size: cover;
  background-position: center;
}

/* Update operation parameters styles */
.division-params {
  display: block;
  margin-bottom: 20px;
}

.division-params label {
  display: block;
  margin-bottom: 10px;
  font-size: 1em;
}

.division-params input {
  width: 100%;
  padding: 10px 12px;
  font-size: 1em;
  border: 2px solid var(--primary-color);
  border-radius: 5px;
  outline: none;
  transition: border-color 0.3s;
}

.division-params input:focus {
  border-color: var(--secondary-color);
}

  /* ================== Game Interface Styles ================== */
  .game-interface {
    width: 90%;
    max-width: 1200px;
    display: none;
    flex-direction: column;
    align-items: center;
  }

  /* Header */
  .header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, #2e7d32, #4caf50);
    width: 100%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    margin-bottom: 10px;
    color: #fff;
    gap: 10px;
  }

  .game-info {
    flex: 1;
    padding: 0 10px;
  }

  .top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
  }


  .top-info {
    display: flex;
    gap: 20px;
    align-items: center;
  }

  .answer-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 1.2em;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
  }

  .question-number {
    display: none;
  }

  .answer-timer img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
  }

  .answer-timer span {
    min-width: 40px;
    text-align: center;
    display: inline-block;
  }

  .match-timer-container {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .match-info {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    padding: 5px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    font-size: 1em;
    color: #ffffff;
    flex-shrink: 0;
  }

  #match-timer {
    font-weight: bold;
    font-size: 1.2em;
    min-width: 50px;
    text-align: center;
  }

  #half-display {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 5px;
  }

  .question-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
  }

  .question-text {
    font-size: 6.5em;
    text-align: center;
    padding: 15px 40px;
    color: white;
    font-weight: 900;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.6);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 25px;
    line-height: 1.2;
    flex: 1;
    letter-spacing: 3px;
    border: 4px solid rgba(255, 255, 255, 0.5);
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
  }

  @media (max-width: 768px) {
    .header {
      padding: 15px 20px;
    }

    .top-info {
      gap: 10px;
    }

    .answer-timer {
      padding: 8px 20px;
      font-size: 1.3em;
      margin-top: 10px;
    }

    .answer-timer img {
      width: 20px;
      height: 20px;
    }

    .answer-timer span {
      min-width: 45px;
    }

    .question-text {
      font-size: 4.5em;
      padding: 12px 25px;
      letter-spacing: 2px;
      transform: scale(1);
    }

    .top-row {
      flex-wrap: wrap;
      gap: 10px;
      justify-content: center;
    }

    .match-info {
      font-size: 0.9em;
      padding: 4px 12px;
    }

    .team1-timer {
      left: 25px;
    }

    .team2-timer {
      right: 25px;
    }

    .timer-content {
      padding: 15px;
    }

    .timer-content img {
      width: 30px;
      height: 30px;
    }

    .timer-content {
      min-width: 85px;
    }

    .timer-content span {
      font-size: 1.5em;
      min-width: 55px;
    }
  }

  .header .team-score-container {
    flex: 0 0 auto;
  }

  .header .team-score {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: center;
    font-size: 1.2em;
    color: #fff;
    margin: 0;
    font-family: var(--font-secondary);
  }

  .team-1-layout {
    flex-direction: row;
  }

  .team-2-layout {
    flex-direction: row-reverse;
  }

  .team-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .header .team-name {
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    font-size: 1.2em;
  }

  .header .team-score-value {
    font-size: 1.5em !important;
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    display: block;
  }

  .team-header-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-color);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
  }

  .header .timer {
    flex: 0 0 auto;
  }

  .header .question-text {
    flex: 1;
    text-align: center;
    font-size: 1.5em;
    padding: 0 15px;
  }

  .header .question-number {
    flex: 0 0 auto;
  }

  @media (max-width: 480px) {
    .answer-timer {
      padding: 6px 15px;
      font-size: 1.1em;
      margin-top: 8px;
    }

    .answer-timer img {
      width: 18px;
      height: 18px;
    }

    .answer-timer span {
      min-width: 40px;
    }

    .question-text {
      font-size: 3.5em;
      padding: 10px 22px;
      flex: 0 0 100%;
      order: 2;
      letter-spacing: 1.5px;
      font-weight: 900;
      transform: scale(1);
    }

    .top-row {
      flex-direction: column;
      gap: 8px;
    }

    .match-info {
      order: 1;
    }

    .answer-timer {
      order: 3;
    }

    .team1-timer {
      left: 15px;
    }

    .team2-timer {
      right: 15px;
    }

    .timer-content {
      padding: 10px;
    }

    .timer-content img {
      width: 25px;
      height: 25px;
    }

    .timer-content {
      min-width: 75px;
    }

    .timer-content span {
      font-size: 1.2em;
      min-width: 45px;
    }

    /* Setup form mobile adjustments */
    .setup-form {
      width: 95%;
      margin: 5px auto;
      max-height: 98vh;
    }

    .setup-header {
      padding: 15px;
    }

    .setup-header h2 {
      font-size: 1.8em;
    }

    .step-content {
      padding: 20px;
    }

    .step-header h3 {
      font-size: 1.5em;
    }

    .step-header p {
      font-size: 1em;
    }

    .form-group {
      margin-bottom: 15px;
    }

    .upload-box {
      padding: 10px !important;
      min-height: 60px;
    }

    .input-field input {
      padding: 6px;
    }

    .input-field label {
      margin-bottom: 4px;
      font-size: 0.85em;
    }

    .step-actions {
      margin-top: 20px;
      padding-top: 15px;
    }

    .number-inputs-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
    }

    .progress-container {
      padding: 15px 20px;
    }

    .step-indicators {
      gap: 5px;
    }

    .step-number {
      width: 28px;
      height: 28px;
      font-size: 12px;
    }

    .step-label {
      font-size: 10px;
    }

    .duration-cards {
      grid-template-columns: 1fr;
      gap: 15px;
    }

    .options-selector {
      grid-template-columns: repeat(2, 1fr);
    }

    .teams-container {
      grid-template-columns: 1fr;
      gap: 20px;
    }

    .vs-divider {
      width: 50px;
      height: 50px;
      margin: 0 auto;
    }

    .btn-primary, .btn-secondary, .btn-success {
      padding: 12px 20px;
      font-size: 1em;
    }

    .question-text {
      font-size: 1.4em;
      margin: 0 10px;
    }
  }

  /* ================== Players Styles ================== */
.player {
  position: absolute;
  font-size: 35px;
  z-index: 260;
  transition: all 2s cubic-bezier(0.36, 0, 0.66, -0.56);
  transform-origin: center;
}

/* Team 1 Players (Offensive) */
.team-1.player-1 {
  top: 10%;
  left: 10%;
}

.team-1.player-2 {
  top: 10%;
  left: 40%;
}

.team-1.player-3 {
  top: 10%;
  left: 70%;
}

/* Team 2 Players (Offensive) */
.team-2.player-1 {
  bottom: 10%;
  right: 10%;
}

.team-2.player-2 {
  bottom: 10%;
  right: 40%;
}

.team-2.player-3 {
  bottom: 10%;
  right: 70%;
}

/* Defensive Positioning Classes */
.defensive-left {
  left: 20% !important; /* Changed from 10% */
}

.defensive-right {
  right: 20% !important; /* Changed from 10% */
}

.defensive-top {
  top: 20% !important;
}

.defensive-middle {
  top: 50% !important;
}

.defensive-bottom {
  top: 80% !important;
}

/* Add this after the defensive positioning classes */
@keyframes defenseMove {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(20px);
  }
  100% {
    transform: translateY(0);
  }
}

/* Update the defensive positioning classes */
.defensive-left, .defensive-right {
  animation: defenseMove 2s ease-in-out infinite;
}

.defensive-top {
  top: 20% !important;
  animation-delay: -0.6s !important; /* Offset animation for varied movement */
}

.defensive-middle {
  top: 50% !important;
  animation-delay: -0.4s !important;
}

.defensive-bottom {
  top: 80% !important;
  animation-delay: -0.2s !important;
}

/* Player Animation Styles */
@keyframes runningMotion {
    0% { 
        transform: translateY(0) rotate(0deg);
        filter: brightness(1);
    }
    25% { 
        transform: translateY(-5px) rotate(-5deg);
        filter: brightness(1.1);
    }
    50% { 
        transform: translateY(0) rotate(0deg);
        filter: brightness(1);
    }
    75% { 
        transform: translateY(-5px) rotate(5deg);
        filter: brightness(1.1);
    }
    100% { 
        transform: translateY(0) rotate(0deg);
        filter: brightness(1);
    }
}

.player.running {
    animation: runningMotion 0.4s infinite;
}

.player.running + .football {
    animation: runningMotion 0.4s infinite;
}

/* Team 1 Players (Red) */
.team-1.player-1,
.team-1.player-2,
.team-1.player-3 {
  color: transparent;
  text-shadow: 0 0 0 #fd3168; /* Red color */
}

/* Team 2 Players (Blue) */
.team-2.player-1,
.team-2.player-2,
.team-2.player-3 {
  color: transparent;
  text-shadow: 0 0 0 white; /* Blue color */
}

/* Control Buttons Positioned at Bottom Right */
  .control-buttons {
    position: fixed;
    top: 10px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 20;
  }

  /* ================== Control Buttons with External PNG Icons ================== */
  .control-buttons button {
    background: linear-gradient(145deg, var(--secondary-color), var(--primary-color));
    border: none;
    border-radius: 50%; /* Makes buttons circular */
    color: #fff; /* Sets icon color to white */
    cursor: pointer;
    transition: background 0.3s, transform 0.2s, background-color 0.3s;
    box-shadow: 0 4px 6px var(--shadow-color);
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px; /* Fixed width for uniformity */
    height: 30px; /* Fixed height for uniformity */
    padding: 0;
  }

  .control-buttons button:hover,
  .control-buttons button:focus {
    background: linear-gradient(145deg, var(--button-hover-color), #43A047);
    transform: translateY(-3px);
  }

  /* Ensure PNG icons do not interfere with button clicks */
  .control-buttons button img {
    pointer-events: none; /* Ensures PNG doesn't capture clicks */
    width: 14px; /* Adjust icon size as needed */
    height: 14px;
  }

  /* Team Score Styles */
  .team-score {
    text-align: center;
    font-size: 2.5em;
    color: #116e62;
    margin: 0 20px;
    font-family: var(--font-secondary);
  }

  .team-score span {
    display: block;
    font-size: 3.5em; /* Increased font size */
    color: var(--accent-color);
    margin-top: 5px;
    text-shadow: 1px 1px #000;
  }

  /* Question Display and Feedback */
  .question-display {
    text-align: center;
    flex: 1;
  }

  /* Removed the <p id="current-question"> element */

  /* ================== Feedback Popup ================== */
  .feedback-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background-color: rgba(255, 255, 255, 0.98);
    padding: 20px 25px; /* Reduced padding */
    border-radius: 12px; /* Slightly reduced border radius */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    min-width: 250px; /* Reduced minimum width */
  }

  .feedback-popup.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  .feedback-popup.quarter-break {
    background: linear-gradient(135deg, #FF9800, #F57C00);
  }

  .feedback-popup.quarter-break .feedback-content {
    font-size: 3em;
    font-weight: bold;
    color: white;
  }

  .feedback-content {
    text-align: center;
    font-size: 1.1em; /* Reduced font size */
    color: var(--text-color);
  }

  .feedback-icon {
    font-size: 1.8em; /* Reduced icon size */
    margin-bottom: 8px; /* Reduced margin */
  }

  .feedback-equation {
    font-family: var(--font-secondary);
    font-size: 1.2em; /* Reduced font size */
    margin: 10px 0; /* Reduced margin */
    padding: 8px; /* Reduced padding */
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
  }

  .feedback-details {
    font-size: 0.85em; /* Reduced font size */
    color: #666;
    margin-top: 8px; /* Reduced margin */
    font-weight: bold;
  }

  /* Remove the old feedback styles */
  .feedback {
    display: none;
  }

  /* Football Field */
  .main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
    margin-top: 10px;
  }

  .field-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
  }

  /* Team Timers */
  .team-timer {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 300;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .team-timer.active {
    opacity: 1;
  }

  .team1-timer {
    left: 40px;
  }

  .team2-timer {
    right: 40px;
  }

  .timer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: rgba(46, 125, 50, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.3);
    min-width: 100px;
  }

  .timer-content img {
    width: 40px;
    height: 40px;
    filter: brightness(0) invert(1);
  }

  .timer-content span {
    font-size: 2em;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    min-width: 65px;
    display: inline-block;
    text-align: center;
  }

  .team-score-container {
    flex: 0 0 auto;
    text-align: center;
    margin: 0 20px;
  }




/* ..field... */

/* ================== Football Field ================== */

.field-background {
  background-color: #3CB371; /* Same green as the football field */
  padding: 20px 50px; /* Adjust padding to increase the extra green area */
  border-radius: 10px; /* Match the border radius of the field-container for a seamless look */
  box-shadow: 0 4px 6px var(--shadow-color);
  width: 100%;
  margin-bottom: 20px;
}



.field-container {
    position: relative;
    height: 500px;
    background-color: #3CB371; /* Green field */
    border: 10px solid #fff;
  }
  
  .goal-left { 
    position: absolute;
    z-index: 300;
    left: -40px;
    width: 40px;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
   
   }

   .goal-left .goal { 
   
    width: 20px;
    height: 60px;
    border-top: 3px solid white;
    border-right: 3px solid white;
    border-bottom: 3px solid white;
   }

   .goal-left .support { 
   
    width: 20px;
    height: 3px;
    border-top: 3px solid white;
    border-right: 3px solid white;
    border-bottom: 3px solid white;
   }


   .goal-right { 
    position: absolute;
    z-index: 300;
    right: -40px;
    width: 40px;
    height: 100%;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
   
   }

   .goal-right .goal { 
   
    width: 20px;
    height: 60px;
    border-top: 3px solid white;
    border-left: 3px solid white;
    border-bottom: 3px solid white;
   }

   .goal-right .support { 
   
    width: 20px;
    height: 3px;
    border-top: 3px solid white;
    border-right: 3px solid white;
    border-bottom: 3px solid white;
   }


  /* End Zones */
  .field-container::before,
  .field-container::after {
    content: '';
    position: absolute;
    width: 10%; /* Changed from fixed pixels to percentage for responsiveness */
    height: 100%;
  }
  
  .field-container::before {
    left: 0; /* Position left end zone */
    background-color: #fd3168; /* Left end zone color */
    border-right: 3px solid #fff;

  }
  
  .field-container::after {
    right: 0; /* Position right end zone */
    background-color: #459cff; /* Right end zone color */
    border-left: 3px solid #fff;

  }
  

/* Yard Lines Container */
.yard-lines-container {
    position: absolute;
    top: 0;
    left: 10%; /* Start after the left end zone */
    width: 80%; /* Occupy the space between the two end zones */
    height: 100%;
    pointer-events: none; /* Prevent yard lines from capturing mouse events */
    z-index: 150; /* Ensure yard lines are above end zones */
  }
  
  /* Yard Lines */
  .yard-lines-container .yard-line {
    position: absolute;
    top: 0;
    height: 100%;
    width: 2px;
    border-left: 2px solid white; /* Dashed lines */
    opacity: 0.7;
  }
  
  /* Positioning Yard Lines Using Percentages */
  
  .yard-line:nth-child(1) { left: 10%; }
  .yard-line:nth-child(2) { left: 20%; }
  .yard-line:nth-child(3) { left: 30%; }
  .yard-line:nth-child(4) { left: 40%; }
  .yard-line:nth-child(5) { left: 50%; }
  .yard-line:nth-child(6) { left: 60%; }
  .yard-line:nth-child(7) { left: 70%; }
  .yard-line:nth-child(8) { left: 80%; }
  .yard-line:nth-child(9) { left: 90%; }


  .top-marks {
    z-index: 250;
    position: absolute;
    height: 8px;
    width: 80%;
    left: 10%;
  background: repeating-linear-gradient(
    to right,
    rgba(255,255,255,0) 0px,
    rgba(255,255,255,0) 6px,
    #FFF 6px,
    #FFF 7.5px
  );
}

.top-marks-1 { top: 0; }
.top-marks-2 { bottom: 35%; }
.top-marks-3 { top: 35%; }
.top-marks-4 { bottom: 0; }



/* Add Endzone Divs Styles */
.endzone.left,
.endzone.right {
  position: absolute;
  top: 0;
  width: 10%; /* Matches the previous width for responsiveness */
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.endzone.left {
  left: 0;
  background-color: #fd3168; /* Left end zone color */

}

.endzone.right {
  right: 0;
  background-color: #459cff; /* Right end zone color */
}

/* Style for End Zone Labels */
.end-zone-label {
  font-size: 1.5em;
  color: #fff;
  font-weight: bold;
  z-index: 200;
  letter-spacing: 2px;
}

.endzone.left .end-zone-label {
  transform: rotate(-90deg);
  transform-origin: center;
  white-space: nowrap; /* Ensure text stays on one line */

}

.endzone.right .end-zone-label {
  transform: rotate(90deg);
  transform-origin: center;
  white-space: nowrap; /* Ensure text stays on one line */

}



  /* Footballs */
  .football {
    position: absolute;
    transform: translateY(-50%);
    width: 45px;
    height: 35px;
    background-image: url('https://static.vecteezy.com/system/resources/thumbnails/008/513/589/small_2x/american-football-ball-illustration-png.png');
    background-size: contain;
    background-repeat: no-repeat;
    cursor: pointer;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    z-index: 259; /* Slightly below player for visual overlap */
  }

@keyframes spinBall {
  0% { 
    transform: rotate(0deg) translateY(-50%) scale(1);
  }
  25% { 
    transform: rotate(360deg) translateY(-70%) scale(0.95);
  }
  50% { 
    transform: rotate(720deg) translateY(-80%) scale(0.9);
  }
  75% { 
    transform: rotate(1080deg) translateY(-70%) scale(0.95);
  }
  100% { 
    transform: rotate(1440deg) translateY(-50%) scale(1);
  }
}

@keyframes spiralPass {
  0% {
    transform: rotate(0deg) translateY(-50%);
  }
  100% {
    transform: rotate(360deg) translateY(-50%);
  }
}

@keyframes footballSpin {
  0% {
    transform: rotateZ(0deg) scale(1);
    filter: drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.3));
  }
  25% {
    transform: rotateZ(45deg) scale(1.1);
    filter: drop-shadow(3px 5px 10px rgba(0, 0, 0, 0.4));
  }
  50% {
    transform: rotateZ(90deg) scale(1.15);
    filter: drop-shadow(4px 6px 12px rgba(0, 0, 0, 0.5));
  }
  75% {
    transform: rotateZ(135deg) scale(1.1);
    filter: drop-shadow(3px 5px 10px rgba(0, 0, 0, 0.4));
  }
  100% {
    transform: rotateZ(180deg) scale(1);
    filter: drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.3));
  }
}

@keyframes footballSpinReverse {
  0% {
    transform: rotateZ(0deg) scale(1);
    filter: drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.3));
  }
  25% {
    transform: rotateZ(-45deg) scale(1.1);
    filter: drop-shadow(3px 5px 10px rgba(0, 0, 0, 0.4));
  }
  50% {
    transform: rotateZ(-90deg) scale(1.15);
    filter: drop-shadow(4px 6px 12px rgba(0, 0, 0, 0.5));
  }
  75% {
    transform: rotateZ(-135deg) scale(1.1);
    filter: drop-shadow(3px 5px 10px rgba(0, 0, 0, 0.4));
  }
  100% {
    transform: rotateZ(-180deg) scale(1);
    filter: drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.3));
  }
}

@keyframes floatBall {
  0%, 100% { transform: translateY(-50%); }
  50% { transform: translateY(-70%); }
}

.football.spinning {
  animation: footballSpinReverse 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transition: left 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
              right 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              top 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              bottom 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 10;
}

.football.team2.spinning {
  animation: footballSpin 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.football.spinning::after {
  content: '';
  position: absolute;
  width: 130%;
  height: 130%;
  top: -15%;
  left: -15%;
  background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.25) 0%, transparent 60%);
  animation: spinGlow 0.8s ease-out;
  border-radius: 50%;
  pointer-events: none;
}

@keyframes spinGlow {
  0% { 
    opacity: 0; 
    transform: scale(0.6); 
  }
  30% { 
    opacity: 0.9; 
    transform: scale(1); 
  }
  70% { 
    opacity: 0.7; 
    transform: scale(1.2); 
  }
  100% { 
    opacity: 0; 
    transform: scale(1.5); 
  }
}

@keyframes glow {
  0% { opacity: 0; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(1.5); }
}

.football.scoring {
  /* Keep original animation for carrying ball to end zone */
  animation: floatBall 2s ease-in-out infinite;
  transition: all 2s cubic-bezier(0.36, 0, 0.66, -0.56);
}

 /* ================== Footballs ================== */
.football.team1 {
    left: 10%;
    top: 25%;
    z-index: 300;
  }
  
  .football.team2 {
    right: 10%;
    bottom: 25%;
    z-index: 300;
  }

  /* ================== Options Section ================== */
  .options-section {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
  }

  .options-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    max-width: 800px;
    width: 100%;
    padding: 0 20px;
    justify-content: center;
  }

  .options-section.left .options-container {
    justify-content: flex-start;
  }

  .options-section.right .options-container {
    justify-content: flex-end;
  }

  .option-button {
    padding: 12px 20px;
    background: linear-gradient(145deg, var(--secondary-color), var(--primary-color));
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 4px 6px var(--shadow-color);
    outline: none;
    min-width: 80px;
    text-align: center;
    font-weight: 700;
  }

  .option-button:hover,
  .option-button:focus {
    background: linear-gradient(145deg, var(--button-hover-color), #43A047);
    transform: translateY(-3px);
  }

  .option-button.correct {
    background: linear-gradient(145deg, var(--success-color), var(--primary-color));
    transform: scale(1.05);
    box-shadow: 0 6px 10px rgba(0,0,0,0.5);
    animation: correctAnswer 0.5s ease-in-out;
  }

  .option-button.incorrect {
    background: linear-gradient(145deg, var(--error-color), #D32F2F);
    transform: scale(1.05);
    box-shadow: 0 6px 10px rgba(0,0,0,0.5);
    animation: incorrectAnswer 0.5s ease-in-out;
  }

  /* ================== Quarter End Popup Styles ================== */
  .quarter-end-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1001;
    justify-content: center;
    align-items: center;
  }

  .quarter-content {
    background: linear-gradient(135deg, #1a4d2e, #2e5d3f);
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    color: white;
    text-align: center;
    border: 3px solid #4CAF50;
  }

  #quarter-title {
    font-size: 2.5em;
    margin-bottom: 20px;
    text-transform: uppercase;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .quarter-stats {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    margin: 30px 0;
    gap: 20px;
  }

  .team-stats {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
  }

  .quarter-content .team-stats h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #FFD700;
  }

  .stat-row {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    font-size: 1.1em;
  }

  .quarter-content .stat-label {
    color: rgba(255, 255, 255, 0.8);
  }

  .quarter-content .stat-value {
    font-weight: bold;
    font-size: 1.2em;
    color: #FFFFFF;
  }

  /* Ensure all text in quarter-content is visible with white color */
  .quarter-content {
    color: #FFFFFF;
  }

  .quarter-content h2 {
    color: #FFD700;
  }

  .vs-divider {
    font-size: 2em;
    font-weight: bold;
    color: #FFD700;
    align-self: center;
  }

  .quarter-message {
    font-size: 1.4em;
    margin: 20px 0;
    color: #FFD700;
  }

  .next-quarter-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.3em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
  }

  .next-quarter-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.6);
    background: linear-gradient(135deg, #45a049, #4CAF50);
  }

  /* ================== winner popup ================== */

  #winner-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, .8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1100;
    padding: 20px;
  }


.winner-content {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  padding: 24px;
  max-width: 480px;
  width: 90%;
  max-height: 85vh;
  height: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  font-family: var(--font-secondary);
  animation: fadeInScale 0.5s forwards;
}

.winner-header {
  text-align: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.winner-title {
  font-size: 1.8em;
  color: #4caf50;
  margin: 8px 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, .1);
}

.trophy-icon {
  font-size: 2.2em;
  animation: bounce 1s infinite alternate;
}

@keyframes bounce {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0);
  }
}

#winner-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid #4caf50;
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 20px rgba(76, 175, 80, .5);
  margin: 0 auto;
}

.winner-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 4px;
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.85em;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: #4caf50;
  color: white;
  box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.tab-btn:hover:not(.active) {
  background: #e8e8e8;
  color: #333;
}

.tab-content {
  flex: 1;
  overflow-y: hidden;
}

.tab-pane {
  display: none;
}

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

.stats-grid {
  display: grid;
  gap: 8px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 3px solid #4caf50;
}

.winner-content .team-stats h3 {
  text-align: center;
  color: #4caf50;
  margin-bottom: 12px;
  font-size: 1.2em;
}

.team-stat-grid {
  display: grid;
  gap: 8px;
}

.team-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #f8f9fa;
  border-radius: 4px;
}

.winner-content .stat-label {
  font-weight: 600;
  color: #555;
  font-size: 0.9em;
}

.winner-content .stat-value {
  font-weight: 700;
  color: #2e7d32;
  font-size: 1.1em;
}

.winner-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-shrink: 0;
}

.play-again-btn, .answers-btn {
  flex: 1;
  padding: 12px;
  font-size: 1em;
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  font-weight: 700;
}

.play-again-btn {
  background: linear-gradient(145deg, var(--secondary-color), var(--primary-color));
}

.answers-btn {
  background: linear-gradient(145deg, #2196F3, #1976D2);
}

.play-again-btn:hover {
  background: linear-gradient(145deg, var(--button-hover-color), #43A047);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.answers-btn:hover {
  background: linear-gradient(145deg, #1976D2, #1565C0);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(33, 150, 243, 0.3);
}

/* ================== Answers Popup ================== */
.answers-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, .8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1200;
  padding: 20px;
}

.answers-content {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  font-family: var(--font-secondary);
  animation: fadeInScale 0.5s forwards;
}

.answers-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 12px;
}

.answers-header h2 {
  color: #2e7d32;
  font-size: 1.6em;
  margin: 0;
}

.close-answers-btn {
  background: #f44336;
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.close-answers-btn:hover {
  background: #d32f2f;
  transform: scale(1.1);
}

.answers-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 4px;
}

.answer-tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.9em;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
}

.answer-tab-btn.active {
  background: #2e7d32;
  color: white;
  box-shadow: 0 2px 4px rgba(46, 125, 50, 0.3);
}

.answer-tab-btn:hover:not(.active) {
  background: #e8e8e8;
  color: #333;
}

.answer-tab-pane {
  display: none;
}

.answer-tab-pane.active {
  display: block;
}

.answers-tab-content h3 {
  color: #2e7d32;
  text-align: center;
  margin-bottom: 16px;
  font-size: 1.3em;
}

.answers-list {
  max-height: 400px;
  overflow-y: auto;
}

.answer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 8px;
  border-left: 4px solid;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.answer-item:hover {
  transform: translateX(4px);
}

.answer-item.correct {
  background: #f1f8e9;
  border-left-color: #4caf50;
}

.answer-item.incorrect {
  background: #ffebee;
  border-left-color: #f44336;
}

.answer-question {
  font-weight: 600;
  color: #333;
  flex: 1;
}

.answer-response {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.answer-response.correct {
  color: #2e7d32;
}

.answer-response.incorrect {
  color: #c62828;
}

.answer-icon {
  font-size: 1.2em;
}

.correct .answer-icon::before {
  content: "✓";
}

.incorrect .answer-icon::before {
  content: "✗";
}

.answer-details {
  font-size: 0.85em;
  color: #666;
  margin-top: 4px;
}

/* ================== Animations ================== */

@keyframes popupShake {
  0% { transform: translate(-50%, -50%) scale(1); }
  25% { transform: translate(-52%, -48%) scale(1.02); }
  50% { transform: translate(-48%, -52%) scale(0.98); }
  75% { transform: translate(-51%, -49%) scale(1.01); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

/* ================== Burger Menu ================== */
.burger-menu {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: linear-gradient(145deg, var(--secondary-color), var(--primary-color));
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.burger-line {
  width: 20px;
  height: 2px;
  background-color: white;
  transition: transform 0.3s ease;
}

.burger-menu.active .burger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.burger-menu.active .burger-line:nth-child(2) {
  opacity: 0;
}

.burger-menu.active .burger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Tables checkbox grid styles */
.tables-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin: 20px 0;
}

@media (max-width: 600px) {
  .tables-checkbox-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 400px) {
  .tables-checkbox-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.table-checkbox {
  position: relative;
  cursor: pointer;
}

.table-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
}

.table-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: #f8f9fa;
  font-weight: bold;
  font-size: 18px;
  transition: all 0.3s ease;
}

.table-checkbox input[type="checkbox"]:checked + .table-box {
  background: #4CAF50;
  color: white;
  border-color: #45a049;
  transform: scale(1.05);
}

.table-checkbox:hover .table-box {
  border-color: #4CAF50;
  transform: scale(1.05);
}

.tables-selection-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.select-btn {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: #f8f9fa;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.select-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.multiplier-range {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}

.multiplier-range input {
  padding: 5px 10px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  text-align: center;
}

/* Control Buttons Menu */
.control-buttons {
  position: fixed;
  top: 70px; /* Position below burger menu */
  right: -100px; /* Start off-screen */
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: right 0.3s ease;
  z-index: 999;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.control-buttons.expanded {
  right: 20px; /* Slide in when expanded */
}

  /* ================== Responsive Design ================== */
  @media (max-width: 1200px) {
    .field-container {
      height: 340px;
    }

    .option-button {
      min-width: 70px;
    }

    .main-container {
      margin-top: 40px;
    }

    .options-section {
      margin-bottom: 50px;
    }
  }

  @media (max-width: 1024px) {
    .field-container {
      height: 280px;
    }
  }

  @media (max-width: 768px) {
    .field-container {
      width: 100%;
      height: 250px;
    }

    .football {
      width: 50px;
      height: 25px;
    }

    .goalpost {
      width: 50px;
      height: 12px;
    }

    .team-score-container span {
      font-size: 3.5em;
    }

    /* Adjustments for touch-friendly buttons */
    .option-button {
      padding: 15px 25px;
      font-size: 1.1em;
      min-width: 100px;
    }

    .main-container {
      margin-top: 40px;
    }

    .options-section {
      margin-bottom: 50px;
    }

    /* Removed as field-overlay is no longer present */

    .question-text {
      font-size: 1.5em; /* Adjusted font size for smaller screens */
    }

    .timer, .question-number {
      font-size: 1.2em; /* Adjusted font size for smaller screens */
    }
  }

  @media (max-width: 480px) {
    .field-container {
      width: 100%;
      height: 200px;
    }

    .option-button {
      padding: 10px 15px;
      font-size: 0.9em;
      min-width: 60px;
    }

    .header {
      flex-direction: column;
      align-items: flex-start;
      padding: 15px 20px; /* Adjusted padding for smaller screens */
    }

    .header .timer {
      margin-bottom: 10px;
      font-size: 1.3em; /* Slightly reduced font size for very small screens */
    }

    .header .timer img {
      width: 25px; /* Reduced icon size for smaller screens */
      height: 25px;
    }

    .header .question-text {
      font-size: 1.5em; /* Reduced font size */
    }

    .header .question-number {
      font-size: 1.3em; /* Reduced font size */
    }

    /* Quarter popup mobile styles */
    .quarter-content {
      padding: 20px;
    }

    #quarter-title {
      font-size: 1.8em;
    }

    .quarter-stats {
      flex-direction: column;
    }

    .vs-divider {
      margin: 15px 0;
    }

    .team-stats {
      width: 100%;
    }

    .question-display {
      margin-bottom: 30px; /* Adjusted margin */
    }

    .feedback {
      font-size: 1.2em; /* Further increased for very small screens */
    }

    .main-container {
      margin-top: 50px;
    }

    .options-section {
      margin-bottom: 60px;
    }

    .message {
      padding: 20px 40px;
      font-size: 1.5em;
    }

    .message button {
      padding: 10px 20px;
      font-size: 1em;
    }
  }

  /* ================== Tablet Responsive (481px - 768px) ================== */
  @media (min-width: 481px) and (max-width: 768px) {
    .timer, .question-number {
      padding: 6px 15px;
      font-size: 1.2em;
      min-width: 100px;
    }

    /* Setup form tablet adjustments */
    .setup-form {
      width: 90%;
      margin: 10px auto;
      max-height: 90vh;
    }

    .setup-header {
      padding: 18px;
    }

    .step-content {
      padding: 25px;
    }

    .number-inputs-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 15px;
    }

    .duration-cards {
      gap: 15px;
    }

    .teams-container {
      gap: 30px;
    }

    .progress-container {
      padding: 20px 25px;
    }
  }

  /* ================== Enhanced Button Focus States ================== */
  button:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
  }

  /* ================== Pause Overlay ================== */
  .pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 950;
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease;
    opacity: 0;
  }

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

  .pause-message {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    animation: pausePopup 0.5s ease forwards;
  }

  @keyframes pausePopup {
    0% {
      transform: scale(0.9);
      opacity: 0;
    }
    100% {
      transform: scale(1);
      opacity: 1;
    }
  }

  .pause-message .pause-icon {
    font-size: 3em;
    color: var(--accent-color);
    margin-bottom: 20px;
    animation: pulse 2s infinite;
  }

  @keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
  }

  .pause-message p {
    font-size: 2.5em;
    margin-bottom: 30px;
    color: #fff;
    font-family: var(--font-secondary);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  }

  .pause-message button {
    padding: 15px 40px;
    font-size: 1.2em;
    background: linear-gradient(145deg, var(--accent-color), #FFC107);
    border: none;
    border-radius: 30px;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }

  .pause-message button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(145deg, #FFC107, var(--accent-color));
  }

  .pause-message button:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  }

  /* Media Queries for Pause Overlay */
  @media (max-width: 768px) {
    .pause-message {
      padding: 30px;
      width: 90%;
      max-width: 400px;
    }

    .pause-message p {
      font-size: 2em;
    }

    .pause-message button {
      padding: 12px 30px;
      font-size: 1.1em;
    }
  }

  /* ================== Confetti Styles ================== */
.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: var(--accent-color);
  opacity: 0.8;
  border-radius: 50%;
  pointer-events: none;
  z-index: 600; /* Ensure confetti is above all other elements */
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

  /* ================== Responsive Enhancements ================== */
  @media (max-width: 768px) {
    .header-buttons {
      flex-direction: column;
      gap: 10px;
    }

    .header-buttons button {
      width: 100%;
    }

    .field-container {
      height: 200px;
    }

    .team-score {
      font-size: 2em;
    }

    .team-score span {
      font-size: 2.5em;
    }
  }

  /* ================== Enhanced Responsive Design ================== */
@media (max-width: 1200px) {
  .field-container {
    height: 450px;
    min-width: unset;
  }

  .header {
    padding: 15px 20px;
    gap: 10px;
  }

  .header .question-text {
    font-size: 1.2em;
  }
}

@media (max-width: 992px) {
  .field-container {
    height: 380px;
  }

  .team-score span {
    font-size: 2em;
  }

  .options-container {
    gap: 10px;
  }

  .option-button {
    padding: 10px 15px;
    font-size: 0.9em;
  }
}

@media (max-width: 768px) {
  .header {
    flex-wrap: wrap;
    justify-content: center;
  }

  .header > * {
    flex: 0 0 auto;
  }

  .header .question-text {
    flex: 0 0 100%;
    order: -1;
    margin-bottom: 10px;
  }

  .field-container {
    height: 320px;
  }

  .football {
    width: 35px;
    height: 25px;
  }

  .team-images-container {
    flex-direction: column;
  }

  .winner-content {
    padding: 30px;
    font-size: 1.2em;
  }

  #winner-image {
    width: 150px;
    height: 150px;
  }
}

@media (max-width: 576px) {
  .setup-form {
    padding: 20px;
    width: 95%;
  }

  .field-container {
    height: 200px;
  }

  .options-container {
    gap: 8px;
  }

  .option-button {
    padding: 8px 12px;
    font-size: 0.85em;
    min-width: 60px;
  }

  .control-buttons {
    gap: 10px;
  }

  .control-buttons button {
    width: 25px;
    height: 25px;
  }

  .control-buttons button img {
    width: 12px;
    height: 12px;
  }

  .team-score {
    font-size: 1.8em;
  }

  .winner-content {
    padding: 20px;
    font-size: 1em;
  }

  #winner-image {
    width: 120px;
    height: 120px;
  }

  .trophy-icon {
    font-size: 3em;
  }
}

/* ================== Touch Device Optimizations ================== */
@media (hover: none) {
  .option-button {
    padding: 15px 20px; /* Larger touch targets */
  }

  .control-buttons button {
    width: 40px; /* Larger touch targets */
    height: 40px;
  }

  .control-buttons button img {
    width: 20px;
    height: 20px;
  }

  .buttons button {
    padding: 15px 30px;
  }
}

/* ================== Landscape Mode Optimizations ================== */
@media (max-height: 600px) and (orientation: landscape) {
  .field-container {
    height: 230px;
  }

  .header {
    padding: 10px;
  }

  .options-section {
    margin-bottom: 20px;
  }

  body {
    padding: 10px 0 80px 0;
  }

  .winner-popup {
    overflow-y: auto;
  }

  .winner-content {
    transform: none;
    margin: 20px auto;
  }
}

/* ================== Winner Popup Responsive ================== */
@media (max-width: 768px) {
  .winner-content {
    max-width: 95%;
    padding: 20px;
    max-height: 90vh;
  }

  .winner-tabs {
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
  }

  .tab-btn {
    padding: 8px 10px;
    font-size: 0.8em;
  }

  .winner-title {
    font-size: 1.6em;
    margin: 6px 0;
  }

  .trophy-icon {
    font-size: 2em;
  }

  #winner-image {
    width: 70px;
    height: 70px;
  }

  .winner-header {
    margin-bottom: 12px;
  }
}

@media (max-width: 576px) {
  .winner-content {
    max-width: 98%;
    padding: 16px;
    max-height: 95vh;
  }

  .winner-title {
    font-size: 1.4em;
    margin: 4px 0;
  }

  .trophy-icon {
    font-size: 1.8em;
  }

  #winner-image {
    width: 60px;
    height: 60px;
  }

  .stats-grid, .team-stat-grid {
    gap: 6px;
  }

  .stat-item, .team-stat {
    padding: 6px 8px;
    font-size: 0.85em;
  }

  .winner-content .team-stats h3 {
    font-size: 1.1em;
    margin-bottom: 8px;
  }

  .winner-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .play-again-btn, .answers-btn {
    padding: 10px;
    font-size: 0.9em;
  }

  .winner-header {
    margin-bottom: 8px;
  }

  /* Answers popup responsive */
  .answers-content {
    max-width: 95%;
    padding: 16px;
    max-height: 90vh;
  }

  .answers-header h2 {
    font-size: 1.3em;
  }

  .answer-item {
    padding: 8px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .answer-response {
    align-self: flex-end;
  }
}
