/* Estilos generales del cuerpo y el contenedor principal */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f4f8;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    padding: 1rem;
    box-sizing: border-box;
}

/* Pantalla inicial donde estan las cartas que se van revolviendo */
.container {
    background-color: #ffffff;
    border-radius: 1.5rem;
    box-shadow: 0 1.25rem 1.5rem -0.3rem rgba(0, 0, 0, 0.1), 0 0.6rem 0.6rem -0.3rem rgba(0, 0, 0, 0.04);
    position: relative;
    width: 100%;
    max-width: 30rem;
    max-height: 60rem;
    padding: 1.5rem;
    box-sizing: border-box;
}

/* Para el fondo negro de pantalla */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    display: none;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

/* Para las ventanas modales como: Mis cartones, Seleccionar barajas, Desempate, Configuracion*/
.modal-content {
    position: relative;
    background: white;
    padding: 1.25rem;
    border-radius: 0.6rem;
    max-width: 30rem;
    width: 95%;
    box-sizing: border-box;
}

.modal-heading {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    color: #4b5563;
    margin: 0;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.app-container {
    width: 100%;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
}

.button-container {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    width: 100%;
}

.button-secondary {
    background-color: #cbd5e1;
    color: #4a5568;
    font-weight: bold;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    transition: background-color 0.3s ease, transform 0.1s ease, box-shadow 0.1s ease;
    cursor: pointer;
    border: none;
    box-shadow: 0 0.15rem 0.25rem -0.05rem rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.button-secondary:hover {
    background-color: #a0aec0;
    transform: translateY(-0.05rem);
    box-shadow: 0 0.25rem 0.35rem -0.05rem rgba(0, 0, 0, 0.1), 0 0.15rem 0.25rem -0.05rem rgba(0, 0, 0, 0.06);
}

.button-secondary:active {
    background-color: #718096;
    transform: translateY(0);
    box-shadow: inset 0 0.15rem 0.25rem rgba(0, 0, 0, 0.15);
}

.icon-base {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
    background-repeat: no-repeat;
    background-size: contain;
    filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
    transition: filter 0.3s ease;
}

.button-secondary .icon-base {
    filter: invert(29%) sepia(8%) saturate(1478%) hue-rotate(189deg) brightness(97%) contrast(89%);
}

.button-game-control .icon-base {
    filter: invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
}

.icon-cartones {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M4 11h9V4H4v7zm0 9h9v-7H4v7zm10 0h9v-7h-9v7zm0-16v7h9V4h-9z'/%3E%3C/svg%3E");
}

#bottom-player-cartones {
    z-index: 100;
    background-color: #4a90e2;
    position: absolute;
    top: 1rem;
    left: 0.5rem;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0.5rem;
    border-radius: 50%;
}

#remaining-cards-counter {
    position: absolute;
    background-color: #4a90e2;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 1rem;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 0.15rem 0.25rem rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
}

#winning-card-container {
    position: fixed;
    font-size: 4rem;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 1rem;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

#remaining-cards-counter.cheat-mode {
    color: black;
}

#remaining-cards-counter {
    top: 1rem;
    right: 1rem;
}

.history-container {
    width: 100%;
    padding-bottom: 0.5rem;
    box-sizing: border-box;
}

#history-bar {
    height: 6.25rem;
    display: flex;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 1rem 0.5rem 1rem;
    background-color: #edf2f7;
    border-radius: 0.5rem;
    overflow-x: auto;
    white-space: nowrap;
    box-shadow: inset 0 0.05rem 0.2rem rgba(0, 0, 0, 0.1);
    scrollbar-width: thin;
    scrollbar-color: #a0aec0 #edf2f7;
}

#history-bar::-webkit-scrollbar {
    height: 0.5rem;
}

#history-bar::-webkit-scrollbar-track {
    background: #edf2f7;
    border-radius: 0.6rem;
}

#history-bar::-webkit-scrollbar-thumb {
    background: #a0aec0;
    border-radius: 0.6rem;
}

#history-bar::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

#winning-card-container {
    top: 16%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    background-color: #28a745;
}

#card-display {
    width: 100%;
    height: auto;
    object-fit: contain;
    box-shadow: 0 0.25rem 0.35rem -0.05rem rgba(0, 0, 0, 0.1), 0 0.15rem 0.25rem -0.05rem rgba(0, 0, 0, 0.06);
    border: 0.15rem solid #a8c7ed;
    border-radius: 0.75rem;
}

