/* ASTRONAUTENBAR OS · UHR · PROTOTYP V0.1 */

.uhr-page {
    --uhr-system: #FF4FD8;
    --uhr-system-active: #FFD0F2;
    --uhr-system-soft: #F07ACB;
    --uhr-system-muted: #9E718E;
    --uhr-alltag: #E6B94A;
    --uhr-alltag-active: #FFE39A;
    --uhr-surface: rgba(255, 79, 216, .065);
}

.uhr-page.is-uhr-mode {
    overflow: hidden;
}

.uhr-terminal-shell {
    width: min(900px, calc(100% - 24px));
}

.uhr-main {
    display: grid;
    gap: 12px;
}

.uhr-title {
    margin: 0;
    padding: 22px 30px 20px;
    color: var(--life-system-active);
    font-size: 1.55rem;
    line-height: 1.4;
    letter-spacing: .08em;
    text-shadow: 0 0 3px rgba(151, 255, 198, .56), 0 0 12px rgba(57, 217, 138, .32);
}

.uhr-status-board {
    color: var(--life-system-muted);
    font-size: var(--font-system);
    line-height: 1.9;
    letter-spacing: .025em;
}

.uhr-status-board span {
    color: var(--life-system-active);
}

.uhr-disclosure {
    min-height: 0 !important;
    padding: 0 !important;
}

.uhr-disclosure summary {
    min-height: 76px;
    padding: 24px 86px 22px 30px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--life-system-active);
    cursor: pointer;
    list-style: none;
}

.uhr-disclosure summary::-webkit-details-marker {
    display: none;
}

.uhr-disclosure summary:focus-visible {
    outline: 1px solid var(--life-system-active);
    outline-offset: -4px;
}

.uhr-disclosure-doctor {
    position: absolute;
    top: 27px;
    right: 30px;
}

.uhr-disclosure-content {
    padding: 0 30px 24px;
    color: var(--life-system-muted);
    line-height: 1.7;
}

.uhr-disclosure-content p {
    margin: 0;
}

.uhr-disclosure-content p + p {
    margin-top: 1em;
}

.uhr-sources {
    margin-top: 28px;
    padding-top: 17px;
    border-top: 1px solid var(--life-system-line);
}

.uhr-sources h2 {
    margin: 0 0 15px;
    color: var(--life-system-active);
    font-size: var(--font-meta);
    letter-spacing: .08em;
}

.uhr-sources p {
    padding-bottom: 16px;
    border-bottom: 1px solid color-mix(in srgb, var(--life-system) 18%, transparent);
}

.uhr-sources p + p {
    margin-top: 16px;
}

.uhr-sources span {
    font-size: .92em;
}

.uhr-sources a {
    color: var(--life-system-active);
    overflow-wrap: anywhere;
}

.uhr-instrument {
    padding: 30px;
}

.uhr-preview-field {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    min-height: 320px;
    padding: 46px 24px 38px;
    border: 1px solid rgba(255, 79, 216, .56);
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 72% 62% at 50% 44%, rgba(255, 79, 216, .13), transparent 70%),
        rgba(255, 79, 216, .045);
    box-shadow: inset 0 0 44px rgba(255, 79, 216, .09), 0 0 18px rgba(255, 38, 190, .12);
}

.uhr-preview-field::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -22%;
    pointer-events: none;
    background:
        radial-gradient(ellipse 34% 48% at 28% 42%, rgba(255, 79, 216, .17), transparent 72%),
        radial-gradient(ellipse 38% 44% at 74% 58%, rgba(255, 151, 221, .11), transparent 74%);
    animation: uhrPreviewDrift 38s ease-in-out infinite alternate;
}

.uhr-preview-time {
    color: var(--uhr-system-active);
    font-size: clamp(2.7rem, 10vw, 6.2rem);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: .045em;
    text-shadow: 0 0 4px rgba(255, 208, 242, .7), 0 0 18px rgba(255, 79, 216, .4), 0 0 42px rgba(255, 38, 190, .2);
}

