.zufallszahl-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
    gap: 2rem;
    align-items: stretch;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.eyebrow {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(240, 158, 11, 0.15);
    color: #f6bb55;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-note {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
}

.hero-note h2,
.random-controls h2,
.legend-box h3 {
    color: #F09E0B;
}

.zufallszahl-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
    align-items: stretch;
}

.random-stage,
.random-controls {
    background: linear-gradient(180deg, rgba(44, 63, 74, 0.96) 0%, rgba(26, 37, 47, 0.98) 100%);
    border: 1px solid #475569;
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

.random-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    justify-content: flex-start;
}

.random-stage-toolbar {
    display: flex;
    justify-content: flex-end;
}

.fullscreen-button {
    padding: 0.7rem 1rem;
    border: 1px solid rgba(240, 158, 11, 0.45);
    border-radius: 999px;
    background: rgba(240, 158, 11, 0.08);
    color: #f8d08a;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.fullscreen-button:hover {
    background: rgba(240, 158, 11, 0.16);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(240, 158, 11, 0.14);
}

.fullscreen-toolbar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
}

.fullscreen-size-control {
    width: 100%;
    display: grid;
    gap: 0.75rem;
    padding: 1rem 1.2rem;
    border-radius: 14px;
    border: 1px solid rgba(240, 158, 11, 0.24);
    background: rgba(15, 23, 42, 0.45);
}

.fullscreen-size-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: #e2e8f0;
    font-weight: 600;
}

.fullscreen-size-slider {
    width: 100%;
    accent-color: #F09E0B;
    cursor: pointer;
}

.fullscreen-toolbar.hidden {
    display: none;
}

.result-header {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    padding: 2rem 1.5rem;
    text-align: center;
    background:
        radial-gradient(circle at top, rgba(240, 158, 11, 0.26), rgba(240, 158, 11, 0.06) 28%, rgba(15, 23, 42, 0.74) 72%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(240, 158, 11, 0.18);
}

.result-header::before,
.result-header::after {
    content: '';
    position: absolute;
    inset: auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240, 158, 11, 0.18), transparent 68%);
    pointer-events: none;
}

.result-header::before {
    top: -70px;
    left: -30px;
}

.result-header::after {
    right: -40px;
    bottom: -90px;
}

.result-label {
    margin: 0;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
}

.result-header .random-number-display {
    margin: 0.8rem 0;
    font-size: clamp(6.5rem, 22vw, 11.5rem);
    line-height: 0.9;
    color: #ffffff;
    font-family: 'Bebas Nueva', 'Poppins', sans-serif;
    text-shadow: 0 0 18px rgba(240, 158, 11, 0.22);
}

.result-header .random-number-display.is-animating {
    animation: pulseNumber 0.18s ease-in-out infinite alternate;
}

.animation-status {
    margin: 0;
    color: #f8d08a;
    font-weight: 600;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.stat-card {
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid #475569;
    border-radius: 14px;
    padding: 1rem 1.1rem;
}

.stat-card--accent {
    background: linear-gradient(180deg, rgba(240, 158, 11, 0.18), rgba(240, 158, 11, 0.08));
    border-color: rgba(240, 158, 11, 0.35);
}

.stat-label {
    display: block;
    margin-bottom: 0.35rem;
    color: #94a3b8;
    font-size: 0.85rem;
}

.stat-card strong {
    color: #ffffff;
    font-size: 1.25rem;
}

.random-feedback {
    padding: 1rem 1.15rem;
    border-radius: 12px;
    border: 1px solid rgba(240, 158, 11, 0.35);
    background: rgba(240, 158, 11, 0.08);
    color: #f8d08a;
    text-align: center;
    font-weight: 500;
}

.control-intro {
    color: #94a3b8;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.limit-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.limit-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.limit-field label {
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 600;
}

.limit-field input {
    width: 100%;
    padding: 0.8rem 0.95rem;
    border: 1px solid #475569;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.55);
    color: #ffffff;
    font-size: 1rem;
}

.limit-field input:focus {
    outline: 2px solid rgba(240, 158, 11, 0.5);
    outline-offset: 2px;
}

.range-card {
    padding: 1.25rem;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid #475569;
}

.range-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 1rem;
}

#rangeLabel {
    color: #f8d08a;
}

.ruler-track {
    --min-percent: 10%;
    --max-percent: 90%;
    position: relative;
    padding: 1.9rem 0 1.4rem;
}

.ruler-scale {
    position: relative;
    height: 18px;
    border-radius: 999px;
    background:
        repeating-linear-gradient(to right, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px calc(10% - 1px), rgba(255, 255, 255, 0.16) calc(10% - 1px) 10%),
        linear-gradient(180deg, rgba(148, 163, 184, 0.45), rgba(71, 85, 105, 0.75));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 -2px 8px rgba(15, 23, 42, 0.4);
}

