* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    height: 100vh;
    width: 100vw;
}

.screen {
    display: none;
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1000;
}

.screen.active {
    display: flex !important;
    flex-direction: column;
    z-index: 1000 !important;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 20px,
        transparent 40px
    );
    pointer-events: none;
    z-index: 0;
}

/* Game Selection Screen */
.game-selection-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 20px;
    position: relative;
}

.selection-title {
    font-size: 56px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 50px;
    text-shadow: 0 4px 12px rgba(0,0,0,0.3);
    letter-spacing: 1px;
    z-index: 1;
}

.game-cards {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 900px;
    z-index: 1;
}

.game-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 35px 25px;
    min-width: 280px;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.game-card:active {
    transform: translateY(-4px);
}

.game-card-icon {
    font-size: 90px;
    margin-bottom: 5px;
    z-index: 1;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
    transition: all 0.3s ease;
}

.game-card:hover .game-card-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.2));
}

.game-card-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    z-index: 1;
    letter-spacing: 0.5px;
}

.game-card-description {
    font-size: 16px;
    font-weight: 500;
    color: #7f8c8d;
    text-align: center;
    z-index: 1;
}

.game-selection-logout {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Login Screen */
#login-screen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.login-container {
    width: 90%;
    max-width: 400px;
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 2;
}

.login-container .form-group {
    margin-bottom: 20px;
}

.login-container input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.login-container input:focus {
    outline: none;
    border-color: #667eea;
}

/* Home Screen */
#home-screen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.bayi-name-display {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: bold;
    color: #667eea;
    z-index: 100;
    font-size: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    pointer-events: none;
    max-width: 85%;
    display: none;
    text-align: center;
    line-height: 1.3;
    white-space: normal !important;
    word-wrap: break-word;
    overflow: visible;
}

#game-screen .bayi-name-display {
    display: block !important;
}

#home-screen .bayi-name-display,
#category-screen .bayi-name-display {
    display: none !important;
}

.top-icons {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 180px;
}

.icon-btn {
    width: 50px;
    height: 50px;
    background: #fff9c4;
    border: 2px solid #f9a825;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.icon-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.icon-btn:active {
    transform: scale(0.95);
}

.icon-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10000;
    pointer-events: none;
}

.logout-btn {
    background: #ff6b6b !important;
    border-color: #e74c3c !important;
}

.logout-btn svg {
    stroke: white !important;
}

.logout-btn:hover {
    background: #ee5a5a !important;
    transform: scale(1.05);
}

.logout-btn:active {
    transform: scale(0.9);
}

.icon-btn img {
    width: 24px;
    height: 24px;
}

.main-logo {
    text-align: center;
    z-index: 2;
    margin-bottom: 60px;
}

.app-logo {
    width: 150px;
    height: 150px;
    margin-bottom: 30px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.logo-text {
    font-size: 48px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

.logo-subtext {
    font-size: 28px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.start-button {
    background: #00897b;
    border: none;
    color: #fff9c4;
    font-size: 24px;
    font-weight: bold;
    padding: 20px 60px;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 2;
    transition: all 0.3s;
}

.start-button:active {
    transform: scale(0.95);
}

.contributors-button {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    font-size: 18px;
    font-weight: bold;
    padding: 15px 30px;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 2;
    transition: all 0.3s;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contributors-button:active {
    transform: scale(0.95);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: slideIn 0.3s;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
}

.modal-close:hover {
    opacity: 0.8;
}

.contributors-image {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        transform: scale(0.8);
        opacity: 0;
    }
    to { 
        transform: scale(1);
        opacity: 1;
    }
}

/* Category Screen */
#category-screen {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    padding-top: 120px;
    padding-bottom: 40px;
    position: relative;
    height: 100vh;
}

#category-screen .top-icons {
    position: fixed;
    left: auto;
    right: 20px;
    top: 20px;
}

#category-screen .icon-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: none;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 900px;
    margin: 0 auto 20px;
    padding-top: 30px;
    padding-bottom: 30px;
}