.uhr-preview-date {
    margin-top: 17px;
    color: var(--uhr-system-muted);
    font-size: .78rem;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.uhr-open-mode,
.uhr-primary-action,
.uhr-object-action,
.uhr-quiet-action {
    border: 1px solid rgba(255, 79, 216, .48);
    border-radius: 3px;
    color: var(--uhr-system-soft);
    background: linear-gradient(180deg, rgba(255, 79, 216, .07), rgba(255, 79, 216, .025));
    box-shadow: inset 0 1px 0 rgba(255, 208, 242, .08), 0 0 7px rgba(255, 79, 216, .06);
    font: inherit;
    letter-spacing: .07em;
    cursor: pointer;
    transition: color .16s ease, border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.uhr-open-mode {
    margin-top: 34px;
    min-height: 48px;
    padding: 10px 18px;
}

.uhr-open-mode:hover,
.uhr-open-mode:focus-visible,
.uhr-primary-action:hover,
.uhr-primary-action:focus-visible,
.uhr-object-action:hover,
.uhr-object-action:focus-visible,
.uhr-quiet-action:hover,
.uhr-quiet-action:focus-visible {
    color: var(--uhr-system-active);
    border-color: rgba(255, 208, 242, .82);
    background: linear-gradient(180deg, rgba(255, 79, 216, .17), rgba(255, 79, 216, .065));
    box-shadow: inset 0 0 15px rgba(255, 79, 216, .12), 0 0 13px rgba(255, 79, 216, .24);
}

.uhr-open-mode:active,
.uhr-primary-action:active,
.uhr-object-action:active,
.uhr-quiet-action:active {
    background: rgba(255, 79, 216, .2);
    box-shadow: inset 0 0 18px rgba(255, 79, 216, .2), 0 0 7px rgba(255, 79, 216, .16);
}

.uhr-open-mode:focus-visible,
.uhr-primary-action:focus-visible,
.uhr-object-action:focus-visible,
.uhr-quiet-action:focus-visible,
.uhr-create-form input:focus-visible {
    outline: 1px solid var(--uhr-system-active);
    outline-offset: 3px;
}

.uhr-local-note {
    margin: 16px 0 0;
    color: var(--life-system-muted);
    font-size: var(--font-meta);
    letter-spacing: .06em;
    text-align: center;
}

.uhr-closing-section {
    padding: 28px 30px 24px !important;
}

.uhr-system-message {
    padding-right: 90px;
    color: var(--life-system-active);
    line-height: 1.55;
}

.uhr-footer {
    padding-top: 30px;
}

/* Der Uhrmodus ist ein einzelner magentafarbener OS-Sektor. Der globale
   CRT bleibt als oberste, nicht-interaktive Monitorhaut darüber erhalten. */
.uhr-mode {
    --uhr-object-accent: #FF4FD8;
    position: fixed;
    z-index: 900;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    overflow: hidden;
    isolation: isolate;
    color: var(--uhr-system-active);
    background:
        radial-gradient(ellipse 82% 68% at 50% 42%, rgba(255, 79, 216, .095), transparent 70%),
        linear-gradient(180deg, #09050A 0%, #050508 58%, #080408 100%);
}

.uhr-mode[hidden] {
    display: none;
}

.uhr-mode::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 10px;
    pointer-events: none;
    border: 1px solid rgba(255, 79, 216, .38);
    box-shadow: inset 0 0 50px rgba(255, 79, 216, .07), 0 0 18px rgba(255, 38, 190, .08);
}

.uhr-mode-interface {
    position: relative;
    z-index: 2;
    width: min(1500px, 100%);
    height: 100%;
    min-height: 0;
    margin: 0 auto;
    padding:
        max(20px, env(safe-area-inset-top))
        max(24px, env(safe-area-inset-right))
        max(20px, env(safe-area-inset-bottom))
        max(24px, env(safe-area-inset-left));
    display: grid;
    grid-template-rows: auto minmax(180px, 1fr) auto auto;
    gap: clamp(14px, 2.4vh, 28px);
    overflow: auto;
    overscroll-behavior: contain;
}

.uhr-atmosphere,
.uhr-atmosphere-field {
    position: absolute;
    pointer-events: none;
}

.uhr-atmosphere {
    z-index: 0;
    inset: 0;
    overflow: hidden;
    opacity: .82;
}

.uhr-atmosphere-field {
    border-radius: 50%;
    filter: blur(46px);
    will-change: transform;
}

.uhr-atmosphere-field-a {
    top: -20%;
    left: -14%;
    width: 68%;
    height: 74%;
    background: radial-gradient(ellipse, rgba(255, 79, 216, .18), transparent 68%);
    animation: uhrFieldA 71s ease-in-out -19s infinite alternate;
}

.uhr-atmosphere-field-b {
    right: -18%;
    bottom: -24%;
    width: 74%;
    height: 82%;
    background: radial-gradient(ellipse, rgba(255, 151, 221, .13), transparent 70%);
    animation: uhrFieldB 89s ease-in-out -47s infinite alternate;
}

.uhr-atmosphere-field-c {
    top: 24%;
    left: 31%;
    width: 48%;
    height: 56%;
    background: radial-gradient(ellipse, color-mix(in srgb, var(--uhr-object-accent) 12%, transparent), transparent 72%);
    opacity: .45;
    animation: uhrFieldC 103s ease-in-out -61s infinite alternate;
    transition: background 1.4s ease;
}

.uhr-mode-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 18px;
}

.uhr-mode-header .uhr-quiet-action:last-child {
    justify-self: end;
}

.uhr-quiet-action {
    justify-self: start;
    min-height: 38px;
    padding: 7px 11px;
    color: var(--uhr-system-muted);
    font-size: .72rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.uhr-mode-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 18px;
    color: var(--uhr-system-muted);
    font-size: .66rem;
    letter-spacing: .08em;
    text-align: center;
}

.uhr-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

.uhr-system-time {
    align-self: center;
    justify-self: center;
    text-align: center;
}

.uhr-time-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    line-height: .9;
    text-shadow: 0 0 4px rgba(255, 208, 242, .82), 0 0 18px rgba(255, 79, 216, .5), 0 0 56px rgba(255, 38, 190, .22);
}