.range-highlight {
    position: absolute;
    top: 1.9rem;
    left: var(--min-percent);
    width: calc(var(--max-percent) - var(--min-percent));
    height: 18px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(240, 158, 11, 0.88), rgba(248, 208, 138, 0.9));
    box-shadow: 0 0 16px rgba(240, 158, 11, 0.2);
    pointer-events: none;
}

.range-input {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    inset: 0;
    margin: 0;
    width: 100%;
    background: transparent;
    pointer-events: none;
}

.range-input::-webkit-slider-runnable-track {
    height: 18px;
    background: transparent;
}

.range-input::-moz-range-track {
    height: 18px;
    background: transparent;
    border: none;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    margin-top: -3px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    background: #F09E0B;
    box-shadow: 0 6px 14px rgba(240, 158, 11, 0.28);
    cursor: pointer;
    pointer-events: auto;
}

.range-input::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    background: #F09E0B;
    box-shadow: 0 6px 14px rgba(240, 158, 11, 0.28);
    cursor: pointer;
    pointer-events: auto;
}

.ruler-labels {
    display: grid;
    grid-template-columns: repeat(11, minmax(0, 1fr));
    margin-top: 0.75rem;
    color: #94a3b8;
    font-size: 0.82rem;
}

.ruler-labels span:nth-child(1) {
    text-align: left;
}

.ruler-labels span:not(:first-child):not(:last-child) {
    text-align: center;
}

.ruler-labels span:last-child {
    text-align: right;
}

.button-group {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.button-group button,
.fullscreen-toolbar button {
    flex: 1 1 180px;
    padding: 0.95rem 1.25rem;
    border-radius: 10px;
    font-size: 0.96rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
    border: none;
}

.btn-primary {
    background: #F09E0B;
    color: #1a252f;
}

.btn-primary:hover {
    background: #e89f0b;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(240, 158, 11, 0.24);
}

.legend-box {
    margin-top: 1.5rem;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid #475569;
    color: #cbd5e1;
}

.random-stage:fullscreen {
    --fullscreen-random-scale: 1;
    width: 100%;
    max-width: none;
    min-height: 100vh;
    border-radius: 0;
    padding: 2rem;
    overflow-y: auto;
    background:
        radial-gradient(circle at top, rgba(240, 158, 11, 0.14), rgba(26, 37, 47, 0.94) 30%, rgba(15, 23, 42, 0.98) 100%),
        #111827;
}

.random-stage:fullscreen .random-stage-toolbar,
.random-stage:fullscreen .result-header,
.random-stage:fullscreen .result-stats,
.random-stage:fullscreen .fullscreen-toolbar {
    width: min(calc(1120px * var(--fullscreen-random-scale)), 100%);
    margin-left: auto;
    margin-right: auto;
}

.random-stage:fullscreen .fullscreen-toolbar {
    display: flex;
}

.random-stage:fullscreen .result-header {
    padding: calc(2rem * var(--fullscreen-random-scale)) calc(1.5rem * var(--fullscreen-random-scale));
}

.random-stage:fullscreen .random-number-display {
    font-size: calc(clamp(8rem, 24vw, 16rem) * var(--fullscreen-random-scale));
}

.random-stage:fullscreen .animation-status {
    font-size: calc(1rem * var(--fullscreen-random-scale));
}

.random-stage:fullscreen .result-stats .stat-card {
    padding: calc(1rem * var(--fullscreen-random-scale)) calc(1.1rem * var(--fullscreen-random-scale));
}

.random-stage:fullscreen .result-stats .stat-label {
    font-size: calc(0.85rem * var(--fullscreen-random-scale));
}

.random-stage:fullscreen .result-stats strong {
    font-size: calc(1.25rem * var(--fullscreen-random-scale));
}

.random-stage:fullscreen .random-feedback {
    display: none;
}

@keyframes pulseNumber {
    0% {
        transform: scale(1);
        opacity: 0.92;
    }
    100% {
        transform: scale(1.03);
        opacity: 1;
    }
}

@media (max-width: 980px) {
    .zufallszahl-hero,
    .zufallszahl-layout {
        grid-template-columns: 1fr;
    }

    .result-stats {
        grid-template-columns: 1fr;
    }

    .limit-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .random-stage,
    .random-controls {
        padding: 1.25rem;
    }

    .range-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ruler-labels {
        font-size: 0.72rem;
    }

    .button-group button,
    .fullscreen-toolbar button {
        flex-basis: 100%;
    }
}