.category-card {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    border-radius: 15px;
    padding: 20px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.category-card:not(.locked):active {
    transform: scale(0.95);
}

.category-card.locked {
    background: linear-gradient(135deg, #9e9e9e, #757575);
    cursor: not-allowed;
    opacity: 0.7;
    filter: grayscale(100%);
}

.category-card:not(.locked):hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.category-number {
    font-size: 32px;
    font-weight: bold;
    color: #fff9c4;
    margin-bottom: 8px;
}

.category-name {
    font-size: 14px;
    font-weight: bold;
    color: #fff9c4;
}

.lock-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 28px;
    opacity: 0.9;
    z-index: 10;
    background: rgba(0, 0, 0, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Game Screen */
#game-screen {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
}

#game-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    pointer-events: none;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 10px;
    min-height: auto;
    z-index: 102;
    position: relative;
    background: transparent;
    flex-shrink: 0;
    gap: 8px;
    flex-wrap: wrap;
}

.control-icons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    position: relative;
    z-index: 101;
}

.control-icons .icon-btn {
    background: white;
    border: 2px solid #9e9e9e;
}

.game-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    z-index: 101;
    position: relative;
    width: 100%;
    max-width: 200px;
}

#game-bayi-name {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 auto 10px auto !important;
    transform: none !important;
    display: block !important;
    z-index: 103 !important;
    text-align: center !important;
    width: auto;
    max-width: calc(100% - 20px);
    overflow: visible !important;
    white-space: normal !important;
    word-wrap: break-word;
    align-self: center !important;
    font-size: 24px;
    padding: 10px 20px;
    border-radius: 20px;
    line-height: 1.3;
}

.question-indicator {
    font-size: 18px;
    font-weight: bold;
    color: #2e7d32;
    text-align: center;
    margin-top: -10px;
}

.progress-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 8px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    position: relative;
    z-index: 102;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.progress-circle svg {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 60px;
    height: 60px;
    transform: rotate(-90deg);
}

.progress-circle svg circle {
    fill: none;
    stroke-width: 8;
}

.progress-circle svg .progress-track {
    stroke: #e0e0e0;
}

.progress-circle svg .progress-bar {
    stroke: #4CAF50;
    stroke-dasharray: 163.36;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s linear;
}

.progress-text {
    font-size: 24px;
    font-weight: bold;
    color: #2e7d32;
    z-index: 1;
}

.lives {
    display: flex;
    gap: 5px;
    position: relative;
    z-index: 102;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.heart {
    font-size: 22px;
}

.heart.lost {
    opacity: 0.3;
}

.question-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    padding-top: 20px;
    padding-bottom: 5px;
    z-index: 100;
    position: relative;
    margin-top: 0;
    width: 100%;
}

#question-area {
    width: 90%;
    max-width: 600px;
    min-height: 200px;
    background: #1976d2;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 101;
}

.question-text {
    font-size: 72px;
    font-weight: bold;
    color: white;
}

.question-kankalar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 20px;
}

.kankalar-box {
    width: 150px;
    height: 120px;
    background: white;
    border: 3px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    font-weight: bold;
    color: #000;
    border-radius: 15px;
}

.kankalar-text {
    font-size: 48px;
    font-weight: bold;
    color: #ffffff;
    padding: 0 15px;
    text-align: center;
}

.kankalar-plus {
    font-size: 72px;
    font-weight: bold;
    color: #000;
}

.question-decomposition {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.decomposition-right {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    margin-left: 40px;
    position: relative;
}

.decomposition-circle.top-circle::before,
.decomposition-circle.bottom-circle::before {
    content: '';
    position: absolute;
    left: -45px;
    width: 40px;
    height: 2px;
    background: #000;
}

.decomposition-circle.top-circle::before {
    top: 50%;
    transform: translateY(-50%) rotate(-30deg);
    transform-origin: right center;
}

.decomposition-circle.bottom-circle::before {
    bottom: 50%;
    transform: translateY(50%) rotate(30deg);
    transform-origin: right center;
}

.decomposition-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    color: #000;
    position: relative;
}

