:root {
    --bg-color: #fdfaf3;
    --dot-color: #fcebbb;
    --container-bg: #ffffff;
    --container-border: #faeed7;
    --text-main: #333333;
    --text-sub: #666666;
    --card-border: #eedcff;
    --btn-bg: linear-gradient(135deg, #b97aff 0%, #994cff 100%);
    --btn-hover: linear-gradient(135deg, #a960fb 0%, #8327ff 100%);
    --shadow: 0 8px 24px rgba(153, 76, 255, 0.12);
    --banner-bg: #fffcd3;
    --banner-text: #594d21;
}

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

body {
    font-family: 'M PLUS Rounded 1c', "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
    color: var(--text-main);
    background-color: var(--bg-color);
    position: relative;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Polka dot background */
.background-dots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: radial-gradient(var(--dot-color) 2px, transparent 2px);
    background-size: 32px 32px;
}

.main-container {
    background-color: var(--container-bg);
    border: 4px solid var(--container-border);
    border-radius: 24px;
    padding: 40px;
    max-width: 1000px;
    width: 100%;
    box-shadow: 0 12px 36px rgba(0,0,0,0.03);
}

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

.furigana {
    font-size: 14px;
    color: var(--text-sub);
    letter-spacing: 0.8em;
    margin-bottom: 4px;
    font-weight: 700;
}

.main-title {
    font-size: 42px;
    font-weight: 800;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.star-icon {
    font-size: 36px;
    filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.4));
}

.heart-icon {
    font-size: 36px;
    filter: drop-shadow(0 2px 4px rgba(255, 105, 180, 0.4));
}

.title-text {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    letter-spacing: 2px;
}

.title-blue { color: #358dff; }
.title-red { color: #ff5252; }
.title-green { color: #3ad468; }
.title-brown { color: #b76c3e; }
.title-orange { color: #ff9100; }
.title-purple { color: #51425e; }

.instruction-banner {
    display: inline-block;
    background-color: var(--banner-bg);
    color: var(--banner-text);
    padding: 12px 36px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    margin: 0 auto 40px;
    left: 50%;
    position: relative;
    transform: translateX(-50%);
    box-shadow: 0 4px 12px rgba(255, 235, 150, 0.4);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    justify-content: center;
}

.app-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-main);
    background: #ffffff;
    border: 3px solid var(--card-border);
    border-radius: 20px;
    padding: 30px 20px 24px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.app-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow);
    border-color: #d8bbff;
}

.card-emoji {
    font-size: 64px;
    margin-bottom: 20px;
    line-height: 1;
    display: flex;
    gap: 8px;
}

.card-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 12px;
    text-align: center;
}

.card-desc {
    font-size: 14px;
    color: var(--text-sub);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 24px;
    flex-grow: 1;
    font-weight: 700;
}

.card-btn {
    background: var(--btn-bg);
    color: white;
    font-weight: 800;
    font-size: 18px;
    padding: 14px 40px;
    border-radius: 50px;
    transition: all 0.2s;
    width: 100%;
    text-align: center;
    max-width: 220px;
    box-shadow: 0 4px 12px rgba(153, 76, 255, 0.3);
}

.app-card:hover .card-btn {
    background: var(--btn-hover);
    transform: scale(1.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-container {
        padding: 24px 16px;
        border-width: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }
    body { padding: 0; }
    
    .app-header { margin-bottom: 16px; margin-top: 10px; }
    
    .main-title {
        font-size: 28px;
        gap: 6px;
    }
    
    .star-icon, .heart-icon {
        font-size: 24px;
    }
    
    .furigana {
        font-size: 12px;
        letter-spacing: 0.5em;
    }
    
    .instruction-banner {
        font-size: 15px;
        padding: 10px 24px;
        margin-bottom: 24px;
        width: 90%;
        text-align: center;
    }
    
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
    
    .app-card {
        padding: 24px 16px 20px;
        background: white; /* restore white bg for cards on mobile */
    }
    
    .card-emoji { font-size: 52px; margin-bottom: 16px;}
    .card-title { font-size: 20px; }
    .card-btn { font-size: 16px; padding: 12px 30px; }
}