.history-card {
    width: 4rem;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 0.05rem 0.15rem rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

#progress-bar-container {
    width: 100%;
    height: 0.5rem;
    background-color: #e2e8f0;
    border-radius: 0.25rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

#progress-bar {
    height: 100%;
    width: 0%;
    background-color: #4a90e2;
    border-radius: 0.25rem;
    transition: width linear;
}

.bottom-buttons-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    width: 100%;
    justify-items: center;
}

.bottom-buttons-grid .button-game-control,
.bottom-buttons-grid .button-secondary {
    width: 3.15rem;
    height: 3.15rem;
    padding: 0.25rem;
    border-radius: 50%;
    font-size: 1rem;
}

.icon-restart {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.76 0 3.3.73 4.46 1.94L13 11h7V4l-2.35 2.35z'/%3E%3C/svg%3E");
}

.icon-deck {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM16 7H8v2h8V7zm0 4H8v2h8v-2zm-3 4H8v2h5v-2z'/%3E%3C/svg%3E");
}

.icon-play {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
}

.icon-pause {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M6 19h4V5H6v14zm8-14v14h4V5h-4z'/%3E%3C/svg%3E");
}

.icon-desempate {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M10 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h5c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h5v14zm4-16h5c1.1 0 2 .9 2 2v14c0 1.1-.9 2-2 2h-5c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2zm0 16h5V5h-5v14z'/%3E%3C/svg%3E");
}

.icon-settings {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.09-.75-1.72-1.03L14 2.1c-.06-.33-.34-.58-.67-.58h-4c-.33 0-.61.25-.67.58L9.13 4.47c-.63.28-1.21.63-1.72 1.03l-2.49-1c-.22-.09-.49 0-.61.22l-2 3.46c-.12.22-.07.49.12.64l2.11 1.65c-.04.32-.07.64-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24-.42-.12.64l2 3.46c.12.22.39.3.61-.22l2.49-1c.52-.4 1.09.75 1.72 1.03L9.33 21.9c.06.33.34.58.67.58h4c.33 0 .61-.25.67-.58l.2-2.37c.63-.28 1.21-.63 1.72-1.03l2.49 1c.22.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z'/%3E%3C/svg%3E");
}

.button-game-control {
    background-color: #4a90e2;
    color: white;
    font-weight: bold;
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    transition: background-color 0.3s ease, transform 0.1s ease, box-shadow 0.1s ease;
    cursor: pointer;
    border: none;
    box-shadow: 0 0.25rem 0.35rem -0.05rem rgba(0, 0, 0, 0.1), 0 0.15rem 0.25rem -0.05rem rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.125rem;
}

.button-game-control:hover {
    background-color: #357bd8;
    transform: translateY(-0.15rem);
    box-shadow: 0 0.35rem 0.5rem -0.15rem rgba(0, 0, 0, 0.15), 0 0.2rem 0.3rem -0.05rem rgba(0, 0, 0, 0.08);
}

.button-game-control:active {
    background-color: #2b6cb0;
    transform: translateY(0);
    box-shadow: inset 0 0.15rem 0.25rem rgba(0, 0, 0, 0.2);
}

#player-cartones-list-container {
    width: 100%;
    display: flex;
    flex-direction: column-reverse;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    max-height: 95vh;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #a0aec0 #edf2f7;
}

#player-cartones-list-container::-webkit-scrollbar {
    width: 0.6rem;
}

#player-cartones-list-container::-webkit-scrollbar-track {
    background: #edf2f7;
    border-radius: 0.6rem;
}

#player-cartones-list-container::-webkit-scrollbar-thumb {
    background: #a0aec0;
    border-radius: 0.6rem;
}

#player-cartones-list-container::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

.single-player-carton-wrapper {
    width: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 0.25rem 0.35rem -0.05rem rgba(0, 0, 0, 0.1);
    padding: 0.75rem;
}

.carton-title {
    font-size: 1.25rem;
    font-weight: bold;
    text-align: center;
    color: #2d3748;
    margin: 0;
}

.single-player-carton {
    width: 100%;
    display: grid;
    background-color: #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: inset 0 0.15rem 0.25rem rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.carton-card {
    position: relative;
    width: 100%;
    padding-bottom: 150%;
    overflow: hidden;
    border-radius: 0.3rem;
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
    color: #4a5568;
    cursor: pointer;
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
}

.carton-card:active {
    transform: scale(0.98);
    box-shadow: inset 0 0.15rem 0.25rem rgba(0, 0, 0, 0.15);
}

.carton-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease-in-out;
}

