.home-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 100%;
    margin-bottom: 0.35rem;
}

.home-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 0;
    height: 38px;
}

.home-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.home-app-icon {
    width: 38px;
    height: 38px;
    filter: drop-shadow(0 4px 12px rgba(93, 253, 221, 0.35));
    transition: transform 0.3s ease;
}

.home-app-icon:hover {
    transform: rotate(6deg) scale(1.08);
}

.home-stats-btn {
    padding: 0.35rem;
    border-radius: 50%;
    min-height: unset;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1;
    border: 1px solid var(--glass-border);
    background: rgba(20, 32, 68, 0.88);
    color: var(--text-main);
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.home-stats-btn:hover {
    transform: scale(1.08);
}

.logo-text {
    font-family: var(--font-heading);
    font-size: clamp(1.85rem, 5.2vw, 2.35rem);
    font-weight: 800;
    margin: -0.75rem 0 0.15rem;
    text-align: center;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.home-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.85rem;
    margin: 0.35rem 0 0.75rem;
    text-align: center;
}

.tagline {
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 3.8vw, 1.45rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.15rem;
    color: var(--text-main);
}

.subtitle {
    color: var(--text-muted);
    font-size: clamp(0.8rem, 2.3vw, 0.9rem);
    margin-top: 0;
    margin-bottom: 0.2rem;
}

/* Daily Hero Card */
.daily-hero-card {
    align-items: center;
    background: linear-gradient(135deg, #ffd600 0%, #ff921b 100%);
    border: none;
    border-radius: 16px;
    color: #0b132b;
    display: flex;
    gap: 0.85rem;
    padding: 0.85rem 1.1rem;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(255, 214, 0, 0.35);
    cursor: pointer;
    margin-bottom: 0.35rem;
}

.daily-hero-card:hover {
    background: linear-gradient(135deg, #ffe033 0%, #ffaa33 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(255, 214, 0, 0.5);
}

.daily-hero-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.daily-hero-content {
    display: flex;
    flex-direction: column;
    text-align: left;
    flex: 1;
    min-width: 0;
    gap: 0.15rem;
}

.daily-hero-badge {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(11, 19, 43, 0.65);
}

.daily-hero-title {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 800;
    color: #0b132b;
    line-height: 1.25;
    display: block;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.daily-hero-action {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0b132b;
    flex-shrink: 0;
    background: rgba(11, 19, 43, 0.12);
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    border: 1.5px solid rgba(11, 19, 43, 0.2);
}

.daily-hero-card.completed {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
    color: #ffffff;
}

.daily-hero-card.completed:hover {
    background: linear-gradient(135deg, #047857 0%, #34d399 100%);
    box-shadow: 0 6px 28px rgba(16, 185, 129, 0.5);
}

.daily-hero-card.completed .daily-hero-badge {
    color: rgba(255, 255, 255, 0.85);
}

.daily-hero-card.completed .daily-hero-title {
    color: #ffffff;
}

.daily-hero-card.completed .daily-hero-action {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
}


/* 2x2 Game Mode Grid */
.game-mode-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.95rem;
    margin-top: 0.45rem;
}

.game-mode-row {
    align-items: flex-start;
    background: rgba(11, 19, 43, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.95rem 1.05rem;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    min-height: 86px;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.game-mode-row:hover {
    border-color: rgba(93, 253, 221, 0.5);
    background: rgba(20, 32, 68, 0.92);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(93, 253, 221, 0.15);
}

.game-mode-row.selected {
    border: 2px solid var(--primary);
    background: rgba(20, 35, 72, 0.95);
    box-shadow: 0 0 18px rgba(93, 253, 221, 0.25), 0 8px 25px rgba(0, 0, 0, 0.4);
}

.game-mode-row:active {
    transform: scale(0.98);
}

.game-mode-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.game-mode-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.mode-info-trigger {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
    position: relative;
}

.mode-info-trigger:hover {
    background: rgba(93, 253, 221, 0.2);
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.1);
}

.mode-info-trigger:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.mode-tooltip {
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    .mode-tooltip {
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
        position: absolute;
        bottom: calc(100% + 8px);
        right: -6px;
        width: 210px;
        background: rgba(11, 19, 43, 0.96);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(93, 253, 221, 0.35);
        border-radius: 10px;
        padding: 0.55rem 0.75rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(93, 253, 221, 0.12);
        pointer-events: none;
        opacity: 0;
        visibility: hidden;
        transform: translateY(6px);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
        z-index: 100;
        text-align: left;
    }

    .mode-tooltip::after {
        content: '';
        position: absolute;
        bottom: -5px;
        right: 12px;
        width: 8px;
        height: 8px;
        background: rgba(11, 19, 43, 0.96);
        border-right: 1px solid rgba(93, 253, 221, 0.35);
        border-bottom: 1px solid rgba(93, 253, 221, 0.35);
        transform: rotate(45deg);
    }

    .mode-tooltip-title {
        font-family: var(--font-heading);
        font-size: 0.8rem;
        font-weight: 700;
        color: var(--primary);
    }

    .mode-tooltip-desc {
        font-size: 0.72rem;
        color: var(--text-main);
        line-height: 1.35;
        white-space: normal;
    }

    .mode-info-trigger:hover .mode-tooltip,
    .mode-info-trigger:focus-visible .mode-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.game-mode-content {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
    width: 100%;
}

.game-mode-header {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.game-mode-title {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-mode-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mode Info Modal */
.mode-info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.mode-info-modal.hidden {
    display: none;
}

.mode-info-content {
    max-width: 380px;
    padding: 2.2rem 1.8rem 1.8rem;
    text-align: center;
}

.mode-info-badge-container {
    margin-top: -0.5rem;
    margin-bottom: 0.75rem;
}

.mode-info-tagline {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    line-height: 1.35;
}

.mode-info-rules {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    text-align: left;
}

.mode-info-rules li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.mode-info-rules li::before {
    content: '•';
    color: var(--primary);
    font-weight: bold;
    font-size: 1.1rem;
    line-height: 1;
}

.mode-info-actions {
    width: 100%;
}

.beginner-badge {
    background: rgba(93, 253, 221, 0.2);
    border: 1px solid rgba(93, 253, 221, 0.4);
    border-radius: 4px;
    color: var(--primary);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.05rem 0.3rem;
    letter-spacing: 0.02em;
}

.home-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
    margin-top: 0.35rem;
    padding-bottom: calc(var(--safe-area-bottom) + 0.4rem);
}

.home-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem 0.75rem;
    width: 100%;
    margin: 0.2rem auto 0;
}

.home-nav-link {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.1rem;
    text-decoration: none;
    transition: color 0.2s ease;
    min-height: unset;
    line-height: 1.2;
}

.home-nav-link:hover {
    color: var(--text-main);
}

.home-nav-link--muted {
    font-size: 0.7rem;
    color: rgba(161, 161, 170, 0.7);
}

.home-nav-separator {
    color: rgba(161, 161, 170, 0.4);
    font-size: 0.75rem;
    user-select: none;
}


.daily-mode {
    background: linear-gradient(135deg, rgba(255, 214, 0, 0.95), rgba(255, 146, 43, 0.95)) !important;
    color: #0b132b !important;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(255, 214, 0, 0.3);
    border: none !important;
}

.daily-mode:hover {
    box-shadow: 0 6px 25px rgba(255, 214, 0, 0.45);
    transform: translateY(-2px);
}

@media (max-height: 900px) {
    .content-wrapper {
        padding: calc(0.6rem + var(--safe-area-top)) calc(1.15rem + var(--safe-area-right)) calc(0.7rem + var(--safe-area-bottom)) calc(1.15rem + var(--safe-area-left));
    }
    
    .home-app-icon {
        width: 34px;
        height: 34px;
    }
    
    .logo-text {
        font-size: 1.75rem;
        margin: -0.65rem 0 0.1rem;
    }
    
    .tagline {
        font-size: 1.15rem;
    }
    
    .subtitle {
        display: block;
        font-size: 0.82rem;
    }
    
    .daily-hero-card {
        padding: 0.75rem 1rem;
    }
    
    .daily-hero-icon {
        font-size: 1.3rem;
    }
    
    .game-mode-list {
        gap: 0.9rem;
    }

    .game-mode-row {
        min-height: 82px;
        padding: 0.9rem 1rem;
        gap: 0.45rem;
    }
    
    .game-mode-icon {
        font-size: 1.3rem;
    }

    .game-mode-title {
        font-size: 0.9rem;
    }

    .game-mode-meta {
        font-size: 0.7rem;
    }
    
    .home-actions .btn-large {
        padding: 14px 24px;
        font-size: 1rem;
    }
    
    .home-footer-links {
        gap: 0.4rem 0.65rem;
        margin-top: 0.15rem;
    }
    
    .home-nav-link {
        font-size: 0.75rem;
        padding: 0.2rem 0.1rem;
    }
}

@media (max-height: 700px) {
    .content-wrapper {
        padding: calc(0.4rem + var(--safe-area-top)) calc(0.95rem + var(--safe-area-right)) calc(0.5rem + var(--safe-area-bottom)) calc(0.95rem + var(--safe-area-left));
    }

    .home-header {
        margin-bottom: 0.25rem;
    }

    .home-main {
        gap: 0.65rem;
        margin: 0.15rem 0 0.45rem;
    }

    .subtitle {
        display: none;
    }

    .game-mode-list {
        gap: 0.8rem;
    }

    .game-mode-row {
        min-height: 76px;
        padding: 0.8rem 0.85rem;
        gap: 0.35rem;
    }
    
    .game-mode-icon {
        font-size: 1.15rem;
    }

    .game-mode-title {
        font-size: 0.85rem;
    }

    .game-mode-meta {
        font-size: 0.68rem;
    }
    
    .home-actions .btn-large {
        padding: 12px 20px;
        font-size: 0.94rem;
    }
}

@media (min-width: 900px) {
    .content-wrapper {
        max-width: 760px;
        margin: 0 auto;
        padding: 1.5rem 2rem;
    }

    .logo-text {
        font-size: 3rem;
    }

    .tagline {
        font-size: 1.75rem;
    }

    .subtitle {
        display: block;
    }

    .home-main {
        flex: 0 1 auto;
        margin: 0.75rem 0 1.25rem;
    }

    .game-mode-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }

    .game-mode-row {
        min-height: 80px;
        padding: 0.85rem 0.95rem;
        gap: 0.4rem;
    }

    .game-mode-icon {
        font-size: 1.35rem;
    }

    .game-mode-title {
        font-size: 0.95rem;
    }

    .game-mode-meta {
        display: inline-block;
        margin-top: 0.15rem;
        font-size: 0.7rem;
        font-weight: 600;
        color: var(--primary);
        background: rgba(93, 253, 221, 0.1);
        border: 1px solid rgba(93, 253, 221, 0.2);
        border-radius: 6px;
        padding: 0.15rem 0.4rem;
        align-self: flex-start;
        white-space: nowrap;
    }

    .home-actions {
        margin-bottom: 0;
    }
}
