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

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    padding: 36px 24px 64px;
    position: relative;
    color: #fff;
}

/* Ambient particles */
.particles {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    animation: float-particle linear infinite;
}

@keyframes float-particle {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

/* Hero */
.hero {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    animation: fadeInUp 0.7s ease both;
}

.hero-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.hero-title {
    font-size: clamp(34px, 5.5vw, 52px);
    font-weight: 800;
    letter-spacing: -1.2px;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 3px 18px rgba(0, 0, 0, 0.35);
}

.hero-divider {
    width: 1px;
    height: 46px;
    background: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}

.hero-clock {
    text-align: left;
    min-width: 118px;
}

.clock-time {
    font-size: clamp(26px, 4vw, 34px);
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.clock-date {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
    margin-top: 4px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}

/* Board */
.board {
    width: 100%;
    max-width: 1240px;
    margin: 40px auto 0;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.cat-section {
    animation: fadeInUp 0.6s ease both;
}

.cat-section:nth-child(1) { animation-delay: 0.05s; }
.cat-section:nth-child(2) { animation-delay: 0.12s; }
.cat-section:nth-child(3) { animation-delay: 0.19s; }
.cat-section:nth-child(4) { animation-delay: 0.26s; }
.cat-section:nth-child(5) { animation-delay: 0.33s; }
.cat-section:nth-child(6) { animation-delay: 0.4s; }

.cat-title {
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 14px;
    letter-spacing: -0.2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

/* App card */
.app-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(18, 18, 24, 0.42);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    text-decoration: none;
    color: #fff;
    min-width: 0;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    animation: fadeInUp 0.5s ease both;
}

.app-card:hover {
    transform: translateY(-3px);
    background: rgba(18, 18, 24, 0.6);
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.app-card:active {
    transform: translateY(-1px);
    transition-duration: 0.1s;
}

.app-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    line-height: 1;
    background: rgba(255, 255, 255, 0.14);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.app-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.app-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-lock {
    font-size: 10px;
    opacity: 0.8;
    margin-left: 3px;
    vertical-align: middle;
}

.board-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 40px 0;
    font-size: 14px;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

/* Password modal */
.pw-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 18, 40, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.pw-overlay.show {
    opacity: 1;
    visibility: visible;
}

.pw-modal {
    width: 100%;
    max-width: 360px;
    padding: 30px 26px 26px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 20px;
    color: #fff;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
    animation: fadeInUp 0.35s ease both;
}

.pw-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.pw-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

.pw-target {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pw-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.pw-input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.pw-input:focus {
    border-color: rgba(255, 255, 255, 0.75);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.pw-error {
    margin-top: 12px;
    padding: 8px 12px;
    font-size: 13px;
    color: #fff;
    background: rgba(255, 77, 77, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.pw-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.pw-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.pw-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.45);
}

.pw-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(102, 126, 234, 0.55);
}

.pw-btn-ghost {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.pw-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.24);
}

.pw-btn:active {
    transform: translateY(0);
}

.pw-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pw-shake {
    animation: pwShake 0.35s ease;
}

@keyframes pwShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-4px); }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 28px 16px 48px;
    }

    .hero-inner {
        gap: 14px;
    }

    .hero-divider {
        height: 36px;
    }

    .board {
        margin-top: 30px;
        gap: 26px;
    }

    .cat-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }

    .cat-title {
        font-size: 17px;
    }

    .app-card {
        padding: 11px 12px;
        gap: 10px;
    }
}

@media (max-width: 420px) {
    .cat-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}
