* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #193fea 0%, #5e3acc 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.Navbar {
    width: 100%;
	position: fixed;
	top: 0;
    z-index: 1000;
}

.Navbar ul {
	list-style-type: none;
	margin: 0;
	padding: 0;
	overflow: hidden;
	background-color: #353535;
}

.Navbar li {
	float: left;
}

.Navbar li a {
	display: block;
	color: white;
	text-align: center;
	padding: 14px 16px;
	text-decoration: none;
}

.Navbar li a:hover:not(.active) {
	background-color: #111111;
    
}


.main-container {
    width: 100%;
    padding: 20px;
}

.auth-wrapper {
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 500px;
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header img.logo {
    width: 120px;
    height: 120px;
    margin-bottom: 1rem;
    border-radius: 20px;
    object-fit: contain;
}

.auth-header h1 {
    font-size: 2rem;
    color: #2f3542;
    margin: 1rem 0;
}

@media (max-width: 768px) {
    .auth-container {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 1.5rem;
    }

    .auth-header img.logo {
        width: 100px;
        height: 100px;
    }

    .auth-header h1 {
        font-size: 1.8rem;
    }
}

.auth-container {
    background: white;
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background: none;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #667eea;
    border-bottom: 2px solid #667eea;
}

.form-container {
    transition: all 0.3s;
}

.hidden {
    display: none;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group input {
    width: 100%;
    padding: 10px 0;
    border: none;
    border-bottom: 2px solid #ddd;
    outline: none;
    font-size: 1rem;
    transition: all 0.3s;
}

.input-group label {
    position: absolute;
    top: 10px;
    left: 0;
    font-size: 1rem;
    color: #999;
    transition: all 0.3s;
    pointer-events: none;
}

.input-group input:focus + label,
.input-group input:valid + label {
    top: -20px;
    font-size: 0.8rem;
    color: #667eea;
}

.input-group input:focus {
    border-bottom-color: #667eea;
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 5px;
    background: #667eea;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.submit-btn:hover {
    background: #764ba2;
}

h2 {
    color: #333;
    margin-bottom: 2rem;
    text-align: center;
}

.quiz-container {
    -ms-overflow-style: none; 
    scrollbar-width: none; 
    background: white;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.quiz-container::-webkit-scrollbar {
    display: none;
  }

.sign-image {
    max-width: 300px;
    margin: 20px auto;
    display: block;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.options {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

.option-btn {
    padding: 1rem;
    border: 2px solid #eee;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    text-align: left;
}

.option-btn:hover:not(:disabled) {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.score-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.score, .high-score {
    font-size: 1.2rem;
    color: #667eea;
}

.feedback {
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    border-radius: 5px;
    font-weight: 500;
}

.feedback.correct {
    background: #d4edda;
    color: #155724;
}

.feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.quiz-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.quiz-container {
    background: white;
    width: 90%;
    max-width: 900px;
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    padding: 2rem;
}

.header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    padding: 8px 15px;
    border-radius: 5px;
    background: #ff4757;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #ff6b81;
}

.score-panel {
    text-align: center;
}

.timer {
    text-align: right;
    font-size: 1.2rem;
    font-weight: 500;
    color: #2f3542;
}

.question-container {
    text-align: center;
    margin-bottom: 30px;
}

.sign-image {
    max-width: 250px;
    margin: 0 auto 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.sign-image:hover {
    transform: scale(1.05);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.option-btn {
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.option-btn:hover:not(:disabled) {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
}

.option-btn.correct {
    background: #2ecc71;
    color: white;
    border-color: #2ecc71;
}

.option-btn.incorrect {
    background: #ff4757;
    color: white;
    border-color: #ff4757;
}

.feedback-container {
    text-align: center;
    margin-top: 20px;
}

.next-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    background: #667eea;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
}

.next-btn:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

.hidden {
    display: none;
}

.menu-wrapper {
    width: 100%;
    min-height: 100vh;
    padding: 20px;
}

.menu-container {
    -ms-overflow-style: none; 
    scrollbar-width: none; 
    background: white;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.menu-container::-webkit-scrollbar {
    display: none;
}

.menu-content {
    text-align: center;
	margin: 10px;
}

.menu-content h1 {
    font-size: 2.5rem;
    color: #2f3542;
    margin-bottom: 2rem;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 300px;
    margin: 0 auto;
}

.menu-btn {
    padding: 1rem;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    background: #667eea;
    color: white;
}

.menu-btn.start-btn {
    background: #2ecc71;
}

.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.leaderboard {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #eee;
}

.leaderboard h2 {
    color: #2f3542;
    margin-bottom: 1rem;
}

.leaderboard-grid {
    display: grid;
    gap: 0.5rem;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    background: #f8f9ff;
    border-radius: 8px;
    transition: all 0.3s;
}

.leaderboard-row:hover {
    background: #eef1ff;
}

.rank {
    font-weight: 600;
    color: #667eea;
}

.score {
    font-weight: 500;
}

@media (max-width: 768px) {
    .menu-container, .quiz-container {
        width: 95%;
        padding: 1.5rem;
    }

    .menu-content h1 {
        font-size: 2rem;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .header {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .user-info {
        justify-content: center;
    }

    .timer {
        text-align: center;
    }

    .sign-image {
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .menu-content h1 {
        font-size: 1.5rem;
    }

    .menu-btn {
        padding: 0.8rem;
        font-size: 1rem;
    }

    .leaderboard-row {
        font-size: 0.9rem;
        padding: 0.6rem;
    }
}

@media (max-width: 1024px) {
    .quiz-container, .menu-container {
        width: 95%;
        max-width: 700px;
    }
}

@media (max-width: 768px) {
    .menu-container, .quiz-container, .auth-container {
        width: 90%;
        padding: 1.5rem;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .header {
        grid-template-columns: 1fr;
        gap: 15px;
        text-align: center;
    }

    .user-info, .score-panel {
        justify-content: center;
        width: 100%;
    }

    .timer {
        text-align: center;
    }

    .sign-image {
        max-width: 200px;
    }

    .menu-content h1 {
        font-size: 1.8rem;
    }

    .leaderboard-row {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .main-container, .quiz-wrapper, .menu-wrapper {
        padding: 10px;
    }

    .auth-container, .quiz-container, .menu-container {
        padding: 1rem;
    }

    .menu-content h1 {
        font-size: 1.5rem;
    }

    .tab-btn {
        padding: 0.8rem 0.5rem;
        font-size: 0.9rem;
    }

    .input-group {
        margin-bottom: 1.2rem;
    }

    .input-group input {
        font-size: 0.9rem;
    }

    .input-group label {
        font-size: 0.9rem;
    }

    .submit-btn, .menu-btn, .next-btn {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .option-btn {
        padding: 12px;
        font-size: 0.9rem;
    }

    .sign-image {
        max-width: 180px;
    }

    .score, .high-score {
        font-size: 1rem;
    }

    .timer {
        font-size: 1rem;
    }

    .feedback {
        font-size: 0.9rem;
        padding: 8px;
    }

    .logout-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .leaderboard-row {
        grid-template-columns: auto 1fr auto;
        gap: 0.5rem;
        padding: 0.6rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 320px) {
    .menu-content h1 {
        font-size: 1.2rem;
    }

    .sign-image {
        max-width: 150px;
    }

    .option-btn {
        padding: 10px;
        font-size: 0.8rem;
    }
}

@supports (padding: max(0px)) {
    .main-container, .quiz-wrapper, .menu-wrapper {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
}

@media (max-width: 768px) {
    .quiz-container, .menu-container {
        width: 100%;
        padding: 1rem;
        border-radius: 0;
        min-height: 100vh;
    }

    .sign-image {
        max-width: 80%;
        height: auto;
        margin: 1.5rem auto;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.5rem;
    }

    .option-btn {
        padding: 1.2rem;
        font-size: 1.1rem;
        text-align: center;
        min-height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .timer {
        font-size: 1.5rem;
        font-weight: 600;
        background: #f8f9ff;
        padding: 0.8rem;
        border-radius: 10px;
        margin: 1rem 0;
    }

    .score, .high-score {
        font-size: 1.3rem;
        padding: 0.5rem;
    }

    .feedback {
        font-size: 1.2rem;
        padding: 1rem;
        margin: 1rem 0;
    }

    .next-btn {
        width: 100%;
        padding: 1rem;
        font-size: 1.2rem;
        margin-top: 1rem;
    }

    .header {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .user-info {
        flex-direction: column;
        gap: 0.8rem;
        font-size: 1.2rem;
    }

    .logout-btn {
        width: 100%;
        padding: 0.8rem;
        font-size: 1.1rem;
        text-align: center;
    }

    .menu-content h1 {
        font-size: 2rem;
        padding: 1rem;
    }

    .menu-buttons {
        width: 100%;
        max-width: none;
        padding: 0 1rem;
    }

    .menu-btn {
        padding: 1.2rem;
        font-size: 1.3rem;
    }

    .leaderboard-row {
        padding: 1rem;
        font-size: 1.1rem;
        margin: 0.5rem 0;
    }
}

@media (max-width: 380px) {
    body {
        font-size: 16px;
    }

    .option-btn {
        padding: 1.5rem 1rem;
        font-size: 1.2rem;
        line-height: 1.4;
    }

    .sign-image {
        max-width: 90%;
    }

    .timer {
        font-size: 1.8rem;
    }

    .score, .high-score {
        font-size: 1.4rem;
    }

    .menu-content h1 {
        font-size: 1.8rem;
    }
}

@supports (padding: max(0px)) {
    .quiz-container, .menu-container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.dark-mode .menu-container,
.dark-mode .quiz-container,
.dark-mode .auth-container {
    background: #1f2937;
    color: #e5e7eb;
}

.dark-mode h1,
.dark-mode h2,
.dark-mode .menu-content h1 {
    color: #e5e7eb;
}

.dark-mode .menu-btn {
    background: #374151;
}

.dark-mode .menu-btn:hover {
    background: #4b5563;
}

.dark-mode .menu-btn.start-btn {
    background: #065f46;
}

.dark-mode .menu-btn.start-btn:hover {
    background: #047857;
}

.dark-mode .stat-item {
    background: #374151;
    color: #e5e7eb;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #667eea;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9ff;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.stat-item i {
    font-size: 1.5rem;
    color: #667eea;
}

.menu-wrapper, .quiz-wrapper {
    position: fixed;
    top: 10%;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.menu-container, .quiz-container {
    max-height: 100%;
    overflow-y: auto;
    position: relative;
	max-width: 70vh;
}

.panel {
    max-height: 60vh;
    overflow-y: auto;
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    .menu-container, .quiz-container {
        min-height: auto;
        height: auto;
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }

    .panel {
        max-height: 50vh;
    }

    .menu-buttons {
        margin-bottom: 2rem;
    }
}

.quiz-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    height: calc(100vh - 120px);
    overflow: hidden;
}

.sign-image {
    max-height: 35vh;
    width: auto;
    object-fit: contain;
    margin: 0 auto;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 10px;
    max-height: 45vh;
}

.option-btn {
    min-height: 60px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1rem;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .quiz-content {
        height: calc(100vh - 150px);
    }

    .sign-image {
        max-height: 30vh;
    }

    .options-grid {
        grid-template-columns: 1fr;
        max-height: 50vh;
    }

    .option-btn {
        min-height: 50px;
        font-size: 0.9rem;
    }
}

.quiz-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    padding: 0.5rem;
    margin: 0;
    border-radius: 0;
}

.quiz-header {
    padding: 0.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.quiz-stats {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.quiz-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
}

.sign-image {
    max-height: 25vh;
    width: auto;
    object-fit: contain;
    margin: 0 auto;
}

.options-container {
    width: 100%;
    max-width: 600px;
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 1rem;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin: 0 auto;
}

.option-btn {
    width: 100%;
    min-height: 44px;
    padding: 0.75rem;
    font-size: 0.9rem;
    text-align: center;
    border: 2px solid #eee;
    border-radius: 8px;
    background: white;
    transition: all 0.2s;
}

.timer {
    position: fixed;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
}

.score-panel {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    font-size: 0.8rem;
}

@media (min-width: 768px) {
    .options-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .option-btn {
        min-height: 60px;
        font-size: 1rem;
    }

    .timer, .score-panel {
        font-size: 1rem;
    }
}

.quiz-footer {
    padding: 0.5rem;
}

/* Dark mode updates */
.dark-mode .quiz-container {
    background: #1f2937;
    color: #e5e7eb;
}

.dark-mode .option-btn {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

.dark-mode .option-btn:hover:not(:disabled) {
    background: #4b5563;
    border-color: #667eea;
}

.dark-mode .feedback {
    background: #374151;
}

.dark-mode .feedback.correct {
    background: #065f46;
    color: #e5e7eb;
}

.dark-mode .feedback.incorrect {
    background: #7f1d1d;
    color: #e5e7eb;
}

.dark-mode .leaderboard-row {
    background: #374151;
    color: #e5e7eb;
}

.dark-mode .leaderboard-row:hover {
    background: #4b5563;
}

.dark-mode .leaderboard-content .no-data {
    color: #e5e7eb;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f8f9ff;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.setting-item label {
    font-weight: 500;
    color: #2f3542;
}

.setting-item input[type="number"] {
    width: 80px;
    padding: 0.5rem;
    border: 2px solid #eee;
    border-radius: 6px;
    font-size: 1rem;
    text-align: center;
    transition: all 0.3s;
}

.setting-item input[type="number"]:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.dark-mode .setting-item {
    background: #374151;
}

.dark-mode .setting-item label {
    color: #e5e7eb;
}

.dark-mode .setting-item input[type="number"] {
    background: #1f2937;
    border-color: #4b5563;
    color: #e5e7eb;
}

.dark-mode .setting-item input[type="number"]:focus {
    border-color: #667eea;
}
