body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 30px 10px 10px 10px;
    background: linear-gradient(135deg, #1b4965 0%, #5fa8d3 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    color: #cae9ff;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Ocean Water Visualization */
body::before {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(var(--tide-progress, 0%) * 0.95);
    background: linear-gradient(0deg, 
        rgba(8, 30, 55, 0.9) 0%,        /* Much darker at bottom */
        rgba(15, 45, 65, 0.8) 40%,      /* Mid-depth */
        rgba(27, 73, 101, 0.7) 100%     /* Lighter at surface */
    );
    transform: translateZ(0);
    will-change: height;
    z-index: 0;
    pointer-events: none;
}

/* Wave Surface Animation */
body::after {
    content: '';
    position: fixed;
    bottom: calc(var(--tide-progress, 0%) * 0.95);
    left: 0;
    width: 200%;
    height: 40px;
    background: rgba(27, 73, 101, 0.7);
    clip-path: polygon(
        0% 50%,
        1% 47%,
        2% 44%,
        3% 41%,
        4% 38%,
        5% 35%,
        6% 32%,
        7% 30%,
        8% 28%,
        9% 30%,
        10% 32%,
        11% 35%,
        12% 38%,
        13% 41%,
        14% 44%,
        15% 47%,
        16% 50%,
        17% 53%,
        18% 56%,
        19% 59%,
        20% 62%,
        21% 65%,
        22% 68%,
        23% 70%,
        24% 68%,
        25% 65%,
        26% 62%,
        27% 59%,
        28% 56%,
        29% 53%,
        30% 50%,
        31% 47%,
        32% 44%,
        33% 41%,
        34% 38%,
        35% 35%,
        36% 32%,
        37% 30%,
        38% 28%,
        39% 30%,
        40% 32%,
        41% 35%,
        42% 38%,
        43% 41%,
        44% 44%,
        45% 47%,
        46% 50%,
        47% 53%,
        48% 56%,
        49% 59%,
        50% 62%,
        51% 65%,
        52% 68%,
        53% 70%,
        54% 68%,
        55% 65%,
        56% 62%,
        57% 59%,
        58% 56%,
        59% 53%,
        60% 50%,
        61% 47%,
        62% 44%,
        63% 41%,
        64% 38%,
        65% 35%,
        66% 32%,
        67% 30%,
        68% 28%,
        69% 30%,
        70% 32%,
        71% 35%,
        72% 38%,
        73% 41%,
        74% 44%,
        75% 47%,
        76% 50%,
        77% 53%,
        78% 56%,
        79% 59%,
        80% 62%,
        81% 65%,
        82% 68%,
        83% 70%,
        84% 68%,
        85% 65%,
        86% 62%,
        87% 59%,
        88% 56%,
        89% 53%,
        90% 50%,
        91% 47%,
        92% 44%,
        93% 41%,
        94% 38%,
        95% 35%,
        96% 32%,
        97% 30%,
        98% 32%,
        99% 35%,
        100% 38%,
        100% 100%,
        0% 100%
    );
    animation: wave-flow 8s linear infinite;
    transform: translateZ(0);
    will-change: transform;
    z-index: 1;
    pointer-events: none;
}

body > * {
    position: relative;
    z-index: 2;
}

@keyframes wave-flow {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-25%);
    }
}

/* Typography */
.tide-height {
    font-size: 8rem;
    font-weight: bold;
    margin: 40px 0;
    text-shadow: 2px 2px 4px rgba(27, 73, 101, 0.6);
    color: #cae9ff;
}

.tide-unit {
    font-size: 3rem;
    opacity: 0.8;
    color: #5fa8d3;
}

.label {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #cae9ff;
    opacity: 0.9;
}

.time {
    font-size: 1.2rem;
    margin-top: 10px;
    color: #5fa8d3;
    opacity: 0.9;
}

.tide-direction {
    font-size: 1.2rem;
    margin-top: 5px;
    color: #cae9ff;
    font-weight: bold;
}

/* Weather Display */
.weather {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
    font-size: 1.1rem;
    color: #5fa8d3;
    opacity: 0.9;
}

/* Unified Card */
.unified-card {
    background: rgba(27, 73, 101, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    width: 100%;
    max-width: 800px;
    border: 1px solid rgba(95, 168, 211, 0.4);
}

.next-after {
    font-size: 1.1rem;
    color: #5fa8d3;
    margin: 15px 0;
    opacity: 0.8;
    text-align: center;
}

/* Tide Extreme Box */
.tide-extreme {
    text-align: center;
    padding: 15px;
    width: 100%;
    transition: all 0.3s ease;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.tide-extreme.active {
    position: relative;
    overflow: hidden;
}


.tide-extreme.active > div {
    position: relative;
    z-index: 2;
}

.extreme-type {
    font-size: 1rem;
    color: #5fa8d3;
    margin-bottom: 5px;
    font-weight: bold;
}

.extreme-time {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #cae9ff;
}

.extreme-height {
    font-size: 1.3rem;
    font-weight: bold;
    color: #cae9ff;
}

.progress-percent {
    font-size: 0.9rem;
    color: #5fa8d3;
    margin-top: 5px;
    opacity: 0.8;
}

/* Tide Graph */
.tide-graph {
    margin-top: 20px;
    width: 100%;
    max-width: 800px;
}

.graph-label {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #5fa8d3;
    text-align: center;
}

.graph-container {
    padding: 5px;
    overflow-x: auto;
}

#tide-chart {
    width: 100%;
    height: 300px;
    min-width: 600px;
}

/* Responsive Design */
@media (max-width: 480px) {
    body {
        padding: 20px;
    }
    .tide-height {
        font-size: 6rem;
    }
    .tide-unit {
        font-size: 2rem;
    }
    .unified-card {
        width: calc(100vw - 40px);
        max-width: 350px;
        padding: 15px;
    }
    .graph-container {
        padding: 0 2.5px;
    }
    #tide-chart {
        min-width: unset;
        width: 100%;
        height: 150px;
    }
}