.decomposition-circle.center-large {
    width: 150px;
    height: 150px;
    font-size: 72px;
}

.decomposition-line {
    width: 60px;
    height: 3px;
    background: #000;
}

.answers-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 10px 20px;
    padding-bottom: 20px;
    max-width: 600px;
    margin: 0 auto;
    width: 90%;
    z-index: 100;
    position: relative;
}

.answer-btn {
    background: #2196f3;
    border: none;
    border-radius: 15px;
    padding: 30px;
    font-size: 48px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 101;
}

.answer-btn:active {
    transform: scale(0.95);
}

.answer-btn.correct {
    background: #4CAF50;
}

.answer-btn.incorrect {
    background: #f44336;
}

.score-display {
    padding: 15px 20px;
    text-align: center;
    z-index: 100;
    position: relative;
    flex-shrink: 0;
}

.score-text {
    font-size: 48px;
    font-weight: bold;
    color: #ff9800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    z-index: 101;
}

.floating-score {
    animation: floatUp 1s ease-out forwards;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-50px);
    }
}

/* Win/Lose Screens */
#win-screen {
    background: #a5d6a7;
    justify-content: center;
    align-items: center;
    position: relative;
}

#win-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><circle cx="50" cy="50" r="20" fill="none" stroke="%23000" stroke-width="2"/><path d="M30 50 L45 65 L70 35" fill="none" stroke="%23000" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-repeat: repeat;
    opacity: 0.1;
}

#lose-screen {
    background: #f44336;
    justify-content: center;
    align-items: center;
    position: relative;
}

#lose-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><circle cx="50" cy="50" r="20" fill="none" stroke="%23fff" stroke-width="2"/><line x1="40" y1="40" x2="60" y2="60" stroke="%23fff" stroke-width="4" stroke-linecap="round"/><line x1="60" y1="40" x2="40" y2="60" stroke="%23fff" stroke-width="4" stroke-linecap="round"/></svg>');
    background-repeat: repeat;
    opacity: 0.1;
}

.result-container {
    text-align: center;
    z-index: 2;
}

.result-title {
    font-size: 64px;
    font-weight: bold;
    margin-bottom: 30px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
}

.result-title.win {
    color: #2196f3;
    -webkit-text-stroke: 2px white;
}

.result-title.lose {
    color: white;
    -webkit-text-stroke: 2px #2196f3;
}

.result-score,
.result-record {
    font-size: 48px;
    font-weight: bold;
    margin: 15px 0;
    color: #ff9800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.result-buttons {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 2;
}

.result-buttons .icon-btn {
    width: 60px;
    height: 60px;
    background: white;
    border: 3px solid #ffc107;
    border-radius: 12px;
}

.result-buttons .icon-btn:last-child {
    border-color: #ff9800;
}

/* Responsive Design */

