* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    font-family: 'SF Pro Display', 'SF Pro Icons', 'Helvetica Neue', sans-serif;
    background-color: #050507;
    color: #ffffff;
}

/* Background Orbs (iOS Mesh Gradient Style) */
.background-orbs {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: orbFloat 25s ease-in-out infinite alternate;
}

.orb-1 {
    width: 320px; height: 320px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    top: -80px; left: -100px;
}

.orb-2 {
    width: 260px; height: 260px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    bottom: 10%; right: -80px;
    animation-delay: -10s;
}

.orb-3 {
    width: 180px; height: 180px;
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    top: 40%; left: 30%;
    opacity: 0.25;
    animation-delay: -18s;
}

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -40px) scale(1.1); }
    100% { transform: translate(-20px, 20px) scale(0.95); }
}

/* App Container */
.app-container {
    position: relative;
    z-index: 1;
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* Screens */
.screen {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    padding-top: env(safe-area-inset-top, 20px);
    padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 76px);
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.screen-active {
    display: flex;
    opacity: 1;
    transform: scale(1);
}

/* Glass Panel (iOS True Glassmorphism) */
.glass-panel {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Clock Screen */
.clock-glass {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    border-radius: 32px;
    margin: 0 16px;
}

.time-display {
    font-size: clamp(4.5rem, 18vw, 6.5rem);
    font-weight: 200;
    letter-spacing: -2px;
    line-height: 1;
    background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.date-display {
    font-size: 1.05rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.5px;
    margin-bottom: 2.5rem;
}

.binary-card {
    width: 100%;
    max-width: 320px;
    border-radius: 24px;
    padding: 1.2rem;
}

.binary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.binary-title {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.5);
}

.binary-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.binary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.binary-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    width: 60px;
    text-align: right;
    font-weight: 500;
}

.bits-container {
    display: flex;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

.bit {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bit.on {
    background: #818cf8;
    border-color: #a5b4fc;
    box-shadow: 0 0 12px rgba(129, 140, 248, 0.6), inset 0 1px 0 rgba(255,255,255,0.4);
}

/* Weather Screen */
.weather-glass {
    margin: 0 16px;
    border-radius: 28px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.location-text {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.weather-icon-large {
    font-size: 5rem;
    line-height: 1;
    margin: 12px 0;
    filter: drop-shadow(0 8px 30px rgba(0,0,0,0.3));
    animation: iconFloat 4s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.temperature-large {
    font-size: clamp(3.5rem, 14vw, 4.5rem);
    font-weight: 200;
    line-height: 1;
    background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.6) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.weather-condition {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
    font-weight: 400;
}

.weather-stats {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.stat-icon { font-size: 1.3rem; }
.stat-value { font-size: 0.85rem; color: rgba(255, 255, 255, 0.7); font-weight: 500; }

/* Forecast */
.forecast-title {
    margin: 1.5rem 16px 0.8rem;
    padding: 0.8rem 1.2rem;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.forecast-list {
    flex: 1;
    margin: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.forecast-item {
    display: grid;
    grid-template-columns: 40px 36px 1fr 50px;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    padding: 12px 14px;
    transition: background 0.2s;
}

.forecast-item:active { background: rgba(255, 255, 255, 0.08); }

.f-day { font-size: 0.9rem; color: rgba(255, 255, 255, 0.8); font-weight: 500; }
.f-icon { font-size: 1.4rem; text-align: center; }

.f-range { display: flex; align-items: center; gap: 10px; }
.f-bar-container {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.f-bar-fill {
    position: absolute;
    top: 0; bottom: 0;
    border-radius: 2px;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.f-temps { display: flex; gap: 8px; font-size: 0.85rem; text-align: right; }
.f-high { color: #fff; font-weight: 600; }
.f-low { color: rgba(255, 255, 255, 0.4); }

/* Bottom Nav */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0; right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 24px calc(12px + env(safe-area-inset-bottom, 0));
    border-radius: 24px 24px 0 0;
    margin: 0 16px;
    z-index: 10;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    padding: 6px 12px;
    transition: color 0.3s;
}

.nav-item.active { color: #818cf8; }
.nav-icon { font-size: 1.6rem; line-height: 1; }
.nav-label { font-size: 0.65rem; font-weight: 500; letter-spacing: 0.5px; }
