/* Import the custom font */
@font-face {
    font-family: "League Spartan";
    src: url("../assets/fonts/LeagueSpartan-VariableFont_wght.woff2") format("woff2-variations");
    font-weight: 100 900;
    font-stretch: 100%;
    font-style: normal;
    font-display: swap;
    }
      
    /* Reset & full-viewport sizing */
    html, body {
        margin: 0;
        padding: 0;
        width: 100%;
        height: 100%;
      }
      
      /* Dynamically set the root font size so that 1rem scales to fit a 16:10 layout */
      html {
      font-size: 16px;
      font-size: calc(min(100vw / 80, 100vh / 50));
      overflow: hidden;
      }
      
      /* Center container in viewport */
      body {
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #ffffff;
        font-family: "League Spartan", sans-serif;
        font-weight: 400;
        overflow: hidden;
      }
      
      .container {
        width: 80rem;
        height: 50rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        position: relative;
      }
    /* Game Background */
    body {
        background-image: url('background.svg');
        background-size: cover;
        background-repeat: no-repeat;
        background-position: center;
    }
    main {
      height: 50rem;
      font-size: 1.2rem;
      /*padding-top: 2rem;*/
    }
    
    /* Game Area */
    .game-area {
        width: 80rem;
        height: 50rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        position: relative;
    }
    
    /* Roulette Container */
    .roulette-container {
        width: 50rem; /* Increased by 50% from 30rem */
        height: 48rem; /* Increased by 50% from 30rem */
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-bottom: -5rem; /* Move wheel up further to make room for questions over the button */
    }
    
    /* Roulette Wheel */
    .roulette-wheel {
        width: 100%;
        height: 100%;
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .wheel-img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        transform-origin: center center;
    }
    
    /* Animation for wheel spinning */
    @keyframes spin {
        from {
            transform: rotate(0deg);
        }
        to {
            transform: rotate(calc(1080deg + var(--final-rotation, 0deg)));
        }
    }
    .wheel-img.spinning {
        animation: spin 6s cubic-bezier(0.32, 0.04, 0.15, 0.95) forwards;
    }
    
    /* Start Button */
    .start-button {
        position: absolute;
        width: 10.5rem; /* Increased by 50% from 7rem */
        height: 10.5rem; /* Increased by 50% from 7rem */
        border: none;
        background: transparent;
        cursor: pointer;
        z-index: 5; /* Reduced z-index so questions can appear over it */
        padding: 0;
        top: 47%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .start-button:disabled {
        cursor: not-allowed;
        opacity: 0.7;
    }
    
    .start-img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    /* Question Container */
    .question-container {
        width: 50rem;
        height: 40rem;
        padding: 2rem;
        background-color: rgba(255, 255, 255, 0.95);
        border-radius: 1rem;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
        transition: transform 0.5s ease, opacity 0.5s ease;
        opacity: 0;
        transform: translateY(4rem);
        margin-top: -41rem;
        position: relative;
        visibility: hidden;
        pointer-events: none;
        z-index: 10;
    }
    
    .question-container.show {
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
        pointer-events: auto;
        transition: opacity 0.7s ease, transform 0.7s ease;
    }
    .question-container:not(.show){
        opacity: 0;
        transform: translateY(4rem);
        pointer-events: none;
    }
    /* Fade out option items when question container is not visible */
    .option-item, #check_button {
        transition: opacity 1.5s ease, transform 1.5s ease;
    }
    
    .question-container:not(.show) .option-item,
    .question-container:not(.show) #check_button {
        opacity: 0;
        transform: translateY(4rem);
        pointer-events: none;
    }
    .question {
        margin-bottom: 2rem;
    }
    
    .question-category {
        font-size: 1.8rem;
        color: #00699F;
        margin-bottom: 1rem;
        font-weight: bold;
        text-align: center;
    }
    
    .question-text {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
        line-height: 1.5;
        text-align: center;
    }
    .question-container #check_button {
        cursor: pointer ;
        display: inline-block;
        width: 8rem;
        height: 4rem;
        background: url("../assets/images/checkBtn.svg") center/contain no-repeat;
        text-decoration: none;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        margin:0 auto;
      }
    /* Options */
    .options-container {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .option-item {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1rem 1.5rem;
        border-radius: 0.75rem;
        border: 0.2rem solid #00699F;
        background-color: white;
        cursor: pointer;
        transition: all 0.2s ease;
        font-size: 1.3rem;
    }
    
    .option-item:hover {
        background-color: #f0f6ff;
        transform: translateY(-0.2rem);
    }
    
    .option-item.selected {
        background-color: #00699F;
        color: white;
    }
    
    .option-item.correct {
        border-color: #258174;
        border-width: 0.25rem;
    }
    
    .option-item.incorrect {
        border-color: #FF0000;
        border-width: 0.25rem;
    }
    
    .option-item.selected.correct {
        background-color: #258174;
    }
    
    .option-item.selected.incorrect {
        background-color: #FF0000;
    }
    
    /* Game Stats */
    .game-stats {
        width: 45rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        /*background-color: #ef496e;*/
        color: white;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        /*height: 4rem;*/
        margin: 0 auto;
    }
    
    .question-counter {
        flex: 1;
        text-align: center;
        font-weight: bold;
        font-size: 1.8rem;
        padding: 1rem;
        background-color: #ef496e;
    }
    
    .score-container {
        flex: 1;
        text-align: center;
        font-weight: bold;
        font-size: 1.8rem;
        padding: 1rem;
        background-color: #75c8ae;
    }
    
    /* Game Summary */
    .game-summary {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 40rem;
        padding: 3rem;
        background-color: white;
        border-radius: 1rem;
        box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.2);
        text-align: center;
        z-index: 100;
    }
    
    .game-summary h2 {
        font-size: 2.5rem;
        color: #00699F;
        margin-bottom: 1.5rem;
    }
    
    .game-summary p {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }
    
    .restart-button {
        padding: 1rem 2rem;
        font-size: 1.5rem;
        background-color: #00699F;
        color: white;
        border: none;
        border-radius: 0.5rem;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }
    
    .restart-button:hover {
        background-color: #005080;
    }
    