.carton-card.marked img {
    filter: grayscale(100%) brightness(50%) sepia(100%) hue-rotate(200deg) saturate(300%) contrast(100%);
}

.carton-card.winning-line img {
    filter: drop-shadow(0 0 0.5rem #FFD700) drop-shadow(0 0 1rem #FF8C00) !important;
    border: 0.2rem solid red;
    box-sizing: border-box;
}

.header-with-back {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f8f9fa;
    border-bottom: 0.05rem solid #e2e8f0;
}

#default-cartons-button,
#clear-cartons-button {
    border: 0.05rem solid #ccc;
    border-radius: 0.3rem;
    cursor: pointer;
    flex: 1;
    max-width: 10rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    background-color: #ffffff;
    color: #4a5568;
    font-weight: bold;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.1s ease, transform 0.1s ease;
}

#default-cartons-button:hover,
#clear-cartons-button:hover {
    background-color: #e2e8f0;
    border-color: #a0aec0;
    box-shadow: 0 0.15rem 0.25rem rgba(0, 0, 0, 0.08);
}

#default-cartons-button:active,
#clear-cartons-button:active {
    transform: translateY(0.05rem);
    box-shadow: inset 0 0.15rem 0.25rem rgba(0, 0, 0, 0.1);
}

.back-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #4a5568;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s, transform 0.1s ease;
}

.back-button:hover {
    background-color: #e2e8f0;
}

.back-button:active {
    transform: translateY(0.05rem);
}

.header-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2d3748;
    text-align: center;
    flex-grow: 1;
    margin: 0;
    padding: 0.25rem 0;
}

.tab-header {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: #e2e8f0;
    border-radius: 1rem;
    padding: 0.35rem;
    margin: 1rem 1.5rem;
    box-shadow: inset 0 0.05rem 0.2rem rgba(0, 0, 0, 0.1);
}

.tab-button {
    flex: 1;
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-radius: 1rem;
    color: #4a5568;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.tab-button.active {
    background-color: #4a90e2;
    color: white;
    box-shadow: 0 0.15rem 0.3rem rgba(0, 0, 0, 0.2);
    transform: translateY(-0.05rem);
}

.tab-button:hover:not(.active) {
    background-color: #cbd5e1;
}

.tab-button:active:not(.active) {
    transform: translateY(0.05rem);
    box-shadow: inset 0 0.05rem 0.2rem rgba(0, 0, 0, 0.2);
}

.item-list-section {
    padding: 0.5rem;
    padding-right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 32.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: auto;
    scrollbar-color: #4a90e2 #f8f9fa;
    overscroll-behavior-y: contain;
}

.item-list-section::-webkit-scrollbar {
    width: 0.6rem;
}

.item-list-section::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 0.6rem;
}

.item-list-section::-webkit-scrollbar-thumb {
    background: #4a90e2;
    border-radius: 0.6rem;
}

.item-list-section::-webkit-scrollbar-thumb:hover {
    background: #357bd8;
}

.item-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #fff;
    border: 0.05rem solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 0.05rem 0.2rem rgba(0, 0, 0, 0.05);
}

.item-label:hover {
    border-color: #a8c7ed;
    box-shadow: 0 0.15rem 0.35rem rgba(0, 0, 0, 0.1);
}

.item-label.selected {
    border-color: #4a90e2;
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.3);
}

.item-label.disabled-option {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f1f5f9;
}

.item-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-grow: 1;
}

.item-image {
    width: 3.5rem;
    height: 5rem;
    border-radius: 0.5rem;
    object-fit: cover;
    box-shadow: 0 0.15rem 0.25rem rgba(0, 0, 0, 0.1);
}

.item-image-preview-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 0;
    transition: transform 0.1s ease;
}

.item-image-preview-button:active {
    transform: scale(0.95);
}

.item-emoji {
    font-size: 3rem;
    width: 5rem;
    height: 3.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #e0f2f7;
    border-radius: 0.5rem;
    box-shadow: 0 0.15rem 0.25rem rgba(0, 0, 0, 0.1);
}

.item-description-text {
    display: flex;
    flex-direction: column;
}

.item-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2d3748;
    margin: 0.1rem;
}

.item-subtitle {
    font-size: 1rem;
    color: #718096;
    margin: 0.1rem;
    white-space: pre-line;
}

.hidden-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-control {
    position: relative;
    display: inline-block;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.35rem;
    border: 0.15rem solid #cbd5e0;
    background-color: #ffffff;
    transition: all 0.2s ease-in-out;
    margin-left: 1rem;
    flex-shrink: 0;
}

