:root {
    --wheel-size: 360px;
    --border-size: 8px;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 0;
    padding: 20px;
    background: #fafafa;
}

h1 {
    margin: 0;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.controls label {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
}

.wheel-container {
    position: relative;
    width: var(--wheel-size);
    height: var(--wheel-size);
    display: grid;
    place-items: center;
}

.pointer {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-bottom: 18px solid #222;
    z-index: 3;
}

.wheel {
    width: calc(var(--wheel-size) - (var(--border-size) * 2));
    height: calc(var(--wheel-size) - (var(--border-size) * 2));
    border-radius: 50%;
    border: var(--border-size) solid #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transition: transform 4s cubic-bezier(.1,.8,.1,1);
    will-change: transform;
    z-index: 2;
    position: relative;
}

.hub {
    position: absolute;
    width: 22%;
    height: 22%;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    display: grid;
    place-items: center;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    z-index: 4;
}

button {
    padding: 10px 18px;
    font-size: 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: #222;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.selected-color-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.color-box {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

.result-text {
    font-weight: 600;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.buttons button {
    background: #111;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

#addSliceBtn {
    background: #2ecc71;
}

#addSliceBtn:hover {
    background: #27ae60;
}

#removeSliceBtn {
    background: #e74c3c;
}

#remoceSliceBtn:hover {
    background: #ff1900;
}

.flash {
    animation: flash 700ms ease;
}

@keyframes flash {
    0%{transform: scale(1);}
    50%{transform: scale(1.08);}
    100%{transform: scale(1);}
}