.home-hero {
    text-align: center;
    padding: 2.5rem 1rem 1.75rem;
    position: relative;
    z-index: 2;
    animation: fadeIn 0.8s ease-out;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    margin-bottom: 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-wrap: balance;
    color: var(--accent);
    background: var(--tint-accent-hover);
    border: 1px solid var(--tint-accent-strong);
    border-radius: 999px;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--text-light) 40%, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 26rem;
    margin: 0 auto 1.35rem;
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
}

.home-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-accent-soft);
    border-radius: 999px;
    background: var(--tint-accent);
    color: var(--accent);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.home-search-btn:hover {
    background: var(--tint-accent-emphasis);
    border-color: var(--border-accent);
}

.home-search-btn:active {
    transform: scale(0.98);
}

.home-hero-link {
    color: var(--link);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
}

.home-hero-link:visited {
    color: var(--link-visited);
}

.home-hero-link:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.welcome-kbd {
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: var(--surface-raised);
    border: 1px solid var(--surface-border);
    font-size: 0.8rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: var(--text-muted);
}

.hero-kbd-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .hero-kbd-hint {
        display: none;
    }

    .home-hero {
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
    }

    .home-search-btn {
        flex: 1 1 100%;
        justify-content: center;
        min-height: 2.75rem;
        border-radius: 0.625rem;
    }
}

html.is-pwa .home-snake {
    pointer-events: none !important;
    touch-action: none;
}

html.is-pwa .home-hero,
html.is-pwa .home-section {
    position: relative;
    z-index: 5;
}

html.is-pwa .home-search-btn,
html.is-pwa .home-category-btn {
    position: relative;
    z-index: 6;
    pointer-events: auto;
}

.home-section {
    position: relative;
    z-index: 2;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 0 1.5rem;
}

.home-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
    padding: 0 0.15rem;
}

.home-section-title {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 0;
}

.home-section-link,
.home-section-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
}

.home-section-link {
    color: var(--link);
    font-weight: 500;
}

.home-section-link:visited {
    color: var(--link-visited);
}

.home-section-link:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.home-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.home-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: border-color var(--transition), background var(--transition);
}

.home-chip i {
    color: var(--accent);
    font-size: 0.9rem;
}

.home-chip:hover {
    border-color: var(--border-accent-soft);
    background: var(--surface-raised);
}

.home-hubs {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.home-hub-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.home-hub-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 0.625rem;
    color: var(--text-light);
    text-decoration: none;
    transition: border-color var(--transition), background var(--transition);
}

.home-hub-card:hover {
    border-color: var(--border-accent-soft);
    background: var(--surface-raised);
}

.home-hub-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    background: var(--tint-accent);
    color: var(--accent);
    font-size: 0.95rem;
}

.home-hub-card-name {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
}

.home-game-card-icon {
    background: var(--tint-accent-2);
    color: var(--accent-2);
}

.home-game-card.is-done-today {
    border-color: var(--border-success-strong);
}

.home-game-card.is-done-today .home-game-card-icon {
    background: var(--tint-success-strong);
    color: var(--color-success);
}

.home-game-card.is-done-today::after {
    content: '✓';
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--color-success);
    background: var(--tint-success);
    border-radius: 50%;
}

.home-categories-hint {
    margin: 0 0 0.65rem;
    padding: 0 0.15rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.home-category-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--surface-border);
    border-radius: 0.625rem;
    overflow: hidden;
    background: var(--surface);
}

.home-category-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.8rem 0.95rem;
    border: none;
    border-bottom: 1px solid var(--surface-border);
    background: transparent;
    color: var(--text-light);
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.home-category-list li:last-child .home-category-btn {
    border-bottom: none;
}

.home-category-btn:hover,
.home-category-btn:active {
    background: var(--surface-raised);
}

.home-category-name {
    flex: 1;
}

.home-category-count {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 1.25rem;
    text-align: right;
}

.home-category-btn i {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.page-home .page-body {
    position: relative;
}

.home-snake {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: min(68vh, 620px);
    z-index: 1;
    pointer-events: none;
    opacity: 0.4;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 86%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 86%);
}

@media (max-width: 768px) {
    .home-snake {
        height: min(52vh, 400px);
        opacity: 0.26;
        -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 38%, transparent 92%);
        mask-image: linear-gradient(to bottom, #000 0%, #000 38%, transparent 92%);
    }
}

.home-snake canvas {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .home-snake {
        display: none;
    }
}

.day-emoji-unlock {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: none;
    background: transparent;
    z-index: 2;
    cursor: default;
}

.day-emoji {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    font-size: 1.5rem;
    opacity: 0.35;
    transition: opacity 0.3s ease;
    z-index: 2;
    cursor: default;
}

.day-emoji[hidden] {
    display: none;
}

.day-emoji:hover {
    opacity: 1;
}

.day-emoji::after {
    content: attr(data-message);
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0.35rem;
    background: var(--bg-darker);
    border: 1px solid var(--surface-border);
    color: var(--text-light);
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
    box-shadow: var(--shadow-md);
}

.day-emoji:hover::after {
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 769px) {
    .home-hub-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .home-hub-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.85rem;
    }

    .home-section {
        max-width: 960px;
    }
}
