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

body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 229, 143, 0.25) 0%, rgba(255, 229, 143, 0) 40%),
        linear-gradient(160deg, #355c42 0%, #274b35 45%, #1a2f22 100%);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 24px 0;
}

#page {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

#quick-links {
    width: min(900px, calc(100vw - 32px));
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    order: 1;
}

#quick-links a {
    background: rgba(255, 255, 255, 0.9);
    color: #2f593f;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(47, 89, 63, 0.22);
}

#quick-links a:hover {
    background: #ffffff;
}

#game-container {
    position: relative;
    max-width: 500px;
    max-height: 600px;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    order: 2;
}

#gameCanvas {
    border: 4px solid #e9f7ea;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: #83c5be;
    display: block;
}

.screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    min-width: 280px;
    width: min(92vw, 420px);
    z-index: 10;
}

.screen.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

.screen h1,
.screen h2 {
    color: #2f593f;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.screen h1 {
    font-size: 42px;
}

.screen h2 {
    font-size: 34px;
}

.screen p {
    color: #555;
    font-size: 18px;
    margin-bottom: 15px;
}

.features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(47, 89, 63, 0.1);
    border-radius: 15px;
}

.features p {
    font-size: 16px;
    margin: 5px 0;
    color: #2f593f;
    font-weight: 600;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.speed-control {
    margin-top: 14px;
    margin-bottom: 6px;
    text-align: left;
    padding: 10px 12px;
    background: rgba(47, 89, 63, 0.1);
    border-radius: 10px;
}

.speed-control label {
    display: block;
    font-weight: 700;
    color: #2f593f;
    margin-bottom: 8px;
    font-size: 15px;
}

.speed-control input[type="range"] {
    width: 100%;
    accent-color: #2f593f;
}

.speed-control-restart {
    margin-top: 8px;
    margin-bottom: 12px;
}

.screen button {
    background: linear-gradient(135deg, #3c8d5a 0%, #2f593f 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: bold;
    width: 100%;
}

.primary-btn {
    background: linear-gradient(135deg, #3c8d5a 0%, #2f593f 100%);
    box-shadow: 0 4px 15px rgba(47, 89, 63, 0.45);
}

.secondary-btn {
    background: linear-gradient(135deg, #e9c46a 0%, #c08c1c 100%);
    box-shadow: 0 4px 15px rgba(192, 140, 28, 0.35);
}

.screen button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(47, 89, 63, 0.6);
}

.secondary-btn:hover {
    box-shadow: 0 6px 20px rgba(192, 140, 28, 0.5);
}

.screen button:active {
    transform: translateY(0);
}

.stats {
    font-size: 16px;
    color: #999;
    margin-top: 10px;
}

.tutorial-tips {
    background: rgba(47, 89, 63, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    font-size: 16px;
    line-height: 1.8;
    text-align: left;
}

#score-display {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 48px;
    font-weight: bold;
    color: white;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    z-index: 5;
    pointer-events: none;
}

#score-display.hidden {
    display: none;
}

#final-score {
    font-size: 24px;
    color: #2f593f;
    font-weight: bold;
    margin-bottom: 10px;
}

#high-score {
    font-size: 20px;
    color: #3c8d5a;
    font-weight: bold;
}

#share-btn {
    margin-bottom: 10px;
}

.share-options {
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(47, 89, 63, 0.1);
}

.resume-status {
    margin: 8px 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: #2f593f;
}

.share-title {
    font-size: 14px;
    font-weight: 700;
    color: #2f593f;
    margin-bottom: 8px;
}

.share-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.share-mini {
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 12px;
}

.sms-share-row {
    display: flex;
    gap: 8px;
}

#share-phone-input {
    flex: 1;
    border: 1px solid rgba(47, 89, 63, 0.35);
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
    outline: none;
}

#game-stats {
    font-size: 16px;
    color: #999;
    margin-top: 10px;
}

#seo-content {
    width: min(900px, calc(100vw - 32px));
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    color: #1f2937;
    line-height: 1.6;
    order: 3;
}

#seo-content h2 {
    font-size: 28px;
    color: #2f593f;
    margin-bottom: 10px;
}

#seo-content h1 {
    font-size: 34px;
    color: #2f593f;
    margin-bottom: 12px;
}

#seo-content h3 {
    font-size: 20px;
    color: #2f593f;
    margin-top: 14px;
    margin-bottom: 6px;
}

#seo-content p {
    margin-bottom: 10px;
}

#seo-content ul {
    margin-left: 22px;
    margin-bottom: 12px;
}

@media (max-width: 600px) {
    body {
        display: block;
        min-height: 100svh;
        padding: 0;
    }

    #page {
        gap: 14px;
    }

    .screen {
        padding: 30px 20px;
        min-width: 240px;
    }

    #game-container {
        order: 1;
        width: 100vw;
        height: 100svh;
        max-height: 100svh;
    }

    #quick-links {
        order: 2;
        margin-top: 6px;
        margin-bottom: 4px;
    }
    
    .screen h1 {
        font-size: 36px;
    }

    .screen h2 {
        font-size: 28px;
    }
    
    .screen p {
        font-size: 16px;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px;
    }
    
    .features p {
        font-size: 14px;
    }
    
    .screen button {
        padding: 12px 30px;
        font-size: 18px;
    }

    .speed-control {
        margin-top: 10px;
        padding: 8px 10px;
    }
    
    #score-display {
        font-size: 36px;
        top: 20px;
    }
    
    .tutorial-tips {
        font-size: 14px;
        padding: 12px;
    }

    #seo-content {
        width: calc(100vw - 18px);
        padding: 16px;
    }

    #seo-content h2 {
        font-size: 22px;
    }

    #seo-content h1 {
        font-size: 26px;
    }

    #seo-content h3 {
        font-size: 18px;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    #game-container {
        max-height: 100vh;
    }
    
    .screen {
        padding: 15px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .screen h1 {
        font-size: 28px;
        margin-bottom: 8px;
    }
    
    .screen p {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .features {
        margin: 10px 0;
        padding: 10px;
        gap: 5px;
    }
    
    .features p {
        font-size: 13px;
    }
    
    .button-group {
        gap: 8px;
        margin-top: 10px;
    }
    
    .screen button {
        padding: 8px 20px;
        font-size: 15px;
    }
    
    .tutorial-tips {
        font-size: 13px;
        padding: 10px;
        margin-top: 10px;
    }
}