.uhr-hours-minutes {
    font-size: clamp(5rem, 16vw, 15rem);
    letter-spacing: .025em;
}

.uhr-seconds {
    margin-left: .05em;
    color: var(--uhr-system-soft);
    font-size: clamp(2.1rem, 6vw, 6rem);
    letter-spacing: .02em;
    opacity: .78;
}

.uhr-date {
    margin-top: clamp(14px, 2.2vh, 26px);
    color: var(--uhr-system-muted);
    font-size: clamp(.7rem, 1.3vw, .92rem);
    letter-spacing: .15em;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(255, 79, 216, .18);
}

.uhr-object-region {
    width: min(720px, 100%);
    margin: 0 auto;
}

.uhr-object-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

.uhr-object {
    --object-accent: #FF4FD8;
    position: relative;
    overflow: hidden;
    min-width: 0;
    padding: 13px 14px 12px;
    border: 1px solid color-mix(in srgb, var(--object-accent) 48%, transparent);
    background: linear-gradient(120deg, color-mix(in srgb, var(--object-accent) 8%, #050508), rgba(5, 5, 8, .76));
    box-shadow: inset 0 0 22px color-mix(in srgb, var(--object-accent) 7%, transparent), 0 0 9px color-mix(in srgb, var(--object-accent) 8%, transparent);
}

.uhr-object::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 2px;
    background: var(--object-accent);
    box-shadow: 0 0 9px var(--object-accent);
    opacity: .72;
}

.uhr-object.is-expired {
    border-color: color-mix(in srgb, var(--object-accent) 82%, white 18%);
    background: linear-gradient(120deg, color-mix(in srgb, var(--object-accent) 15%, #050508), rgba(5, 5, 8, .84));
    animation: uhrExpiredPulse 2.8s ease-in-out infinite;
}

.uhr-object-readout {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: .6em;
    min-height: 2.4rem;
    font-size: clamp(1.2rem, 2vw, 1.65rem);
}

.uhr-object-label {
    overflow: hidden;
    min-width: 0;
    letter-spacing: .07em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.uhr-object-time {
    flex: none;
    font-variant-numeric: tabular-nums;
    letter-spacing: .07em;
}

.uhr-object-timer .uhr-object-readout > * {
    color: transparent;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--object-accent) 82%, white 18%) 0 var(--progress, 100%),
        color-mix(in srgb, var(--object-accent) 25%, #777 75%) var(--progress, 100%) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 9px color-mix(in srgb, var(--object-accent) 12%, transparent);
}

.uhr-object-stopwatch:not(.is-paused) .uhr-object-readout {
    animation: uhrStopwatchActivity 4s ease-in-out infinite;
}

.uhr-object-stopwatch.is-paused .uhr-object-readout {
    opacity: .55;
}

.uhr-object-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .8s ease, visibility .8s ease;
}

.uhr-object-action {
    min-height: 31px;
    padding: 5px 8px;
    border-color: color-mix(in srgb, var(--object-accent) 38%, transparent);
    color: color-mix(in srgb, var(--object-accent) 72%, white 28%);
    font-size: .6rem;
}

.uhr-controls {
    width: min(1120px, 100%);
    margin: 0 auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .8s ease, visibility .8s ease;
}

.uhr-controls.is-awake {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.uhr-mode.is-controls-awake .uhr-mode-header .uhr-quiet-action,
.uhr-mode.is-controls-awake .uhr-object-actions {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.uhr-mode:not(.is-controls-awake) .uhr-mode-interface {
    grid-template-rows: 1fr auto auto 1fr;
}

.uhr-mode:not(.is-controls-awake) .uhr-object-actions,
.uhr-mode:not(.is-controls-awake) .uhr-controls {
    display: none;
}

.uhr-mode:not(.is-controls-awake) .uhr-object {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.uhr-mode:not(.is-controls-awake) .uhr-object::before {
    visibility: hidden;
}

.uhr-mode:not(.is-controls-awake) .uhr-object.is-expired {
    animation: none;
}

.uhr-create-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.uhr-create-form {
    min-width: 0;
    padding: 13px;
    border: 1px solid rgba(255, 79, 216, .28);
    background: rgba(7, 5, 8, .82);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    align-items: end;
}

.uhr-control-title {
    grid-column: 1 / -1;
    color: var(--uhr-system-soft);
    font-size: .68rem;
    letter-spacing: .12em;
}

.uhr-label-field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.uhr-label-field > span,
.uhr-duration-fields legend,
.uhr-duration-fields label > span {
    color: var(--uhr-system-muted);
    font-size: .56rem;
    letter-spacing: .07em;
}

.uhr-create-form input {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 6px 8px;
    border: 1px solid rgba(255, 79, 216, .3);
    border-radius: 0;
    color: var(--uhr-system-active);
    background: rgba(5, 5, 8, .82);
    font: inherit;
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
}

.uhr-duration-fields {
    grid-column: 1;
    margin: 0;
    padding: 0;
    border: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.uhr-duration-fields legend {
    margin-bottom: 5px;
}

.uhr-duration-fields label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 4px;
}

.uhr-duration-fields input {
    text-align: center;
}

.uhr-primary-action {
    grid-column: 2;
    grid-row: 2 / span 2;
    min-height: 43px;
    padding: 8px 12px;
    color: var(--uhr-system-active);
    font-size: .66rem;
}

.uhr-stopwatch-ready {
    grid-column: 1;
    align-self: center;
    color: rgba(240, 122, 203, .5);
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: .08em;
}

@keyframes uhrPreviewDrift {
    from { transform: translate3d(-4%, -2%, 0) scale(1); }
    to { transform: translate3d(5%, 3%, 0) scale(1.08); }
}

@keyframes uhrFieldA {
    from { transform: translate3d(-6%, -4%, 0) scale(.96); }
    to { transform: translate3d(12%, 9%, 0) scale(1.12); }
}

@keyframes uhrFieldB {
    from { transform: translate3d(7%, 5%, 0) scale(1.08); }
    to { transform: translate3d(-11%, -8%, 0) scale(.94); }
}

@keyframes uhrFieldC {
    from { transform: translate3d(-8%, 4%, 0) scale(.9); }
    to { transform: translate3d(10%, -6%, 0) scale(1.16); }
}

@keyframes uhrExpiredPulse {
    0%, 100% { box-shadow: inset 0 0 22px color-mix(in srgb, var(--object-accent) 8%, transparent), 0 0 8px color-mix(in srgb, var(--object-accent) 10%, transparent); }
    50% { box-shadow: inset 0 0 30px color-mix(in srgb, var(--object-accent) 15%, transparent), 0 0 16px color-mix(in srgb, var(--object-accent) 20%, transparent); }
}

@keyframes uhrStopwatchActivity {
    0%, 100% { opacity: .72; text-shadow: 0 0 3px color-mix(in srgb, var(--object-accent) 20%, transparent); }
    50% { opacity: 1; text-shadow: 0 0 12px color-mix(in srgb, var(--object-accent) 52%, transparent); }
}

@media (max-width: 760px) {
    .uhr-mode-interface {
        grid-template-rows: auto minmax(150px, 1fr) auto auto;
        padding-right: max(14px, env(safe-area-inset-right));
        padding-left: max(14px, env(safe-area-inset-left));
    }

    .uhr-mode-header {
        grid-template-columns: 1fr 1fr;
    }

    .uhr-mode-header .uhr-quiet-action:last-child {
        grid-column: 2;
        grid-row: 1;
    }

    .uhr-hours-minutes {
        font-size: clamp(4.2rem, 22vw, 8rem);
    }

    .uhr-seconds {
        font-size: clamp(1.7rem, 8vw, 3rem);
    }

    .uhr-create-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .uhr-title {
        padding: 18px 14px 16px;
        font-size: 1.32rem;
    }

    .uhr-status-board {
        font-size: .8rem;
        line-height: 1.72;
    }

    .uhr-disclosure summary {
        min-height: 68px;
        padding: 20px 64px 18px 14px;
    }

    .uhr-disclosure-doctor {
        top: 23px;
        right: 14px;
    }

    .uhr-disclosure-content {
        padding: 0 14px 20px;
        font-size: .86rem;
    }

    .uhr-instrument {
        padding: 18px 0;
    }

    .uhr-preview-field {
        min-height: 280px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .uhr-preview-time {
        font-size: clamp(2.5rem, 14vw, 4.1rem);
    }

    .uhr-closing-section {
        padding: 24px 14px 22px !important;
    }

    .uhr-system-message {
        padding-right: 0;
    }

    .uhr-mode::before {
        inset: 5px;
    }

    .uhr-mode-interface {
        gap: 12px;
        padding-top: max(10px, env(safe-area-inset-top));
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .uhr-quiet-action {
        min-height: 36px;
        padding: 6px 8px;
        font-size: .64rem;
    }

    .uhr-mode-status {
        gap: 5px 12px;
        font-size: .56rem;
    }

    .uhr-hours-minutes {
        font-size: clamp(3.6rem, 22vw, 5.5rem);
    }

    .uhr-seconds {
        font-size: clamp(1.35rem, 8vw, 2rem);
    }

    .uhr-date {
        margin-top: 11px;
        font-size: .6rem;
        letter-spacing: .11em;
    }

    .uhr-object-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .uhr-object {
        padding: 10px 11px;
    }

    .uhr-create-form {
        grid-template-columns: minmax(0, 1fr);
        padding: 11px;
    }

    .uhr-label-field,
    .uhr-duration-fields,
    .uhr-stopwatch-ready,
    .uhr-primary-action {
        grid-column: 1;
        grid-row: auto;
    }

    .uhr-primary-action {
        min-height: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .uhr-preview-field::before,
    .uhr-atmosphere-field,
    .uhr-mode .legal-idle-line,
    .uhr-mode .legal-idle-pixel,
    .uhr-object.is-expired {
        animation: none !important;
        transform: none !important;
    }

    .uhr-object-stopwatch .uhr-object-readout {
        animation: none !important;
    }

    .uhr-controls,
    .uhr-object-actions,
    .uhr-quiet-action,
    .uhr-atmosphere-field-c {
        transition: none !important;
    }
}
