﻿/* ============================================
   CENTER AREA
   ============================================ */

.center-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: none;
}

.round-info {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 1rem;
    color: var(--text-dim);
}

.round-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-glow);
    text-shadow: 0 0 10px rgba(184, 230, 184, 0.3);
}

.round-of {
    font-size: 1rem;
    color: var(--text-dim);
}

.round-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Round value display */
.round-value-container {
    position: relative;
    width: 330px;
    height: 330px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(20, 45, 20, 0.4) 0%, rgba(8, 20, 8, 0.2) 70%, transparent 100%);
    border: 1px solid rgba(184, 230, 184, 0.14);
    box-shadow:
        0 0 55px rgba(0, 0, 0, 0.35),
        inset 0 0 35px rgba(0, 0, 0, 0.2);
    /* NO overflow:hidden â€” ring items must not be clipped */
}

.round-value-container::before {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, rgba(8, 20, 8, 0) 35%, rgba(8, 20, 8, 0.55) 100%),
        url('../img/Leuchtende%20Runen%20im%20Mooswald.webp');
    background-size: cover, cover;
    background-position: center, center;
    opacity: 0.22;
    pointer-events: none;
}

.round-value-container::after {
    content: '';
    position: absolute;
    inset: 30px;
    border-radius: 50%;
    border: 1px dashed rgba(184, 230, 184, 0.22);
    pointer-events: none;
}

/* Ring of values */
.round-value-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
}

.ring-value-item {
    position: absolute;
    top: 50%;
    left: 50%;
    /* Fix: center item at anchor, THEN rotate+translate outward */
    transform: translate(-50%, -50%) rotate(var(--item-angle)) translateY(-128px) rotate(calc(-1 * var(--item-angle)));
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
    transition: box-shadow 0.15s, background 0.15s;
}

.ring-value-item:not([data-value^='-']) {
    color: rgba(143, 245, 192, 0.82);
}

.ring-value-item[data-value^='-'] {
    color: rgba(255, 154, 154, 0.82);
}

.ring-value-item.active {
    border: 2px solid var(--accent-gold);
    box-shadow:
        0 0 18px rgba(232, 184, 48, 0.55),
        inset 0 0 14px rgba(232, 184, 48, 0.2);
    color: var(--accent-gold);
    background: rgba(40, 32, 10, 0.65);
}

.ring-value-item.bounce-preview {
    border: 2px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.4);
    color: #fff;
    background: rgba(60, 60, 60, 0.5);
}

.ring-value-item.ring-just-landed {
    animation: ring-land 0.7s ease-out 2;
}

/* Center core */
.round-center-core {
    position: relative;
    z-index: 2;
    width: 168px;
    height: 168px;
    border-radius: 50%;
    border: 2px solid var(--border-moss);
    background: radial-gradient(circle, rgba(20, 45, 20, 0.97) 0%, rgba(8, 20, 8, 0.99) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.5);
    padding: 12px;
}

.round-center-core::before {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: url('../img/logo.webp') center / 56% no-repeat;
    opacity: 0.1;
    pointer-events: none;
}

.round-phase-badge {
    font-size: 0.6rem;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-dim);
    background: rgba(10, 20, 10, 0.5);
    border: 1px solid rgba(184, 230, 184, 0.18);
    border-radius: 999px;
    padding: 2px 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.round-center-icons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3px;
    max-width: 130px;
}

.center-creature-icon {
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.5));
}

/* Phase states */
.round-value-container.phase-sumpf {
    border-color: rgba(61, 191, 122, 0.55);
    box-shadow:
        0 0 40px rgba(0, 0, 0, 0.45),
        0 0 80px rgba(61, 191, 122, 0.22),
        inset 0 0 32px rgba(20, 70, 35, 0.28);
}

.round-value-container.phase-sumpf .round-center-core {
    border-color: rgba(61, 191, 122, 0.4);
}

.round-value-container.phase-sumpf .round-phase-badge {
    color: #8ff5c0;
    border-color: rgba(61, 191, 122, 0.45);
    background: rgba(20, 80, 45, 0.45);
}

.round-value-container.phase-schatten {
    border-color: rgba(208, 68, 68, 0.55);
    box-shadow:
        0 0 40px rgba(0, 0, 0, 0.45),
        0 0 80px rgba(208, 68, 68, 0.22),
        inset 0 0 32px rgba(70, 15, 15, 0.28);
}

.round-value-container.phase-schatten .round-center-core {
    border-color: rgba(208, 68, 68, 0.4);
}

.round-value-container.phase-schatten .round-phase-badge {
    color: #ff9a9a;
    border-color: rgba(208, 68, 68, 0.5);
    background: rgba(90, 20, 20, 0.42);
}

/* Countdown */
.countdown-container {
    position: relative;
    width: var(--countdown-size);
    height: var(--countdown-size);
    display: flex;
    justify-content: center;
    align-items: center;
}

.countdown-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.countdown-ring-bg {
    fill: none;
    stroke: var(--border-moss);
    stroke-width: 5;
}

.countdown-ring-progress {
    fill: none;
    stroke: var(--accent-magic);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.countdown-ring-progress.urgent {
    stroke: var(--accent-danger);
}

.countdown-text {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--text-light);
    z-index: 1;
}

.countdown-text.urgent {
    color: var(--accent-danger);
    animation: pulse-glow 0.5s ease-in-out infinite;
}

/* Turn indicator */
.turn-indicator {
    font-size: 1rem;
    color: var(--accent-magic);
    text-shadow: 0 0 10px rgba(68, 204, 136, 0.3);
    animation: fade-in-up 0.3s ease;
    white-space: nowrap;
}

#turn-player-name {
    font-weight: bold;
}

@media (max-width: 900px) {
    .center-area {
        top: 44%;
        gap: 9px;
    }

    .round-value-container {
        width: 260px;
        height: 260px;
    }

    .round-center-core {
        width: 136px;
        height: 136px;
    }

    .ring-value-item {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
        transform: translate(-50%, -50%) rotate(var(--item-angle)) translateY(-102px) rotate(calc(-1 * var(--item-angle)));
    }
}

@media (max-width: 600px) {
    .center-area {
        top: 35%;
        gap: 5px;
    }

    .round-info {
        font-size: 0.84rem;
    }

    .round-number {
        font-size: 1.35rem;
    }

    .round-value-container {
        width: min(80vw, 320px);
        height: min(80vw, 320px);
    }

    .round-value-container::after {
        inset: clamp(18px, 5.6vw, 26px);
    }

    .round-center-core {
        width: clamp(92px, 25vw, 106px);
        height: clamp(92px, 25vw, 106px);
        padding: 5px;
    }

    .round-phase-badge {
        font-size: 0.48rem;
        letter-spacing: 1.1px;
        padding: 2px 8px;
    }

    .ring-value-item {
        width: 24px;
        height: 24px;
        font-size: 0.66rem;
        transform: translate(-50%, -50%) rotate(var(--item-angle)) translateY(clamp(-122px, -32vw, -95px)) rotate(calc(-1 * var(--item-angle)));
    }

    .round-center-icons {
        max-width: 74px;
        gap: 2px;
    }

    .center-creature-icon {
        width: 16px !important;
        height: 16px !important;
    }

    .countdown-container {
        transform: scale(0.74);
    }

    .turn-indicator {
        font-size: 0.84rem;
        max-width: 90vw;
        text-align: center;
        white-space: normal;
    }
}

@media (max-width: 600px) and (max-height: 820px) {
    .center-area {
        top: 38%;
    }

    .round-value-container {
        width: min(76vw, 296px);
        height: min(76vw, 296px);
    }
}


