:root {
    --pond-bg: #06111b;
    --pond-bg-top: #081827;
    --pond-panel: #0b1b29;
    --pond-panel-2: #0e2233;
    --pond-panel-3: #10293b;
    --pond-border: rgba(139, 181, 208, .16);
    --pond-border-strong: rgba(139, 181, 208, .24);

    --pond-text: #f2f7fa;
    --pond-muted: #8fa6b5;
    --pond-muted-2: #6f8798;

    --pond-blue: #32b7ff;
    --pond-blue-soft: rgba(50, 183, 255, .13);
    --pond-green: #76df54;
    --pond-green-soft: rgba(118, 223, 84, .12);
    --pond-orange: #f6a51c;
    --pond-orange-soft: rgba(246, 165, 28, .12);
    --pond-red: #f05252;
    --pond-red-soft: rgba(240, 82, 82, .12);

    --pond-radius: 18px;
    --pond-shadow: 0 18px 42px rgba(0, 0, 0, .24);
}

html,
body {
    min-height: 100%;
    background: var(--pond-bg);
}

body {
    color: var(--pond-text);
}

/* --------------------------------------------------
   PAGE
   -------------------------------------------------- */

.pond-dashboard {
    min-height: 100vh;
    color: var(--pond-text);
    font-family: "Manrope", sans-serif;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.55;
    letter-spacing: 0;
    font-optical-sizing: auto;
    background:
        radial-gradient(circle at 18% -5%, rgba(23, 105, 156, .18), transparent 34rem),
        radial-gradient(circle at 95% 8%, rgba(14, 71, 100, .14), transparent 30rem),
        linear-gradient(180deg, var(--pond-bg-top) 0%, var(--pond-bg) 55%, #050e16 100%);
}

.pond-dashboard h1,
.pond-dashboard h2,
.pond-dashboard h3,
.pond-dashboard h4,
.pond-dashboard h5,
.pond-dashboard h6 {
    color: #fff;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
}

.pond-dashboard .text-secondary {
    color: var(--pond-muted) !important;
}

.pond-header {
    padding-bottom: .3rem;
}

.pond-header h1 {
    font-family: "Fraunces", serif;
    font-size: clamp(2rem, 2.5vw, 2.65rem);
    font-weight: 700;
    line-height: 1.08;
}

.eyebrow {
    color: var(--pond-blue);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    margin-bottom: .45rem;
}

.header-meta {
    color: #c5d4dd;
    font-size: .84rem;
    font-weight: 500;
    line-height: 1.45;
}

.header-meta strong {
    color: #fff;
}

.pond-game-launch {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #dff6ff;
    background: rgba(50, 183, 255, .16);
    border: 1px solid rgba(50, 183, 255, .4);
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    text-decoration: none;
    transition: background-color 160ms ease, transform 160ms ease;
}

.pond-game-launch:hover,
.pond-game-launch:focus-visible {
    color: #fff;
    background: rgba(50, 183, 255, .34);
    transform: translateY(-1px);
}

.status-dot {
    color: #b7f2a3;
}

.status-dot i {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: .38rem;
    border-radius: 50%;
    background: var(--pond-green);
    box-shadow: 0 0 12px rgba(118, 223, 84, .65);
}

/* --------------------------------------------------
   COMMON CARD
   -------------------------------------------------- */

.pond-card {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(17, 42, 61, .97), rgba(8, 25, 38, .98));
    border: 1px solid var(--pond-border);
    border-radius: var(--pond-radius);
    box-shadow: var(--pond-shadow);
}

.pond-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 28%);
}

/* --------------------------------------------------
   POND HERO / RESPONSIVE IMAGE
   -------------------------------------------------- */

.pond-hero {
    /* poměr odpovídá širokému řezu jezírkem */
    aspect-ratio: 16 / 7.15;
    min-height: 0;
    background: #071926;
}

.pond-scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    filter: saturate(.93) contrast(1.04) brightness(.90);
}

.pond-hero::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(2, 12, 20, .28), transparent 24%, transparent 76%, rgba(2, 12, 20, .23)),
        linear-gradient(180deg, rgba(1, 10, 17, .03), transparent 55%, rgba(1, 10, 17, .28));
}

.pond-goldfish {
    position: absolute;
    z-index: 2;
    top: 57%;
    left: 13%;
    pointer-events: none;
    animation: pond-goldfish-swim 24s ease-in-out infinite;
}