.custom-control::after {
    content: '';
    position: absolute;
    display: none;
    left: 0.75rem;
    top: 0.35rem;
    width: 0.6rem;
    height: 1.2rem;
    border: solid white;
    border-width: 0 0.2rem 0.2rem 0;
    transform: rotate(45deg);
}

.flex {
    display: flex;
}

.hidden {
    display: none;
}

.hidden-input:checked+.custom-control {
    background-color: #2563eb;
    border-color: #2563eb;
}

.hidden-input:checked+.custom-control::after {
    display: block;
}

.thumbnail-view-modal-container {
    font-family: 'Inter', sans-serif;
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 0.6rem 1rem -0.2rem rgba(0, 0, 0, 0.1), 0 0.25rem 0.35rem -0.15rem rgba(0, 0, 0, 0.05);
    width: 95%;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.thumbnail-view-modal-container h2 {
    font-weight: 800;
    text-align: center;
    color: #374151;
    margin: 0;
    margin-bottom: 0.3rem;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr));
    gap: 0.2rem;
    max-height: 25rem;
    overflow-y: auto;
    padding-right: 0.6rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #4a90e2 #f8f9fa;
    overscroll-behavior-y: contain;
}

.thumbnail-grid::-webkit-scrollbar {
    width: 0.6rem;
}

.thumbnail-grid::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 0.6rem;
}

.thumbnail-grid::-webkit-scrollbar-thumb {
    background: #4a90e2;
    border-radius: 0.6rem;
}

.thumbnail-grid::-webkit-scrollbar-thumb:hover {
    background: #357bd8;
}

.thumbnail-card {
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.35rem -0.05rem rgba(0, 0, 0, 0.1), 0 0.15rem 0.25rem -0.15rem rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.thumbnail-card:hover {
    transform: translateY(-0.3rem);
    box-shadow: 0 0.6rem 1rem -0.2rem rgba(0, 0, 0, 0.1), 0 0.25rem 0.35rem -0.15rem rgba(0, 0, 0, 0.05);
}

.thumbnail-card:active {
    transform: translateY(-0.15rem) scale(0.98);
    box-shadow: inset 0 0.15rem 0.25rem rgba(0, 0, 0, 0.15);
}

.card-image-container {
    position: relative;
    width: 100%;
    padding-bottom: 150%;
    border-radius: 0.35rem;
}

.card-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.desempate-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 0.5rem;
    background-color: #edf2f7;
    border-radius: 0.75rem;
    box-shadow: inset 0 0.15rem 0.25rem rgba(0, 0, 0, 0.1);
    max-width: 40rem;
    overflow-y: auto;
}

.desempate-card {
    position: relative;
    width: 100%;
    padding-bottom: 150%;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 0.25rem 0.35rem rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.desempate-card:hover {
    transform: translateY(-0.2rem);
    box-shadow: 0 0.35rem 0.6rem rgba(0, 0, 0, 0.15);
}

.desempate-card:active {
    transform: translateY(-0.05rem) scale(0.98);
    box-shadow: inset 0 0.15rem 0.25rem rgba(0, 0, 0, 0.2);
}

.desempate-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: none;
}

.desempate-result {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    min-height: 2em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.desempate-result.winner {
    background-color: #d4edda;
    color: #155724;
    border: 0.05rem solid #c3e6cb;
}

.desempate-result.loser {
    background-color: #f8d7da;
    color: #721c24;
    border: 0.05rem solid #f5c6cb;
}

.desempate-reset-button {
    background-color: #6c757d;
    color: white;
    font-weight: bold;
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    transition: background-color 0.3s ease, transform 0.1s ease, box-shadow 0.1s ease;
    cursor: pointer;
    border: none;
    box-shadow: 0 0.25rem 0.35rem -0.05rem rgba(0, 0, 0, 0.1), 0 0.15rem 0.25rem -0.05rem rgba(0, 0, 0, 0.06);
    display: block;
    margin: 1rem auto 0 auto;
    width: fit-content;
}

.desempate-reset-button:hover {
    background-color: #5a6268;
    transform: translateY(-0.15rem);
    box-shadow: 0 0.35rem 0.5rem -0.15rem rgba(0, 0, 0, 0.15), 0 0.2rem 0.3rem -0.05rem rgba(0, 0, 0, 0.08);
}

.desempate-reset-button:active {
    background-color: #495057;
    transform: translateY(0);
    box-shadow: inset 0 0.15rem 0.25rem rgba(0, 0, 0, 0.2);
}

#desempate-modal h2 {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin-top: 0.1rem;
    margin-bottom: 0.5rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    background-color: #f8f9fa;
    box-shadow: 0 0.05rem 0.2rem rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease-in-out;
}

