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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, Helvetica, sans-serif;
    background: #f5f0eb;
    color: #1a1a1a;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 440px;
    width: 100%;
    text-align: center;
}

.message {
    font-size: 22px;
    font-weight: 400;
    color: #1a1a1a;
    line-height: 1.5;
    margin-bottom: 40px;
    letter-spacing: -0.01em;
}

.landing {
    padding: 80px 0;
}

.launch-btn {
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: rgba(26, 20, 15, 0.4);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
    animation: breathe 3s ease-in-out infinite;
}

.launch-btn:hover {
    color: #1a1a1a;
}

@keyframes breathe {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.game-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
    padding: 0 4px;
}

.score {
    font-size: 13px;
    font-weight: 500;
    color: rgba(26, 20, 15, 0.38);
    letter-spacing: 0.02em;
}

canvas {
    display: block;
    width: 100%;
    max-width: 400px;
    height: auto;
    aspect-ratio: 1;
    background: #ede8e2;
    border: 1px solid rgba(26, 20, 15, 0.1);
    border-radius: 6px;
    margin: 0 auto;
}

.game-wrapper {
    position: relative;
    margin-bottom: 32px;
}

.leaderboard {
    text-align: left;
    border: 1px solid rgba(26, 20, 15, 0.1);
    border-radius: 8px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.45);
}

.leaderboard h2 {
    font-size: 11px;
    font-weight: 500;
    color: rgba(26, 20, 15, 0.38);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 9px 0;
    border-bottom: 1px solid rgba(26, 20, 15, 0.06);
    font-size: 14px;
}

.leaderboard-entry:last-child {
    border-bottom: none;
}

.leaderboard-entry .rank {
    color: rgba(26, 20, 15, 0.28);
    width: 24px;
    font-size: 12px;
}

.leaderboard-entry .name {
    flex: 1;
    color: #1a1a1a;
    font-weight: 500;
}

.leaderboard-entry .entry-score {
    color: #1a1a1a;
    font-weight: 400;
    margin-left: 16px;
}

.leaderboard-entry .date {
    color: rgba(26, 20, 15, 0.28);
    font-size: 11px;
    margin-left: 12px;
}

.empty-board {
    font-size: 13px;
    color: rgba(26, 20, 15, 0.35);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(245, 240, 235, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal {
    text-align: center;
    padding: 40px;
    max-width: 340px;
    width: 100%;
    border: 1px solid rgba(26, 20, 15, 0.12);
    border-radius: 16px;
    background: #f5f0eb;
    box-shadow: 0 8px 48px rgba(26, 20, 15, 0.08);
}

.modal h2 {
    font-size: 18px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.final-score {
    font-size: 13px;
    color: rgba(26, 20, 15, 0.42);
    margin-bottom: 28px;
    font-weight: 400;
}

.modal-form {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.modal-form input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid rgba(26, 20, 15, 0.15);
    border-radius: 8px;
    font-size: 14px;
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, Helvetica, sans-serif;
    font-weight: 400;
    outline: none;
    background: rgba(255, 255, 255, 0.7);
    color: #1a1a1a;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.modal-form input::placeholder {
    color: rgba(26, 20, 15, 0.28);
}

.modal-form input:focus {
    border-color: rgba(26, 20, 15, 0.38);
    background: white;
}

.modal-form button {
    padding: 10px 18px;
    background: #1a1a1a;
    color: #f5f0eb;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, Helvetica, sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s ease;
    white-space: nowrap;
}

.modal-form button:hover {
    opacity: 0.75;
}

.skip-save {
    background: none;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, Helvetica, sans-serif;
    font-weight: 400;
    color: rgba(26, 20, 15, 0.32);
    cursor: pointer;
    transition: color 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.skip-save:hover {
    color: rgba(26, 20, 15, 0.55);
}

@media (max-width: 480px) {
    body {
        padding: 40px 20px;
        overflow-y: auto;
    }

    .message {
        font-size: 17px;
        margin-bottom: 28px;
    }

    .landing {
        padding: 50px 0;
    }

    .launch-btn {
        font-size: 14px;
    }

    canvas {
        max-width: 100%;
    }

    .game-wrapper {
        margin-bottom: 24px;
    }

    .score {
        font-size: 12px;
    }

    .leaderboard {
        padding: 16px;
    }

    .leaderboard h2 {
        font-size: 10px;
    }

    .leaderboard-entry {
        font-size: 13px;
        padding: 8px 0;
    }

    .leaderboard-entry .date {
        font-size: 10px;
    }

    .modal {
        padding: 32px 24px;
        margin: 0 16px;
    }

    .modal h2 {
        font-size: 16px;
    }

    .final-score {
        font-size: 12px;
    }

    .modal-form {
        flex-direction: column;
    }

    .modal-form input {
        font-size: 16px;
    }

    .modal-form button {
        font-size: 14px;
        padding: 12px;
    }
}
