.measure-container {
    max-width: 800px;
    margin: 0 auto;
}

/* === Mérleg terület === */
.measure-area {
    display: flex;
    justify-content: center;
    position: relative;
    width: 100%;

    padding-top: 10rem;
}

/* === Forgó mérlegrendszer (gerenda + karok + tányérok) === */
.scale-system {
    position: absolute;
    top: 3px;
    left: 50%;
    margin-left: -170px;
    width: 340px;
    transform-origin: 170px 7px;
    transition: transform 0.4s ease-out;
    z-index: 3;
}

/* Kar: gerenda végétől felfelé a tányérhoz */
.pan-arm {
    position: absolute;
    bottom: calc(100% - 6px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pan-arm.left-arm {
    left: 2px;
    transform: translateX(-50%);
}

.pan-arm.right-arm {
    right: 2px;
    transform: translateX(50%);
}

/* === Serpenyők / Tányérok === */
.measure-pan {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.4s ease-out;
    transform-origin: bottom center;
}

.measure-pan.highlight .measure-basket::after {
    background: linear-gradient(180deg, #c6f6d5, #9ae6b4, #68d391);
}

.measure-pan.balanced .measure-basket::after {
    background: linear-gradient(180deg, #c6f6d5, #9ae6b4, #68d391);
    animation: balance-glow 1s ease-in-out infinite alternate;
}

@keyframes balance-glow {
    from {
        box-shadow: 0 0 15px rgba(72, 187, 120, 0.5);
    }

    to {
        box-shadow: 0 0 30px rgba(72, 187, 120, 0.9);
    }
}

/* Összeg kijelző */
.pan-sum {

    font-weight: bold;
    color: #5D4E37;
    background: rgba(255, 255, 255, 0.92);
    padding: 0.2rem 0.65rem;
    border-radius: 8px;
    margin-bottom: 0.3rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);


    text-align: center;

    width: 110%;

    background: linear-gradient(180deg, #fff, #e8e8e8, #ccc);
    border-radius: 1rem 1rem 6rem 6rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);


}

/* Tányér - lapos platform a gerenda tetején */
.measure-basket {
    width: 160px;
    min-height: 20px;
    display: flex;
    flex-wrap: wrap-reverse;
    justify-content: center;
    align-content: flex-start;
    gap: 2px;
    padding: 30px 2px 2px 2px;
    position: relative;
    transition: all 0.3s ease;
}



/* === Mérleg állvány === */
.measure-stand {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 200px;
    height: 220px;
}

/* Dísz gömb a gerenda közepén */
.beam-finial {
    width: 24px;
    height: 24px;
    background: radial-gradient(circle at 35% 35%, #FFE066, #DAA520, #B8860B);
    border-radius: 50%;
    position: absolute;
    top: -2px;
    left: 50%;
    margin-left: -12px;
    z-index: 5;
}


/* Arany gerenda */
.measure-beam {
    width: 100%;
    height: 14px;
    background: linear-gradient(180deg, #FFD700, #DAA520, #B8860B);
    border-radius: 7px;
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.25),
        inset 0 2px 3px rgba(255, 255, 255, 0.4);
}

/* Gerenda végek - gömbölyített dekoráció */
.measure-beam::before,
.measure-beam::after {
    content: '';
    position: absolute;
    top: -3px;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle at 40% 40%, #FFD700, #DAA520);
    border-radius: 50%;
}

.measure-beam::before {
    left: -8px;
}

.measure-beam::after {
    right: -8px;
}

/* Arany oszlop */
.measure-post {
    width: 24px;
    height: calc(100% - 18px);
    background: linear-gradient(90deg, #B8860B, #DAA520, #FFD700, #DAA520, #B8860B);
    position: absolute;
    top: 18px;
    border-radius: 5px;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

/* Oszlop dekoratív gyűrű */
.measure-post::before {
    content: '';
    position: absolute;
    top: 0;
    left: -4px;
    right: -4px;
    height: 10px;
    background: linear-gradient(180deg, #FFD700, #B8860B);
    border-radius: 4px;
}

/* Fa talp */
.measure-base {
    position: absolute;
    bottom: 0;
    width: 180px;
    height: 60px;
    background: linear-gradient(180deg, #D2691E, #A0522D, #8B4513);
    border-radius: 6rem 6rem 1rem 1rem;
    box-shadow:
        0 6px 14px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.15),
        inset 0 -3px 6px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 3;
}



/* Mutató óra / tárcsa */
.measure-dial {
    width: 74px;
    height: 37px;
    background: radial-gradient(ellipse at 50% 100%, #FFFFF0, #FFF8E1, #F5F0DC);
    border-radius: 37px 37px 0 0;
    position: relative;
    overflow: hidden;
    border: 3px solid #B8860B;
    border-bottom: 2px solid #B8860B;
    box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.08);
    margin-bottom: 2px;
}


.measure-dial::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 56px;
    height: 28px;
    transform: translateX(-50%);
    border-radius: 28px 28px 0 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-left: 1px solid rgba(0, 0, 0, 0.05);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

/* Mutató tű */
.measure-needle {
    width: 3px;
    height: 30px;
    background: linear-gradient(180deg, #CC0000, #FF2222);
    position: absolute;
    bottom: -2px;
    left: 50%;
    margin-left: -1.5px;
    border-radius: 2px 2px 0 0;
    transform-origin: bottom center;
    transition: transform 0.4s ease-out;
    z-index: 4;
}

.measure-needle.balanced {
    background: linear-gradient(180deg, #48bb78, #38a169);
}

/* Mutató tű forgáspont gömb */
.measure-needle::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: radial-gradient(circle at 40% 40%, #E53E3E, #C53030);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.measure-needle.balanced::after {
    background: radial-gradient(circle at 40% 40%, #48bb78, #38a169);
}

/* === Súly elemek === */
.measure-piece {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    user-select: none;
    transition: transform 0.2s ease;
}

.measure-piece:not(.preplaced):hover {
    transform: scale(1.1);
}

.measure-piece.preplaced {
    opacity: 0.85;
    cursor: default;
}

/* 1kg súly - kicsi, kék, cseresznye */
.measure-piece.weight-1 {
    width: 28px;
    height: 28px;
    font-size: 0.6rem;
    background: url('./assets/berry.svg') center / 100% no-repeat
}

/* 5kg súly - közepes, zöld, alma */
.measure-piece.weight-5 {
    width: 36px;
    height: 36px;
    font-size: 0.7rem;
    background: url('./assets/ananas.svg') center / 100% no-repeat
}

/* 10kg súly - nagy, piros, dinnye */
.measure-piece.weight-10 {
    width: 44px;
    height: 44px;
    font-size: 0.8rem;
    background: url('./assets/melon.svg') center / 100% no-repeat
}

/* Elhelyezett súlyok (visszavehetők) */
.measure-piece.placed:not(.preplaced) {
    cursor: pointer;
}

.measure-piece.placed:not(.preplaced):hover {
    box-shadow:
        0 0 10px rgba(255, 255, 255, 0.5),
        0 3px 6px rgba(0, 0, 0, 0.2);
}

/* === Súlyok tálcája === */
.measure-tray {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.tray-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.75rem;
}

.tray-pieces {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.tray-pieces .measure-piece {
    cursor: grab;
}

.tray-pieces .measure-piece:active {
    cursor: grabbing;
}

/* === Animációk === */
@keyframes success-bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-6px);
    }

    40%,
    80% {
        transform: translateX(6px);
    }
}

/* === Gombok === */
.measure-container .button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.measure-container .button.green {
    background: linear-gradient(145deg, #48bb78, #38a169);
    color: white;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.measure-container .button.green:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(72, 187, 120, 0.5);
}

.measure-container .button.green:active {
    transform: translateY(0);
}

/* === Reszponzív design === */
@media (max-width: 600px) {
    .measure-container {
        padding: 0.5rem;
        gap: 1rem;
    }

    .measure-area {
        transform: scale(0.75);
        transform-origin: top center;

    }

    .measure-basket {
        width: 120px;
        padding: 3px 6px 16px;
    }

    .scale-system {
        width: 270px;
        margin-left: -135px;
        transform-origin: 135px 7px;
    }

    .pan-sum {
        font-size: 1rem;
        padding: 0.2rem 0.5rem;
    }

    .measure-piece.weight-1 {
        width: 24px;
        height: 24px;
        font-size: 0.5rem;
    }

    .measure-piece.weight-5 {
        width: 30px;
        height: 30px;
        font-size: 0.6rem;
    }

    .measure-piece.weight-10 {
        width: 36px;
        height: 36px;
        font-size: 0.65rem;
    }

    .measure-tray {
        padding: 0.75rem 1rem;
    }

    .tray-pieces {
        gap: 8px;
    }

    .measure-container .game-instructions {
        font-size: 0.95rem;
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 400px) {
    .measure-area {
        transform: scale(0.65);
    }
}

/* === Drag animáció === */
.measure-piece[style*="position: fixed"] {
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    z-index: 10000;
    transform: scale(1.15);
}

/* === Súly színek legendája === */
.weight-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #718096;
}

.weight-legend span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.weight-legend .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.weight-legend .dot.blue {
    background: #4299E1;
}

.weight-legend .dot.green {
    background: #38A169;
}

.weight-legend .dot.red {
    background: #E53E3E;
}