.setting-item:hover {
    box-shadow: 0 0.15rem 0.5rem rgba(0, 0, 0, 0.1);
    transform: translateY(-0.15rem);
}

.setting-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.setting-label {
    font-size: 1.1rem;
    color: #2d3748;
    flex-grow: 1;
    width: 100%;
    margin-bottom: 0.5rem;
}

.toggle-checkbox {
    height: 1.5rem;
    width: 3rem;
    border-radius: 1rem;
    cursor: pointer;
    transition: background-color 200ms cubic-bezier(0.4, 0, 0.2, 1);
    outline: 0.15rem solid transparent;
    outline-offset: 0.15rem;
    background-color: #e2e8f0;
    position: relative;
    display: inline-block;
    vertical-align: middle;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.toggle-checkbox:focus {
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.5);
}

.toggle-checkbox::before {
    content: '';
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 1.5rem;
    height: 1.5rem;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease, box-shadow 0.2s ease;
    box-shadow: 0 0.15rem 0.25rem rgba(0, 0, 0, 0.2);
}

.toggle-checkbox:checked {
    background-color: #4a90e2;
}

.toggle-checkbox:checked::before {
    transform: translateX(1.25rem);
}

.slider-label {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: #4a5568;
}

input[type="range"] {
    width: 100%;
    height: 0.5rem;
    background: #e2e8f0;
    border-radius: 0.3rem;
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: #4a90e2;
    cursor: pointer;
    box-shadow: 0 0.15rem 0.25rem rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease, transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: #4a90e2;
    cursor: pointer;
    box-shadow: 0 0.15rem 0.25rem rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease, transform 0.1s ease;
}

input[type="range"]::-moz-range-thumb:active {
    transform: scale(1.1);
}

#game-end-modal .modal-content {
    text-align: center;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: 0 1.25rem 1.5rem -0.3rem rgba(0, 0, 0, 0.1), 0 0.6rem 0.6rem -0.3rem rgba(0, 0, 0, 0.04);
    width: 95%;
}

#game-end-modal .modal-content h2 {
    font-size: 1.75rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 1rem;
    line-height: 1.2;
}

#game-end-modal .modal-content p {
    font-size: 1.125rem;
    color: #4b5563;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

#game-end-modal .modal-content .button-row {
    display: flex;
    width: 100%;
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
}

#game-end-modal .modal-heading {
    font-size: 1.75rem;
}

.mini-carton-preview-image {
    width: 80%;
    object-fit: cover;
    border-radius: 0.1rem;
}

.container.winner-background {
    background-color: transparent;
}

.full-width-button {
    width: 100%;
    margin-bottom: 1rem;
}

.button-group-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    width: 100%;
    margin-bottom: 1rem;
}

.confeti {
    position: absolute;
    width: 0.5rem;
    height: 0.875rem;
    background-color: red;
    opacity: 0.9;
    pointer-events: none;
}

@keyframes volar {
    to {
        transform: translate(var(--dx), var(--dy)) rotate(720deg);
        opacity: 0;
    }
}

/* Pantallas pequeñas (celulares) */
@media (max-width: 480px) {

    .container,
    .modal-content {
        max-width: 25rem;
        max-height: 50rem;
    }
}

/* Pantallas medianas (tabletas, móviles más grandes) */
@media (min-width: 480px) {

    .container,
    .modal-content {
        max-width: 28rem;
        max-height: 56rem;
    }
}

/* Pantallas de tabletas a escritorios pequeños */
@media (min-width: 640px) {

    .container,
    .modal-content {
        max-width: 34rem;
        max-height: 68rem;
    }
}

/* Pantallas de escritorio */
@media (min-width: 768px) {

    .container,
    .modal-content {
        max-width: 36rem;
        max-height: 72rem;
    }
}

@media (min-width: 900px) {

    .container,
    .modal-content {
        max-width: 38rem;
        max-height: 76rem;
    }
}

@media (min-width: 1024px) {

    .container,
    .modal-content {
        max-width: 40rem;
        max-height: 80rem;
    }
}

@media (min-width: 1280px) {

    .container,
    .modal-content {
        max-width: 45rem;
        max-height: 90rem;
    }
}
