body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    background-image: url("images/background.png");
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 720px;
    padding: 0 20px;
}

.app-header {
    text-align: center;
    margin-bottom: 20px;
}

.app-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 12px;
}

.app-header h1 {
    font-size: 2.5rem;
    color: #3366FF;
    font-weight: bold;
    font-family: 'Arial', sans-serif;
    letter-spacing: 2px;
}


.quiz-setup {
    background: linear-gradient(135deg, #f5d0ff 0%, #b7ebff 100%);
    box-shadow: 0 8px 40px rgba(104, 101, 255, 0.13);
    padding: 40px 38px 30px 38px;
    border-radius: 22px;
    text-align: left;
    width: 95%;          
    max-width: none;       
    margin: 60px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    position: relative;
    animation: slideIn 0.5s;
}

@keyframes slideIn {
    0% { opacity: 0; transform: translateY(40px);}
    100% { opacity: 1; transform: translateY(0);}
}

.quiz-setup h2 {
    color: #2323a8;
    margin-bottom: 22px;
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    letter-spacing: 1px;
}

.input-group label {
    margin-bottom: 5px;
    font-weight: bold;
    color: #2323a8;
}

.input-group {
    display: block;
    width: 100%;
}

.input-group select, .input-group input {
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.95);
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(51, 102, 255, 0.08);
    margin-bottom: 12px;
    box-sizing: border-box;
    transition: box-shadow 0.2s;
}


.input-group select:focus, .input-group input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #a076f9;
    background: #fff;
}

.start-btn {
    width: 100%;
    background: linear-gradient(90deg, #27AE60 0%, #81FBB8 90%);
    color: white;
    border: none;
    padding: 12px 0;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s, transform 0.2s;
}

.start-btn:hover {
    background: linear-gradient(75deg, #3366FF 0%, #4481eb 100%);
    transform: translateY(-2px) scale(1.035);
    box-shadow: 0 3px 18px rgba(51, 102, 255, 0.11);
}

.hidden {
    display: none;
}

.quiz-container {
    background: linear-gradient(135deg, #f5d0ff 0%, #b7ebff 100%);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 95%;
    max-width: 700px;
    text-align: center;
}

#question-text {
    text-align: left;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.answer-buttons button {
    background-color: #F2EBFF;
    color: #333333;
    border: 1px solid #888888;
    padding: 10px;
    margin: 5px 0;
    width: 100%;
    text-align: left;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.answer-buttons button:hover {
    background-color: #D8C6FF;
}

.answer-buttons button.correct {
    background-color: #A8E6CF;
}

.answer-buttons button.incorrect {
    background-color: #FF8C94;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 20px;
    margin-top: 30px;
    box-sizing: border-box;
}

.status-box {
    background-color: #FFFFFF;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(221, 201, 255, 0.6);
    font-weight: bold;
    color: #3366FF;
    display: flex;
    align-items: center;
    justify-content: center;
}

.controls {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.next-btn {
    background-color: #3366FF;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.next-btn:hover {
    background-color: #1b51a2; /* Aqua hover */
}

.show-result-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.result-container {
    background: linear-gradient(135deg, #f5d0ff 0%, #b7ebff 100%);
    padding: 30px 40px;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(221, 201, 255, 0.6);
    max-width: 460px;
    margin: 50px auto;
    text-align: center;
    color: #3366FF;
    font-family: 'Arial', sans-serif;
}

#final-score {
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: bold;
}

.result-message {
    font-size: 1.25rem;
    margin-bottom: 30px;
    color: #666666;
}

.feedback {
    margin-top: 12px;
    font-style: italic;
    padding: 10px;
    background-color: #e6f0ff;
    color: #004a99;
    border-radius: 5px;
    text-align: center;
}

button:focus {
    outline: 3px solid #FF61A6;
    outline-offset: 2px;
}

@media (max-width: 480px) {
  .main-container,
  .quiz-setup,
  .quiz-container,
  .result-container,
  #leaderboard-container {
    max-width: 98vw;
    width: 100vw;
    padding: 8px;
    border-radius: 8px;
    margin: 0 auto;
    box-sizing: border-box;
  }
  .quiz-setup,
  .quiz-container,
  .result-container,
  #leaderboard-container {
    padding: 14px 8px;
  }
  .status-bar,
  .controls {
    flex-direction: column;
    align-items: stretch;
    padding: 6px 0;
  }
  .answer-buttons button,
  .next-btn,
  .show-result-btn,
  #login-btn,
  #close-leaderboard {
    font-size: 1rem;
    padding: 8px 0;
  }
}

.login-panel {
    background: linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%);
    box-shadow: 0 8px 24px rgba(136, 73, 255, 0.18);
    padding: 36px 32px 28px 32px;
    border-radius: 18px;
    text-align: center;
    max-width: 350px;
    margin: 60px auto 0 auto;
    transition: box-shadow 0.3s;
}

.login-panel h2 {
    color: #3366FF;
    margin-bottom: 22px;
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 1px;
}

#username-input {
    width: 80%;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.85);
    font-size: 1.1rem;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(51, 102, 255, 0.07);
    transition: box-shadow 0.2s;
}

#username-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #a076f9;
    background: #fff;
}

#login-btn {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, #3366FF 0%, #81FBB8 100%);
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s, transform 0.2s;
}

#login-btn:hover {
    background: linear-gradient(75deg, #27AE60 40%, #4481eb 90%);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 3px 14px rgba(39, 174, 96, 0.16);
}

#leaderboard-container {
    background: linear-gradient(135deg, #f5d0ff 0%, #b7ebff 100%);
    padding: 20px 30px;
    border-radius: 15px;
    max-width: 430px;
    min-width: 360px;
    margin: 20px auto;
    background-position: center;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(136, 136, 255, 0.3);
    color: #3366FF;
    font-family: Arial, sans-serif;
}

#leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    
}

#leaderboard-table td {
    font-size: 1.08rem;
    padding: 10px 8px;
    color: #172447;
    background: rgba(255,255,255,0.8);
    border-bottom: 1px solid #e9e9f5;
    text-align: center;
}

#leaderboard-table th {
    background: linear-gradient(90deg, #e7efff 0%, #c7fafe 100%);
    border-radius: 10px 10px 0 0;
    border-bottom: 2px solid #c7ebff;
    text-align: center;
    padding: 10px;
}

#close-leaderboard {
    background-color: #3366FF;
    color: white;
    border: none;
    padding: 8px 25px;
    border-radius: 8px;
    cursor: pointer;
}

#close-leaderboard:hover {
    background-color: #81FBB8;
}
  
.leaderboard-table-wrapper {
    max-height: 400px;
    overflow-y: auto;
    display: block;
}
