:root {
    --pri: #00a693;
    --osc: #2c3e50;
    --osc2: #34495e;
    --bg: #e9eef3;
    --card: #fff;
    --chip: #f6f9fc;
    --chip-b: #dce3eb;
    --danger: #e74c3c;
}

html {
    font-size: 62.5%;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

*,
*::before,
*::after {
    box-sizing: inherit;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Poppins", system-ui, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--osc);
    line-height: 1.6;
    font-size: 1.6rem;
    overflow-x: hidden;
}

header {
    background: var(--osc);
    color: #fff;
    padding: 1rem 12rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

header h1 {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 2.2rem;
    margin: 0;
}

header img {
    height: 4rem;
}

header .inicio {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.8rem 1.2rem;
    border-radius: 0.6rem;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}

header .inicio:hover {
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.titulo-principal {
    text-align: center;
    padding: 2rem 1.5rem;
    color: var(--osc);
    margin: 0;
    font-size: 2.7rem;
    font-weight: 700;
    position: relative;
    overflow: hidden;
}

.titulo-principal::after {
    content: '';
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 25rem;
    height: 0.3rem;
    background: linear-gradient(90deg, transparent, var(--pri), transparent);
}

main {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 3rem;
    flex-wrap: wrap;
    flex: 1;
}

.panel {
    background: var(--card);
    border-radius: 1.5rem;
    box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, .08);
    padding: 2.5rem;
    min-width: 32rem;
    width: 45%;
}

.panel h2 {
    margin: 0 0 1rem;
    font-size: 2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 0.2rem solid var(--pri);
    padding-bottom: 0.8rem;
}

.input-group {
    display: flex;
    gap: 0.8rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.input-group .row {
    display: flex;
    flex: 1;
    min-width: 26rem;
}

.input-group input {
    flex: 1;
    padding: 1.2rem;
    border: 0.1rem solid #ccc;
    border-radius: 0.8rem 0 0 0.8rem;
    outline: none;
    font-size: 1.6rem;
}

.input-group button.primary {
    background: var(--pri);
    color: #fff;
    border: none;
    padding: 1.2rem 1.8rem;
    border-radius: 0 0.8rem 0.8rem 0;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: background 0.2s;
    font-size: 1.6rem;
}

.input-group button.primary:hover {
    background: #009180;
}

.input-group button.ghost {
    background: #eef4f7;
    color: #1f2a33;
    border: 0.1rem solid #d6e0e7;
    padding: 1.2rem 1.4rem;
    border-radius: 0.8rem;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: filter 0.2s;
    font-size: 1.6rem;
}

.input-group button.ghost:hover {
    filter: brightness(.98);
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 36rem;
    overflow-y: auto;
}

li {
    background: var(--chip);
    margin: 0.6rem 0;
    padding: 1rem 1.2rem;
    border-radius: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 0.1rem solid var(--chip-b);
    font-size: 1.6rem;
}

li button {
    border: none;
    background: transparent;
    color: var(--danger);
    font-size: 1.8rem;
    cursor: pointer;
}

.contador {
    margin-top: 1rem;
    font-size: 1.4rem;
    color: #54606b;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.contador i {
    color: var(--pri);
}

.ruleta-wrap {
    position: relative;
    display: flex;
    justify-content: center;
}

canvas#canvas {
    width: 100%;
    max-width: 42rem;
    height: auto;
    display: block;
    margin: auto;
}

.center-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.center-badge .badge {
    width: 7.2rem;
    height: 7.2rem;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, .15);
    border: 0.4rem solid #f0f3f6;
}

.center-badge .badge i {
    font-size: 3.4rem;
    color: var(--danger);
}

.botones {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.botones button {
    padding: 1.2rem 2rem;
    font-weight: 700;
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: filter 0.2s;
}

.eliminar {
    background: var(--osc2);
}

.eliminar:hover {
    background: var(--osc);
}

.girar {
    background: var(--pri);
}

.girar:hover {
    background: #009180;
}

.reiniciar {
    background: var(--osc);
}

.reiniciar:hover {
    background: #1a252f;
}

.modal {
    display: none;
    position: fixed;
    z-index: 20;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: #fff;
    padding: 2.8rem;
    border-radius: 1.4rem;
    text-align: center;
    width: min(56rem, 92vw);
    animation: zoom .25s ease;
}

@keyframes zoom {
    from {
        transform: scale(.9);
        opacity: .7;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h3 {
    margin: 0 0 1rem;
    font-size: 2.2rem;
    color: var(--osc);
}

.modal-content p {
    font-size: 1.8rem;
    margin: 1rem 0 0.4rem;
    color: var(--pri);
    font-weight: 800;
    word-break: break-word;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.4rem;
    flex-wrap: wrap;
}

.modal-actions button {
    padding: 1rem 1.6rem;
    border: none;
    border-radius: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    transition: filter 0.2s;
    font-size: 1.6rem;
}

.btn-close {
    background: var(--osc);
}

.btn-close:hover {
    filter: brightness(.9);
}

.btn-remove {
    background: var(--danger);
}

.btn-remove:hover {
    filter: brightness(.95);
}

.btn-add {
    background: var(--pri);
}

.btn-add:hover {
    background: #009180;
}

.helper {
    font-size: 1.2rem;
    color: #5f6b75;
    text-align: left;
    margin-top: 0.8rem;
}

.modal textarea {
    width: 100%;
    min-height: 18rem;
    resize: vertical;
    padding: 1.2rem;
    border: 0.1rem solid #d6e0e7;
    border-radius: 1rem;
    font-family: inherit;
    font-size: 1.6rem;
}

#confettiCanvas {
    position: fixed;
    inset: 0;
    z-index: 15;
    pointer-events: none;
}

footer {
    background: var(--osc);
    color: white;
    text-align: center;
    padding: 2rem 1.5rem;
    margin-top: auto;
}

footer p {
    margin: 0;
    font-size: 1.4rem;
}

@media (max-width: 992px) {
    .panel {
        width: 100%;
        max-width: 60rem;
    }

    .titulo-principal {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem 1.5rem;
    }

    main {
        padding: 2rem 1.5rem;
    }

    .panel {
        padding: 2rem;
    }

    .titulo-principal {
        font-size: 1.8rem;
        padding: 1.5rem;
    }

    .titulo-principal::after {
        width: 15rem;
    }

    .input-group .row {
        min-width: 100%;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group button.ghost {
        width: 100%;
        justify-content: center;
    }

    .botones button {
        padding: 1.4rem 1.8rem;
        font-size: 1.4rem;
    }

    canvas#canvas {
        max-width: 35rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }

    header img {
        height: 3.2rem;
    }

    .titulo-principal {
        font-size: 1.5rem;
    }

    .titulo-principal::after {
        width: 12rem;
    }

    .panel h2 {
        font-size: 1.8rem;
    }

    .botones {
        flex-direction: column;
        width: 100%;
        align-items: center;
    }

    .botones button {
        width: 100%;
        max-width: 28rem;
        justify-content: center;
    }

    canvas#canvas {
        max-width: 30rem;
    }

    .center-badge .badge {
        width: 6rem;
        height: 6rem;
    }

    .center-badge .badge i {
        font-size: 2.8rem;
    }

    .modal-content {
        padding: 2rem;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
    }
}

@media (max-width: 360px) {
    canvas#canvas {
        max-width: 26rem;
    }

    .center-badge .badge {
        width: 5rem;
        height: 5rem;
    }

    .center-badge .badge i {
        font-size: 2.4rem;
    }
}