:root {
    --night: #11151f;

    --cream: #fffaf2;
    --cream-warm: #f7eadf;

    --mint: #c9dfc9;
    --lilac: #c5afd0;
    --yellow: #f3d56f;
    --peach: #e9aa83;

    --rainbow-blue: #5aa9c9;
    --rainbow-green: #7fbe8c;
    --rainbow-yellow: #efd464;
    --rainbow-orange: #e99b63;
    --rainbow-red: #d96f6f;

    --blue: #5aa9c9;
    --lavender: #c5afd0;

    --ink: #202735;
}

body {

    .player-panel h2,
    .dealer-choice,
    .winner-title {
        font-family:
            "Segoe Print",
            "Bradley Hand",
            "Comic Sans MS",
            cursive;
        font-weight: 400;
    }

    .total-score,
    .round-input {
        color: #6f91b4;

        font-size: 64px;
        font-weight: 400;
        font-style: normal;
        line-height: 1;
        text-align: center;
    }

    margin: 0;
    padding: 24px;
    background-color: #11151f;
    color: #f8f2e8;
}

.app {
    display: flex;
    flex-direction: column;
    max-width: 900px;
    margin: 0 auto;
}

.players {
    display: flex;
    gap: 20px;
    width: 100%;
}

.player-panel {
    position: relative;
    flex: 1;

    background:
        linear-gradient(145deg,
            #fffaf2 0%,
            #f8eee2 55%,
            #eee1e8 100%);

    color: #202735;

    border: 2px solid rgba(255, 250, 242, 0.35);
    border-radius: 38px 38px 52px 52px;

    box-shadow:
        0 14px 32px rgba(0, 0, 0, 0.18);

    padding: 24px;
    text-align: center;

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.player-panel.dealer::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    padding: 6px;

    background: linear-gradient(110deg,
            #8fc5d0,
            #a8cfaa,
            #ead987,
            #eab08d,
            #cba9cf);

    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.player-panel h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.score-label {
    margin: 0;

    color: #8f789b;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.total-score {
    margin: 8px 0 0;
}

.player-panel.editing {
    transform: scale(0.98);
}

.round-input,
.round-label {
    display: none;
}

.player-panel.editing .total-label,
.player-panel.editing .total-score {
    display: none;
}

.player-panel.editing .round-label,
.player-panel.editing .round-input {
    display: block;
}

.round-input {
    width: 100%;
    box-sizing: border-box;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    text-align: center;
    padding: 0;

    caret-color: var(--lavender);
}

.round-input::placeholder {
    color: rgba(141, 111, 176, 0.55);
    opacity: 1;
}

.round-input::-webkit-outer-spin-button,
.round-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.match-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.new-match-button:hover {
    background-color: rgba(255, 250, 242, 0.14);
    border-color: var(--yellow);
}

.new-match-button:active {
    transform: scale(0.97);
}

.new-match-button {
    background-color: rgba(255, 250, 242, 0.08);
    color: var(--cream);
    font-family:
        "Segoe Print",
        "Bradley Hand",
        cursive;
    border: 2px solid rgba(197, 175, 208, 0.7);
    border-radius: 999px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition:
        background-color 0.18s ease,
        transform 0.18s ease,
        border-color 0.18s ease;
}

.hidden {
    display: none;
}

.dealer-choice {
    margin-bottom: 0;
    text-align: left;

    color: var(--yellow);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.dealer-choice p {
    margin: 0;
    font-size: 20px;
}

.undo-button {
    background-color: transparent;
    color: var(--lilac);
    border: none;
    font-family:
        "Segoe Print",
        "Bradley Hand",
        cursive;
    padding: 10px 18px;
    font-size: 16px;
    cursor: pointer;
}

.undo-button:disabled {
    opacity: 0.4;
    cursor: default;
}

.winner-screen {
    position: fixed;
    inset: 0;

    background-color: rgba(3, 12, 24, 0.72);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.winner-screen.hidden {
    display: none;
}

.winner-card {
    width: min(380px, 82vw);
    padding: 36px;

    text-align: center;

    background-color: var(--cream);
    color: var(--ink);
    border-radius: 26px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.winner-trophy {
    font-size: 38px;
    margin-bottom: 10px;
}

.winner-title {
    margin: 0;
    color: var(--ink);
    font-size: 34px;
}

.winner-message {
    color: #796587;
    margin: 8px 0 28px;

    font-size: 16px;
    font-style: italic;
}

.winner-scores {
    margin-bottom: 28px;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.8;
}

.winner-undo-button {
    background-color: transparent;
    color: var(--lilac);
    border: none;
    font-family:
        "Segoe Print",
        "Bradley Hand",
        cursive;
    padding: 10px 18px;
    font-size: 16px;
    cursor: pointer;
}

.winner-new-match-button {
    display: block;

    margin: 0 auto 12px;
    padding: 12px 24px;

    border: none;
    border-radius: 999px;

    background: linear-gradient(100deg,
            #8fc5d0,
            #a8cfaa,
            #ead987,
            #eab08d,
            #cba9cf);
    color: var(--ink);

    font-family:
        "Segoe Print",
        "Bradley Hand",
        cursive;

    font-weight: 400;

    font-size: 16px;
    cursor: pointer;
}

.cabo-popup {
    position: fixed;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background-color: rgba(7, 12, 20, 0.68);

    backdrop-filter: blur(5px);

    z-index: 1000;

    padding: 16px;
    box-sizing: border-box;
}

.cabo-popup.hidden {
    display: none;
}

.cabo-popup-card {
    width: min(420px, 86vw);
    padding: 30px;

    text-align: center;

    background: #fff7ec;

    color: var(--ink);

    box-shadow:
        0 16px 35px rgba(0, 0, 0, 0.22),
        0 0 30px rgba(197, 175, 208, 0.35),
        0 0 55px rgba(90, 169, 201, 0.22);

    position: relative;
    z-index: 1;
    border-radius: 32px;

    max-height: calc(100vh - 32px);
    box-sizing: border-box;
}

.cabo-popup-message {
    max-width: none;
    margin: 0 0 24px;
    overflow-wrap: break-word;

    font-family:
        "Segoe Print",
        "Bradley Hand",
        cursive;

    font-size: 18px;
    line-height: 1.45;
}

.cabo-popup-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.cabo-popup-confirm,
.cabo-popup-cancel {
    padding: 10px 20px;

    border-radius: 999px;

    font-family:
        "Segoe Print",
        "Bradley Hand",
        cursive;

    font-size: 15px;

    cursor: pointer;
}

.cabo-popup-confirm {
    border: none;

    background: linear-gradient(100deg,
            #8fc5d0,
            #a8cfaa,
            #ead987,
            #eab08d,
            #cba9cf);
    color: var(--ink);
}

.cabo-popup-cancel {
    border: none;
    box-shadow: none;
    background: transparent;
    color: #796587;
}

@media (max-height: 500px) and (orientation: landscape) {
    .cabo-popup-card {
        width: min(390px, 82vw);
        padding: 22px 28px;
    }

    .cabo-popup-message {
        max-width: 240px;
        margin: 0 auto 24px;
        overflow-wrap: break-word;
        margin-bottom: 16px;
        font-size: 17px;
        line-height: 1.35;
    }

    .cabo-popup-confirm,
    .cabo-popup-cancel {
        padding: 8px 16px;
        font-size: 14px;
    }
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    margin-bottom: 16px;
    width: 100%;
    position: relative;
}

.round-submit {
    display: none;
    width: 48px;
    height: 48px;
    margin: 12px auto 0;
    border: none;
    border-radius: 50%;
    background: linear-gradient(
        100deg,
        #8fc5d0,
        #a8cfaa,
        #ead987,
        #eab08d,
        #cba9cf
    );

    color: var(--ink);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

/* Cabo custom keypad */
.cabo-keypad {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);

    display: grid;
    grid-template-columns: repeat(3, 72px);
    gap: 10px;

    padding: 14px;
    border-radius: 28px;

    background: rgba(248, 242, 232, 0.96);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);

    z-index: 100;
}
.keypad-button {
    width: 72px;
    height: 52px;

    border: none;
    border-radius: 18px;

    background: rgba(141, 111, 176, 0.12);
    color: #11151f;

    font-size: 24px;
    cursor: pointer;
}

.keypad-submit {
    grid-column: 1 / -1;
    width: 100%;
    background: linear-gradient(
        135deg,
        #91d8cf,
        #f5e47c,
        #efa9b8
    );
}

.cabo-keypad.hidden {
    display: none;
}