 * { box-sizing: border-box;
        }

        body {
            margin: 0;
            min-height: 100vh;
            font-family: Arial, sans-serif;
            background: #F5FAFA;
            color: #302B3D;
        }

        .app {
            width: 100%;
            max-width: 430px;
            min-height: 100vh;
            margin: auto;
            padding: 28px 20px 90px;
        }

        /* HEADER */

        .header {
            margin-bottom: 30px;
        }

        .logo {
            font-size: 28px;
            font-weight: 800;
            letter-spacing: -1px;
        }

        .logo span {
            color: #8B7AB8;
        }

        .tagline {
            margin-top: 6px;
            color: #72608b;
            font-size: 14px;
        }

        /* GREETING */

        .greeting {
            margin-bottom: 18px;
        }

        .greeting small {
            color: #72608b;
            font-size: 14px;
        }

        .greeting h2 {
            margin: 5px 0 0;
            font-size: 24px;
        }

        /* STEP CARD */

        .step-card {
            background: #302B3D;
            color: white;
            border-radius: 24px;
            padding: 28px 24px;
            box-shadow: 0 10px 25px rgba(23, 59, 77, 0.12);
        }
        

        .step-label {
            font-size: 14px;
            opacity: 0.75;
        }

        .steps-number {
            font-size: 58px;
            font-weight: 800;
            letter-spacing: -2px;
            margin: 8px 0 2px;
        }

        .steps-unit {
            font-size: 14px;
            opacity: 0.75;
        }

        /* PROGRESS */

        .progress-container {
            margin-top: 25px;
        }

        .progress-info {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            margin-bottom: 8px;
            opacity: 0.8;
        }

        .progress-bar {
            width: 100%;
            height: 9px;
            background: rgba(255,255,255,0.2);
            border-radius: 20px;
            overflow: hidden;
        }

        .progress {
            width: 0%;
            height: 100%;
            background: #8B7AB8;
            border-radius: 20px;
            transition: width 0.3s ease;
        }
        
        /* activity*/

        
        .activity-stats {
            display: flex;
            align-items: center;
            gap: 28px;
            margin-top: 16px;
        }

        .activity-stat {
            display: flex;
            align-items: baseline;
            gap: 4px;
        }

        .activity-stat strong {
            font-size: 16px;
            font-weight: 700;
        }

        .activity-stat span {
            font-size: 12px;
            opacity: 0.7;
        }

        /* TRACKING */

        .tracking {
            margin-top: 20px;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
        }

        .dot {
            width: 9px;
            height: 9px;
            background: #8B7AB8;
            border-radius: 50%;
        }

        .start-button {
            width: 100%;
            margin-top: 20px;
            padding: 14px;
            border: none;
            border-radius: 14px;

            background: #8B7AB8;
            color: white;

            font-size: 14px;
            font-weight: bold;

            cursor: pointer;
            transition: background 0.2s ease,
                        transform 0.2s ease,
                        opacity 0.2s ease;              
        }

        .start-button:active:not(disabled) {
            transform: scale(0.98);
        }

        .start-button:disabled {
            opacity: 0.65;
            cursor: not-allowed;
        }

        #status {
            margin-top: 12px;
            text-align: center;
            font-size: 12px;
            color: rgba(255,255,255,0.75);
        }

        #sensorDebug {
            margin-top: 8px;
            text-align: center;
            font-size: 11px;
            color: rgba(255,255,255,0.45);
        }        

        /* RANK CARD */

        .rank-card {
            margin-top: 20px;
            background: white;
            border: 1px solid #E5EEEE;
            border-radius: 22px;
            padding: 22px 24px;
            box-shadow: 0 6px 18px rgba(48, 43, 61, 0.06);
            cursor: pointer;
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }

        .rank-card:active {
            transform: scale(0.98);
        }

        .rank-title {
            color: #72608b;
            font-size: 13px;
            font-weight: 600;
            letter-spacing: 0.3px;
        }

        .rank-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 12px;
        }

        .rank-number {
            font-size: 34px;
            font-weight: 800;
            letter-spacing: -0.8px;
            line-height: 1.2;
        }

        .rank-users {
            margin-top: 3px;
            color: #72608b;
            font-size: 13px;
        }

        .rank-arrow {
            color: #8B7AB8;
            font-size: 26px;
            transition: transforms 0.2s ease;
        }

        /* NAVIGATION */

        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);

            width: 100%;
            max-width: 430px;

            height: 72px;
            background: white;

            display: flex;
            justify-content: space-around;
            align-items: center;

            border-top: 1px solid #E5EEEE;
            padding-bottom: env(safe-area-inset-bottom);
            z-index: 100;
        }

        .nav-item {
            text-decoration: none;
            text-align: center;
            font-size: 12px;
            color: #a090ae;
            cursor: pointer;
            transition: color 0.2s ease;
        }

        .nav-icon {
            width: 23px;
            height: 23px;
            display: flex;
            align-items: center;
            justify-content: center;
            }

            .nav-icon svg {
            width: 23px;
            height: 23px;
            fill: none;
            stroke: currentColor;
            stroke-width: 1.7;
            stroke-linecap: round;
            stroke-linejoin: round;
            }

            .nav-item {
            color: #A090AE;
            text-decoration: none;
            }

            .nav-item.active {
            color: #8B7AB8;
            }

            .nav-item small {
            font-size: 10px;
            margin-top: 3px;
            }

        /*games card*/

        .games-card {
            width: 100%;
            margin-top: 14px;
            padding: 17px 18px;
            border: 1px solid #E5EEEE;
            border-radius: 20px;
            background: #FFFFFF;
            color: #302b3D;
            display: flex;
            align-items: center;
            gap: 13px;
            text-align: left;
            box-shadow: 0 6px 18px rgba(48,43,61,0.04);
            cursor: pointer;
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }

        .games-card:hover {
            box-shadow:
                0 8px 22px rgba(48, 43, 61, 0.07);
        }

        .games-card:active {
            transform: scale(0.98);
        }


        /* GAME ICON */

        .games-icon {
            width: 44px;
            height: 44px;

            border-radius: 14px;

            background: #F0ECF7;
            color: #8B7AB8;

            display: flex;
            align-items: center;
            justify-content: center;

            font-size: 21px;

            flex-shrink: 0;
        }


        /* GAME TEXT */

        .games-info {
            min-width: 0;

            flex: 1;

            display: flex;
            flex-direction: column;

            gap: 4px;
        }

        .games-info strong {
            font-size: 14px;
            font-weight: 700;
        }

        .games-info span {
            color: #A090AE;

            font-size: 11px;
        }


        /* ARROW */

        .games-arrow {
            color: #8B7AB8;

            font-size: 23px;

            line-height: 1;
        }

        /*  GLOBAL DARK MODE — HOME*/

    body.dark {
        background: #302B3D;
        color: #ffffff;
    }

    body.dark .tagline {
        color: #C9C3D2;
    }

    body.dark .step-card,
    body.dark .rank-card,
    body.dark .games-card {
        background: #3B3549;
        color: #FFFFFF;
        border-color: #514A60;
    }

    body.dark .bottom-nav {
        background: #3B3549;
        border-top-color: #514A60;
    }

    body.dark .rank-users,
    body.dark .games-info span {
        color: #C9C3D2;
    }