@media (max-width: 360px) {
    .logo-text {
        font-size: 24px;
    }

    .logo-subtext {
        font-size: 16px;
    }

    .start-button {
        padding: 12px 30px;
        font-size: 16px;
    }

    #category-screen {
        padding-top: 110px;
        padding-bottom: 50px;
    }
    
    #category-screen .top-icons {
        right: 10px;
        top: 15px;
    }
    
    #category-screen .icon-btn {
        width: 40px;
        height: 40px;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 10px;
        padding-top: 20px;
        padding-bottom: 40px;
        margin: 0 auto 20px;
    }

    .category-card {
        padding: 10px 5px;
        min-height: 70px;
    }

    .category-number {
        font-size: 20px;
    }

    .category-name {
        font-size: 10px;
        line-height: 1.2;
    }

    .game-header {
        padding: 8px 6px;
        min-height: auto;
        gap: 6px;
    }

    .control-icons {
        gap: 4px;
    }

    .icon-btn {
        width: 36px;
        height: 36px;
        padding: 4px;
    }

    .icon-btn svg {
        width: 18px;
        height: 18px;
    }

    .game-status {
        max-width: 120px;
        gap: 4px;
    }

    .progress-circle {
        width: 40px;
        height: 40px;
    }

    .progress-circle svg {
        width: 40px;
        height: 40px;
    }

    .progress-text {
        font-size: 14px;
    }

    .lives {
        padding: 2px 4px;
        gap: 2px;
    }

    .heart {
        font-size: 14px;
    }

    #game-bayi-name {
        font-size: 14px !important;
        padding: 6px 12px !important;
        margin-bottom: 5px !important;
        max-width: calc(100% - 10px) !important;
        border-radius: 14px;
        line-height: 1.2;
        white-space: normal !important;
        overflow: visible !important;
    }

    .question-container {
        padding: 8px;
        padding-top: 15px;
    }

    #question-area {
        min-height: 120px;
        padding: 12px;
    }

    .question-text {
        font-size: 28px;
        line-height: 1.3;
    }

    .decomposition-circle {
        width: 50px;
        height: 50px;
        font-size: 24px;
        margin: 0 10px;
    }

    .kankalar-box {
        width: 100px;
        height: 80px;
        font-size: 48px;
    }
    
    .kankalar-text {
        font-size: 32px;
        padding: 0 10px;
    }

    .answers-container {
        gap: 8px;
        padding: 8px;
    }

    .answer-btn {
        font-size: 20px;
        padding: 12px 8px;
        border-radius: 10px;
        min-height: 50px;
    }

    .score-text {
        font-size: 32px;
    }

    .result-title {
        font-size: 32px;
    }

    .result-score,
    .result-record {
        font-size: 24px;
    }
}

@media (min-width: 361px) and (max-width: 414px) {
    .game-header {
        padding: 10px 8px;
        min-height: auto;
        gap: 8px;
    }

    .icon-btn {
        width: 38px;
        height: 38px;
    }

    .icon-btn svg {
        width: 20px;
        height: 20px;
    }

    .progress-circle {
        width: 42px;
        height: 42px;
    }

    .progress-circle svg {
        width: 42px;
        height: 42px;
    }

    .progress-text {
        font-size: 16px;
    }

    .heart {
        font-size: 16px;
    }

    #game-bayi-name {
        font-size: 16px !important;
        padding: 7px 14px !important;
        margin-bottom: 8px !important;
        max-width: calc(100% - 16px) !important;
    }

    .question-text {
        font-size: 32px;
    }

    .answer-btn {
        font-size: 22px;
        padding: 14px 10px;
    }
}

@media (min-width: 415px) and (max-width: 480px) {
    .game-header {
        padding: 12px 10px;
        min-height: auto;
    }

    #game-bayi-name {
        font-size: 18px !important;
        padding: 8px 16px !important;
        max-width: calc(100% - 20px) !important;
    }

    .question-text {
        font-size: 36px;
    }

    .answer-btn {
        font-size: 24px;
        padding: 16px 12px;
    }
}

@media (min-width: 428px) and (max-width: 480px) {
    #game-bayi-name {
        font-size: 20px !important;
    }
    
    .question-text {
        font-size: 38px;
    }
}

