/* Estilos globales para "Código Secreto" */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #1d283a 0, #020617 45%, #000 100%);
    color: #e5e7eb;
    padding: 1.5rem;
}

.app-shell {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

a,
a:visited {
    color: #38bdf8;
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: #7dd3fc;
}

.card {
    background: rgba(15, 23, 42, 0.96);
    border-radius: 18px;
    padding: 1.75rem 1.75rem 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow:
        0 22px 60px rgba(15, 23, 42, 0.85),
        0 0 0 1px rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.card-title {
    font-size: clamp(1.5rem, 2.4vw, 1.9rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-title-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 20%, #facc15, #ea580c);
    box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.15);
}

.card-subtitle {
    margin: 0.1rem 0 0;
    font-size: 0.9rem;
    color: #9ca3af;
}

.pill {
    font-size: 0.75rem;
    padding: 0.18rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    color: #9ca3af;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.pill-dot {
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.section {
    margin-top: 1.5rem;
}

.section-title {
    font-size: 0.98rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #9ca3af;
    margin-bottom: 0.4rem;
}

.section-description {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

label {
    display: block;
    font-size: 0.9rem;
    margin: 0.6rem 0 0.25rem;
    color: #d1d5db;
}

input[type="text"],
select {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border-radius: 10px;
    border: 1px solid rgba(55, 65, 81, 0.9);
    background: radial-gradient(circle at top left, #020617, #020617 55%, #020617 100%);
    color: #e5e7eb;
    font-size: 0.92rem;
    outline: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}

input[type="text"]:focus,
select:focus {
    border-color: #38bdf8;
    box-shadow:
        0 0 0 1px rgba(56, 189, 248, 0.6),
        0 0 0 8px rgba(8, 47, 73, 0.85);
}

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.7rem;
    padding: 0.5rem 1.15rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #22c55e, #0ea5e9);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    box-shadow:
        0 14px 40px rgba(34, 197, 94, 0.35),
        0 0 0 1px rgba(15, 23, 42, 0.9);
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        opacity 0.12s ease,
        filter 0.12s ease;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 18px 45px rgba(56, 189, 248, 0.4),
        0 0 0 1px rgba(15, 23, 42, 0.9);
    filter: brightness(1.03);
}

button:active,
.btn:active {
    transform: translateY(0);
    box-shadow:
        0 8px 26px rgba(15, 23, 42, 0.9),
        0 0 0 1px rgba(15, 23, 42, 0.9);
    opacity: 0.95;
}

.btn-secondary {
    background: transparent;
    color: #9ca3af;
    border: 1px solid rgba(148, 163, 184, 0.55);
    box-shadow: none;
}

.btn-secondary:hover {
    color: #e5e7eb;
    border-color: #e5e7eb;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.9);
}

.section-created {
    position: relative;
    padding-top: 2.7rem;
}

.btn-whatsapp-share {
    position: absolute;
    top: 0;
    right: 0;
    margin-top: 0;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow:
        0 12px 28px rgba(22, 163, 74, 0.35),
        0 0 0 1px rgba(15, 23, 42, 0.9);
}

.link-list {
    list-style: none;
    padding-left: 0;
    margin: 0.5rem 0 0;
}

.link-item {
    margin-bottom: 0.4rem;
}

.link-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(31, 41, 55, 0.85);
    font-size: 0.88rem;
}

.link-chip span {
    color: #9ca3af;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.14rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.badge-success {
    background: rgba(22, 163, 74, 0.16);
    color: #bbf7d0;
}

.badge-danger {
    background: rgba(220, 38, 38, 0.2);
    color: #fecaca;
}

.badge-neutral {
    background: rgba(148, 163, 184, 0.22);
    color: #e5e7eb;
}

.muted {
    color: #9ca3af;
}

.layout-two-columns {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 1.4rem;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .card {
        padding: 1rem 0.85rem 0.9rem;
        border-radius: 0;
    }

    .app-shell {
        max-width: 100%;
    }

    .layout-two-columns {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    .stack-row {
        flex-direction: column;
        align-items: flex-start;
    }

    button,
    .btn,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-created {
        padding-top: 0;
    }

    .btn-whatsapp-share {
        position: static;
        width: 100%;
        margin-top: 0;
    }
}

@media (max-width: 640px) {
    .card-title {
        font-size: 1.4rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.7rem;
    }

    .layout-two-columns {
        display: flex;
        flex-direction: column-reverse; /* En móvil, primero turno/formulario y luego info partida */
    }

    .section-title {
        font-size: 1.15rem;
    }

    .section-description,
    label {
        font-size: 1rem;
    }

    input[type="text"],
    select {
        font-size: 1.05rem;
        padding: 0.65rem 0.8rem;
    }

    button,
    .btn,
    .btn-secondary {
        font-size: 1.05rem;
        padding: 0.7rem 1.2rem;
    }

    table {
        font-size: 0.96rem;
    }
}

table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 0.9rem;
    font-size: 0.88rem;
}

th,
td {
    border: 1px solid rgba(31, 41, 55, 0.95);
    padding: 0.4rem 0.55rem;
    text-align: center;
}

th {
    background: radial-gradient(circle at top, #020617 0, #020617 55%, #020617 100%);
    color: #d1d5db;
    font-weight: 600;
}

tbody tr:nth-child(even) {
    background-color: rgba(15, 23, 42, 0.7);
}

tbody tr:nth-child(odd) {
    background-color: rgba(15, 23, 42, 0.4);
}

.alert {
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.alert-error {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.5);
    color: #fecaca;
}

.alert-info {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: #e0f2fe;
}

.waiting-banner {
    margin-top: 1rem;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(250, 204, 21, 0.45);
    background: rgba(250, 204, 21, 0.12);
    color: #fef08a;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.stack-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.footer {
    margin-top: 1.5rem;
    font-size: 0.78rem;
    color: #6b7280;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.footer a {
    font-size: 0.78rem;
}


/* Contenedor de tablas adaptable a móvil */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
    table {
        font-size: 0.82rem;
    }

    th,
    td {
        padding: 0.35rem 0.4rem;
    }
}


/* Indicadores visuales (bolas) para pistas */

.hint-dots {
    display: inline-flex;
    gap: 0.25rem;
    justify-content: center;
}

.hint-dot {
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 999px;
    box-sizing: border-box;
}

.hint-dot--green {
    background: radial-gradient(circle at 30% 20%, #bbf7d0, #22c55e);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.5);
}

.hint-dot--red {
    background: radial-gradient(circle at 30% 20%, #fecaca, #ef4444);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.55);
}

.hint-dot--empty {
    border: 2px solid rgba(55, 65, 81, 0.9);
    background: transparent;
}

.sequence-dots {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.sequence-dot {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.sequence-dot--A { background: #ef4444; }
.sequence-dot--B { background: #3b82f6; }
.sequence-dot--C { background: #22c55e; }
.sequence-dot--D { background: #fde047; }
.sequence-dot--E { background: #fb923c; }
.sequence-dot--F { background: #a855f7; }
.sequence-dot--G { background: #f472b6; }
.sequence-dot--H { background: #a16207; }
.sequence-dot--I { background: #111827; }
.sequence-dot--J { background: #f8fafc; }


/* Teclado numérico táctil */

.keypad {
    margin-top: 0.75rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.keypad-key {
    padding: 0.65rem 0;
    border-radius: 999px;
    border: 1px solid rgba(55, 65, 81, 0.9);
    background: radial-gradient(circle at top, #020617 0, #020617 60%, #020617 100%);
    color: #e5e7eb;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition:
        transform 0.08s ease,
        background-color 0.08s ease,
        box-shadow 0.08s ease;
}

.keypad-key:active {
    transform: translateY(1px);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.9);
    background: #020617;
}

.keypad-key--wide {
    grid-column: span 3;
}

select {
    background: #0b1220;
    color: #f8fafc;
}

select option {
    background: #0b1220;
    color: #f8fafc;
}

.keypad--colors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.keypad-key--color {
    color: #0b1020;
    border-color: rgba(255, 255, 255, 0.55);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.keypad-color-A { background: linear-gradient(135deg, #ef4444, #b91c1c); color: #fff; }
.keypad-color-B { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; }
.keypad-color-C { background: linear-gradient(135deg, #22c55e, #15803d); color: #fff; }
.keypad-color-D { background: linear-gradient(135deg, #fde047, #eab308); color: #1f2937; }
.keypad-color-E { background: linear-gradient(135deg, #fb923c, #ea580c); color: #fff; }
.keypad-color-F { background: linear-gradient(135deg, #a855f7, #7e22ce); color: #fff; }
.keypad-color-G { background: linear-gradient(135deg, #f472b6, #db2777); color: #fff; }
.keypad-color-H { background: linear-gradient(135deg, #a16207, #78350f); color: #fff; }
.keypad-color-I { background: linear-gradient(135deg, #1f2937, #000000); color: #fff; }
.keypad-color-J { background: linear-gradient(135deg, #f8fafc, #e2e8f0); color: #111827; }

@media (max-width: 640px) {
    .keypad-key {
        padding: 0.9rem 0;
        font-size: 1.15rem;
    }
}



