/* PAGE */

.wheel-page {
    width: min(1300px, calc(100% - 40px));
    margin: 65px auto;
}

.wheel-heading {
    text-align: center;
    margin-bottom: 55px;
}

.wheel-tag {
    display: inline-block;
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.wheel-heading h1 {
    font-size: clamp(30px, 5vw, 44px);
    margin: 0 0 12px;
    font-weight: 800;
}

.wheel-heading p {
    color: var(--text-muted);
    font-size: 16px;
    margin: 0;
}

/* LAYOUT */

.wheel-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    align-items: center;
    gap: 70px;
    max-width: 1050px;
    margin: auto;
}

/* ROUE */

.wheel-container {
    position: relative;
    width: 100%;
    max-width: 530px;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#wheel {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.12));
}

.wheel-pointer {
    position: absolute;
    z-index: 3;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 17px solid transparent;
    border-right: 17px solid transparent;
    border-top: 35px solid var(--color-primary);
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.2));
}

.spin-button {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 105px;
    height: 105px;
    border-radius: 50%;
    border: 7px solid var(--surface);
    background: var(--color-primary);
    color: #171717;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 150ms ease, filter 150ms ease;
    z-index: 2;
}

.spin-button:hover {
    transform: translate(-50%, -50%) scale(1.06);
    filter: brightness(1.05);
}

.spin-button:disabled {
    cursor: not-allowed;
}

.wheel-hint {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 25px;
    text-align: center;
}

/* PARAMÈTRES */

.wheel-settings {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 25px;
}

.settings-header h2 {
    margin: 0 0 5px;
    font-size: 22px;
}

.settings-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.item-count {
    background: var(--color-primary-light);
    color: var(--text);
    padding: 7px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* AJOUT */

.add-item {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.add-item input {
    flex: 1;
    min-width: 0;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--background);
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.add-item input:focus {
    border-color: var(--color-primary);
}

.add-item button {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 9px;
    background: var(--color-primary);
    color: #171717;
    font-size: 25px;
    font-weight: 600;
    cursor: pointer;
}

.add-item img {
  width: 30px;
  height: 30px;
  margin-top: 7.5px;
  margin-left: 1px;
  object-fit: contain;
}

/* LISTE */

.item-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-height: 310px;
    overflow-y: auto;
}

.wheel-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 9px;
}

.wheel-item .item-name {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 4px 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}

.wheel-item .item-name:focus {
    border-bottom: 1px solid var(--color-primary);
}

.item-color {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    border-radius: 4px;
}

.item-name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.remove-item {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 19px;
    cursor: pointer;
    padding: 0 5px;
}

.remove-item:hover {
    color: #e05252;
}

.reset-button {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: background 150ms ease;
}

.reset-button:hover {
    background: var(--background);
}

/* RÉSULTAT */

.result-modal {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
}

.result-modal.active {
    display: flex;
}

.result-card {
    width: 100%;
    max-width: 420px;
    padding: 40px 30px;
    border-radius: 20px;
    background: var(--surface);
    text-align: center;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
    animation: result-appear 250ms ease;
}

.result-label {
    color: var(--color-primary-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
}

.result-card h2 {
    margin: 20px 0 30px;
    font-size: 32px;
    overflow-wrap: anywhere;
}

.result-card button {
    padding: 13px 28px;
    border: none;
    border-radius: 9px;
    background: var(--color-primary);
    color: #171717;
    font-weight: 800;
    cursor: pointer;
}

@keyframes result-appear {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* RESPONSIVE */

@media (max-width: 800px) {
    .wheel-layout {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .wheel-container {
        max-width: 460px;
    }

    .wheel-settings {
        max-width: 530px;
        width: 100%;
        margin: auto;
    }
}

@media (max-width: 600px) {
    .wheel-page {
        width: calc(100% - 25px);
        margin: 40px auto;
    }

    .wheel-heading {
        margin-bottom: 35px;
    }

    .wheel-settings {
        padding: 20px;
    }

    .spin-button {
        width: 80px;
        height: 80px;
        font-size: 12px;
        border-width: 5px;
    }
}