.pond-fish-sprite {
    display: block;
    font-size: clamp(1.7rem, 3vw, 2.45rem);
    line-height: 1;
    filter: drop-shadow(0 5px 6px rgba(0, 0, 0, .35));
    animation: pond-goldfish-turn 24s step-end infinite;
}

.pond-fish-bubble {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 11px);
    width: max-content;
    max-width: 180px;
    padding: .48rem .68rem;
    color: #17303d;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 7px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .24);
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    transform: translateX(-50%);
    animation: pond-bubble-appear 220ms ease-out;
}

.pond-fish-bubble::after {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 0;
    height: 0;
    content: "";
    border: 6px solid transparent;
    border-top-color: rgba(255, 255, 255, .94);
    transform: translateX(-50%);
}

.pond-fish-bubble[hidden] {
    display: none;
}

@keyframes pond-goldfish-swim {
    0%, 100% { left: 13%; top: 57%; }
    23% { top: 53%; }
    47%, 52% { left: 73%; top: 60%; }
    76% { top: 55%; }
}

@keyframes pond-goldfish-turn {
    0%, 49% { transform: scaleX(-1) rotate(-3deg); }
    50%, 99% { transform: scaleX(1) rotate(3deg); }
}

@keyframes pond-bubble-appear {
    from { opacity: 0; transform: translate(-50%, 5px) scale(.96); }
    to { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* --------------------------------------------------
   DEPTH SCALE
   -------------------------------------------------- */

.depth-scale {
    position: absolute;
    z-index: 3;
    left: 6.2%;
    top: 28%;
    bottom: 11%;
    width: 2px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 1px 5px rgba(0,0,0,.45);
}

.depth-scale::before,
.depth-scale::after {
    content: "";
    position: absolute;
    left: -6px;
    width: 14px;
    height: 2px;
    background: #fff;
}

.depth-scale::before { top: 0; }
.depth-scale::after { bottom: 0; }

.depth-scale span {
    position: absolute;
    left: 14px;
    white-space: nowrap;
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    text-shadow: 0 2px 7px rgba(0,0,0,.85);
}

.depth-top { top: -10px; }
.depth-bottom { bottom: -10px; }

/* --------------------------------------------------
   SENSORS
   Pozice jsou v % vůči pond-hero, takže drží při resize.
   -------------------------------------------------- */

.sensor {
    position: absolute;
    z-index: 4;
    width: max-content;
}

.sensor-surface {
    top: 24%;
    left: 44%;
}

.sensor-bottom {
    left: 39%;
    bottom: 7%;
}

.sensor-dot {
    position: absolute;
    z-index: 2;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    border: 5px solid rgba(255,255,255,.98);
    border-radius: 50%;
    background: var(--pond-blue);
    box-shadow:
        0 0 0 3px rgba(50,183,255,.45),
        0 6px 16px rgba(0,0,0,.32);
}

.sensor-bottom .sensor-dot {
    background: var(--pond-green);
    box-shadow:
        0 0 0 3px rgba(118,223,84,.40),
        0 6px 16px rgba(0,0,0,.32);
}

.sensor-badge {
    position: relative;
    min-width: 158px;
    margin-left: 34px;
    margin-top: -20px;
    padding: 11px 15px 12px;
    border: 1px solid;
    border-radius: 13px;
    background: rgba(5, 25, 39, .91);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 12px 30px rgba(0,0,0,.34);
}

.sensor-badge::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 26px;
    width: 16px;
    height: 1px;
    background: currentColor;
    opacity: .8;
}

.sensor-badge small,
.sensor-badge span {
    display: block;
}

.sensor-badge small {
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: 0;
}

.sensor-badge strong {
    display: block;
    margin: .18rem 0 .22rem;
    color: #fff;
    font-size: clamp(1.7rem, 2.7vw, 2.25rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.sensor-badge span {
    color: #c6d5de;
    font-size: .76rem;
}

.sensor-badge-blue {
    color: var(--pond-blue);
    border-color: rgba(50,183,255,.78);
    box-shadow:
        0 0 0 1px rgba(50,183,255,.05) inset,
        0 12px 30px rgba(0,0,0,.34);
}

.sensor-badge-blue small,
.sensor-badge-blue strong {
    color: #5bc8ff;
}

.sensor-badge-green {
    color: var(--pond-green);
    border-color: rgba(118,223,84,.82);
}

.sensor-badge-green small,
.sensor-badge-green strong {
    color: #8eea6e;
}

/* --------------------------------------------------
   CHART
   -------------------------------------------------- */

.chart-card,
.status-card,
.risk-card {
    padding: 1.25rem 1.35rem;
}

.chart-card h2,
.risk-card h2 {
    font-size: 1.05rem;
    font-weight: 700;
}

.chart-legend {
    display: flex;
    gap: 1rem;
    color: #c4d4dd;
    font-size: .78rem;
    font-weight: 600;
}

.chart-legend i {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: .35rem;
    border-radius: 50%;
}

.legend-blue { background: var(--pond-blue); }
.legend-green { background: var(--pond-green); }

.chart-period-switcher {
    display: inline-flex;
    padding: 3px;
    background: rgba(4, 14, 23, .65);
    border: 1px solid var(--pond-border);
    border-radius: 7px;
}

.chart-period-switcher button {
    min-width: 4.4rem;
    padding: .35rem .65rem;
    color: var(--pond-muted);
    background: transparent;
    border: 0;
    border-radius: 5px;
    font-size: .75rem;
    font-weight: 700;
}

.chart-period-switcher button:hover:not(:disabled),
.chart-period-switcher button:focus-visible {
    color: var(--pond-text);
}

.chart-period-switcher button.active {
    color: #06111b;
    background: var(--pond-blue);
}

.chart-period-switcher button:disabled {
    cursor: wait;
    opacity: .65;
}

.chart-placeholder {
    position: relative;
    height: 245px;
    padding-top: .2rem;
}

.chart-placeholder canvas {
    width: 100%;
    height: 100%;
}

.chart-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--pond-muted);
    background: rgba(6, 17, 27, .72);
    font-size: .85rem;
}

.chart-loading[hidden] {
    display: none;
}

.grid-lines line {
    stroke: rgba(157, 190, 210, .13);
    stroke-width: 1;
}

.line {
    fill: none;
    stroke-width: 2.5;
    vector-effect: non-scaling-stroke;
}

.line-surface { stroke: var(--pond-blue); }
.line-bottom { stroke: var(--pond-green); }

/* --------------------------------------------------
   FISH STATUS
   -------------------------------------------------- */

.status-card {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-color: rgba(118,223,84,.62);
    background:
        radial-gradient(circle at 75% 0%, rgba(118,223,84,.11), transparent 18rem),
        linear-gradient(145deg, rgba(9, 60, 51, .80), rgba(7, 32, 38, .98));
}

.status-card h2 {
    margin-bottom: .7rem;
    color: var(--pond-green);
    font-family: "Fraunces", serif;
    font-size: 1.65rem;
    line-height: 1.2;
}

.status-card p {
    margin-bottom: .25rem;
    color: #edf6f2;
    font-size: .94rem;
    line-height: 1.6;
}

.fish-icon {
    margin-bottom: .65rem;
    font-size: 3.25rem;
    filter: drop-shadow(0 8px 12px rgba(0,0,0,.25));
}

.fish-message {
    max-width: 100%;
    margin-bottom: 1rem;
    padding: .72rem .9rem;
    color: #12303e;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(255, 255, 255, .76);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
    font-size: .88rem;
    font-weight: 800;
    line-height: 1.35;
}

.status-note {
    width: 100%;
    margin-top: 1.25rem;
    padding-top: 1rem;
    color: #cde4d6;
    border-top: 1px solid rgba(255,255,255,.14);
    font-size: .82rem;
    line-height: 1.55;
}

.status-warning {
    border-color: rgba(246,165,28,.70);
    background:
        radial-gradient(circle at 75% 0%, rgba(246,165,28,.11), transparent 18rem),
        linear-gradient(145deg, rgba(78, 52, 8, .78), rgba(40, 30, 13, .98));
}

.status-warning h2 { color: #ffc158; }

.status-danger {
    border-color: rgba(240,82,82,.70);
    background:
        radial-gradient(circle at 75% 0%, rgba(240,82,82,.12), transparent 18rem),
        linear-gradient(145deg, rgba(81, 24, 27, .82), rgba(40, 16, 22, .98));
}

.status-danger h2 { color: #ff7777; }

/* --------------------------------------------------
   SMALL METRICS
   -------------------------------------------------- */

.metric-card {
    height: 100%;
    min-height: 92px;
    padding: .95rem .85rem;
    border: 1px solid var(--pond-border);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(16, 41, 59, .95), rgba(10, 29, 43, .98));
    box-shadow: 0 10px 26px rgba(0,0,0,.15);
}

.metric-card span {
    display: block;
    margin-bottom: .42rem;
    color: var(--pond-muted);
    font-size: .68rem;
    font-weight: 600;
}

.metric-card strong {
    color: #fff;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.metric-blue { color: var(--pond-blue) !important; }
.metric-green { color: var(--pond-green) !important; }
.metric-orange { color: var(--pond-orange) !important; }

/* --------------------------------------------------
   RISK CARD
   -------------------------------------------------- */

.risk-card {
    background: linear-gradient(145deg, rgba(16, 37, 54, .98), rgba(8, 25, 38, .98));
}

.risk-row {
    display: grid;
    grid-template-columns: minmax(90px, .8fr) 1.3fr;
    gap: 1rem;
    align-items: center;
    padding: .8rem .9rem;
    margin-bottom: .5rem;
    border-radius: 9px;
    font-size: .84rem;
    line-height: 1.4;
}

.risk-row strong {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.risk-row span {
    text-align: right;
}

.risk-green {
    color: #9ee986;
    background: var(--pond-green-soft);
    border: 1px solid rgba(118,223,84,.23);
}

.risk-orange {
    color: #ffc15a;
    background: var(--pond-orange-soft);
    border: 1px solid rgba(246,165,28,.25);
}

.risk-red {
    color: #ff8080;
    background: var(--pond-red-soft);
    border: 1px solid rgba(240,82,82,.25);
}

/* --------------------------------------------------
   RESPONSIVE
   -------------------------------------------------- */

@media (max-width: 1199.98px) {
    .status-card {
        min-height: auto;
    }
}

@media (max-width: 991.98px) {
    .pond-dashboard {
        padding-top: 1.5rem !important;
    }

    .pond-hero {
        aspect-ratio: 16 / 8.2;
    }

    .sensor-surface {
        left: 43%;
    }

    .sensor-bottom {
        left: 36%;
    }
}

@media (max-width: 767.98px) {
    .pond-hero {
        aspect-ratio: 4 / 3;
    }

    .pond-scene {
        object-position: center center;
    }

    .sensor-surface {
        top: 24%;
        left: 43%;
    }

    .sensor-bottom {
        left: 33%;
        bottom: 7%;
    }

    .sensor-badge {
        min-width: 138px;
        padding: 9px 11px 10px;
    }

    .sensor-badge strong {
        font-size: 1.65rem;
    }

    .depth-scale {
        left: 7%;
    }
}

@media (max-width: 575.98px) {
    .pond-dashboard {
        padding-left: .35rem;
        padding-right: .35rem;
    }

    .pond-card {
        border-radius: 15px;
    }

    .pond-hero {
        aspect-ratio: 1 / 1;
    }

    .pond-scene {
        /* širokou scénu na mobilu raději oříznout než deformovat */
        object-fit: cover;
        object-position: center center;
    }

    .pond-goldfish {
        top: 59%;
    }

    .pond-fish-bubble {
        max-width: 140px;
        font-size: .65rem;
    }

    .sensor-surface {
        top: 24%;
        left: 35%;
    }

    .sensor-bottom {
        left: 24%;
        bottom: 8%;
    }

    .sensor-dot {
        width: 20px;
        height: 20px;
        border-width: 4px;
    }

    .sensor-badge {
        min-width: 124px;
        margin-left: 28px;
        margin-top: -17px;
        padding: 8px 10px 9px;
    }

    .sensor-badge small {
        font-size: .64rem;
    }

    .sensor-badge strong {
        font-size: 1.45rem;
    }

    .sensor-badge span {
        font-size: .66rem;
    }

    .depth-scale {
        left: 7%;
        top: 28%;
        bottom: 12%;
    }

    .depth-scale span {
        font-size: .68rem;
    }

    .chart-card,
    .status-card,
    .risk-card {
        padding: 1rem;
    }

    .chart-placeholder {
        height: 185px;
    }

    .metric-card {
        min-height: 80px;
        padding: .72rem .55rem;
    }

    .metric-card span {
        font-size: .62rem;
    }

    .metric-card strong {
        font-size: .78rem;
    }

    .risk-row {
        grid-template-columns: 1fr;
        gap: .25rem;
    }

    .risk-row span {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pond-goldfish,
    .pond-fish-sprite,
    .pond-fish-bubble {
        animation: none;
    }
}