@media (min-width: 430px) and (max-width: 480px) {
    #game-bayi-name {
        font-size: 22px !important;
    }
    
    .question-text {
        font-size: 40px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    #category-screen {
        padding-top: 120px;
        padding-bottom: 50px;
    }
    
    #category-screen .top-icons {
        right: 15px;
        top: 20px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        margin: 0 auto 20px;
        padding-top: 30px;
        padding-bottom: 40px;
    }

    .category-card {
        padding: 20px 10px;
        min-height: 100px;
    }

    .category-number {
        font-size: 32px;
    }

    .category-name {
        font-size: 14px;
    }

    .game-header {
        padding: 20px;
        min-height: 130px;
    }

    .question-text {
        font-size: 56px;
    }

    .answer-btn {
        font-size: 40px;
        padding: 25px;
    }

    .decomposition-circle {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }

    .kankalar-box {
        width: 140px;
        height: 110px;
        font-size: 64px;
    }
    
    .kankalar-text {
        font-size: 42px;
        padding: 0 12px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    #category-screen {
        padding-top: 120px;
        padding-bottom: 50px;
    }
    
    #category-screen .top-icons {
        right: 20px;
        top: 20px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        margin: 0 auto 20px;
        padding-top: 30px;
        padding-bottom: 40px;
    }

    .category-card {
        padding: 25px 15px;
        min-height: 120px;
    }

    .question-text {
        font-size: 64px;
    }

    .answer-btn {
        font-size: 48px;
        padding: 30px;
    }

    .decomposition-circle {
        width: 90px;
        height: 90px;
        font-size: 44px;
    }
}

@media (min-width: 1025px) {
    #category-screen {
        padding-top: 120px;
        padding-bottom: 50px;
    }
    
    #category-screen .top-icons {
        right: 20px;
        top: 20px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1200px;
        margin: 0 auto;
        padding-top: 30px;
        padding-bottom: 40px;
    }

    .category-card {
        padding: 30px 20px;
        min-height: 140px;
    }

    .question-text {
        font-size: 72px;
    }

    .answer-btn {
        font-size: 52px;
        padding: 35px;
    }
}

@media (max-width: 768px) {
    #category-screen {
        padding-top: 110px;
        padding-bottom: 50px;
    }
    
    #category-screen .top-icons {
        right: 10px;
        top: 15px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        margin: 0 auto 20px;
        padding-top: 20px;
        padding-bottom: 40px;
    }

    .logo-text {
        font-size: 36px;
    }

    .logo-subtext {
        font-size: 22px;
    }

    .question-text {
        font-size: 48px;
    }

    .decomposition-circle {
        width: 70px;
        height: 70px;
        font-size: 36px;
    }

    .answer-btn {
        font-size: 36px;
        padding: 20px;
    }

    .result-title {
        font-size: 48px;
    }

    .result-score,
    .result-record {
        font-size: 36px;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    .game-header {
        padding: 10px;
        min-height: 80px;
    }

    .question-container {
        padding-top: 20px;
    }

    #question-area {
        min-height: 120px;
    }

    .question-text {
        font-size: 36px;
    }

    .answers-container {
        padding: 10px;
        gap: 10px;
    }

    .answer-btn {
        font-size: 28px;
        padding: 15px;
    }

    .score-display {
        padding: 10px;
    }

    .score-text {
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding-bottom: 40px;
    }

    .category-card {
        padding: 15px 5px;
    }

    .category-number {
        font-size: 24px;
    }

    .category-name {
        font-size: 12px;
    }

    .game-header {
        padding: 12px;
        flex-wrap: nowrap;
        gap: 8px;
        min-height: 105px;
    }

    .game-status {
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }

    #game-bayi-name {
        font-size: 32px;
        padding: 12px 22px;
        margin-bottom: 8px;
    }

    .progress-circle {
        width: 48px;
        height: 48px;
    }

    .progress-circle svg {
        width: 48px;
        height: 48px;
    }

    .progress-text {
        font-size: 18px;
    }

    .lives {
        padding: 3px 8px;
    }

    .heart {
        font-size: 20px;
    }

    .question-container {
        padding: 15px;
        padding-top: 35px;
    }

    #question-area {
        min-height: 140px;
        padding: 15px;
    }

    .answers-container {
        padding: 15px;
        gap: 12px;
    }

    .answer-btn {
        font-size: 26px;
        padding: 16px;
    }

    .score-display {
        padding: 12px;
    }

    .logo-text {
        font-size: 28px;
    }

    .logo-subtext {
        font-size: 18px;
    }

    .question-text {
        font-size: 36px;
    }

    .decomposition-circle {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    .kankalar-box {
        width: 110px;
        height: 90px;
        font-size: 52px;
    }
    
    .kankalar-text {
        font-size: 36px;
        padding: 0 10px;
    }
    
    .selection-title {
        font-size: 36px;
        margin-bottom: 35px;
        letter-spacing: 0.5px;
    }
    
    .game-cards {
        flex-direction: column;
        gap: 20px;
        width: 100%;
        max-width: 340px;
    }
    
    .game-card {
        min-width: 100%;
        padding: 28px 20px;
        border-radius: 20px;
    }
    
    .game-card-icon {
        font-size: 70px;
    }
    
    .game-card-title {
        font-size: 22px;
    }
    
    .game-card-description {
        font-size: 14px;
    }
    
    .game-selection-logout {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .selection-title {
        font-size: 48px;
        margin-bottom: 45px;
    }
    
    .game-card {
        min-width: 260px;
        padding: 32px 24px;
    }
    
    .game-card-icon {
        font-size: 80px;
    }
    
    .game-card-title {
        font-size: 26px;
    }
}

@media (min-width: 1025px) {
    #game-screen {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .game-header {
        padding: 10px 15px;
        min-height: auto;
        max-height: 100px;
        flex-wrap: nowrap;
        gap: 10px;
    }
    
    .control-icons {
        gap: 8px;
    }
    
    .icon-btn {
        width: 42px;
        height: 42px;
        padding: 6px;
    }
    
    .icon-btn svg {
        width: 22px;
        height: 22px;
    }
    
    .game-status {
        gap: 6px;
        max-width: 150px;
    }
    
    .progress-circle {
        width: 50px;
        height: 50px;
    }
    
    .progress-circle svg {
        width: 50px;
        height: 50px;
    }
    
    .progress-text {
        font-size: 14px;
    }
    
    .lives {
        gap: 4px;
    }
    
    .heart {
        width: 24px;
        height: 24px;
    }
    
    #game-bayi-name {
        font-size: 20px !important;
        padding: 8px 16px !important;
        max-width: 300px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .question-container {
        padding: 10px 20px;
        padding-top: 15px;
        padding-bottom: 10px;
        max-width: 100%;
        overflow: hidden;
    }
    
    #question-area {
        width: 100%;
        max-width: 700px;
        min-height: 180px;
        padding: 20px;
        margin: 0 auto;
    }
    
    .question-text {
        font-size: 48px;
        line-height: 1.2;
    }
    
    .decomposition-circle {
        width: 70px;
        height: 70px;
        font-size: 36px;
        margin: 0 8px;
    }
    
    .kankalar-box {
        width: 120px;
        height: 100px;
        font-size: 56px;
    }
    
    .kankalar-text {
        font-size: 38px;
        padding: 0 10px;
    }
    
    .answers-container {
        max-width: 700px;
        margin: 0 auto;
        padding: 15px 20px;
        padding-bottom: 20px;
        gap: 12px;
        width: 100%;
    }
    
    .answer-btn {
        font-size: 36px;
        padding: 20px;
        border-radius: 12px;
        min-height: 80px;
    }
    
    .score-display {
        padding: 8px 15px;
    }
    
    .score-text {
        font-size: 32px;
    }
    
    .bayi-name-display {
        font-size: 18px !important;
        padding: 6px 14px !important;
        max-width: 280px !important;
    }
    
    #category-screen {
        padding-top: 100px;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .categories-grid {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
        padding-bottom: 40px;
    }
    
    #home-screen {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .home-content {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
    }
    
    .game-selection-container {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .game-selection-content {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
    }
    
    .result-container {
        max-width: 800px;
        margin: 0 auto;
        padding: 20px;
    }
    
    .result-title {
        font-size: 48px;
    }
    
    .result-score,
    .result-record {
        font-size: 32px;
    }
    
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    * {
        box-sizing: border-box;
    }
}