/* tickets.css — MaeloRO 30/09/2026. Soporte del jugador en la portada (paneles #ticketContainer y
   #myTicketsContainer, logica en tickets.js). Mismo lenguaje que los paneles del cliente (morado oscuro + oro
   #c8962a), pero con controles propios: por eso los botones se "resetean" (la portada da a todo <button> el estilo
   grande dorado en mayusculas). */

.panel-card.tk-card {
    max-width: 660px;
    text-align: left;
    padding: 30px 28px 22px;
    --tk-oro: #c8962a;
    --tk-oro2: #e0aa3a;
    --tk-texto: #e6dff5;
    --tk-suave: #9d8fc4;
    --tk-campo: rgba(5, 3, 12, .82);
    --tk-linea: rgba(140, 80, 200, .26);
    --tk-linea2: rgba(140, 80, 200, .5);
    --tk-pending: #f0a53a;
    --tk-open: #62a4ff;
    --tk-resolved: #4ade80;
    --tk-closed: #8b8398;
}
.panel-card.tk-card h2 { text-align: center; }
.tk-card button { all: unset; box-sizing: border-box; cursor: pointer; font-family: var(--font-body, system-ui, sans-serif); }
.tk-card button:focus-visible,
.tk-card .tk-cat input:focus-visible + .tk-cat-in { outline: 2px solid var(--tk-oro2); outline-offset: 2px; }
.tk-card [hidden] { display: none !important; }
/* la portada da a todo <form> display:flex + gap:14px: aqui el espaciado lo ponen los margenes de cada pieza */
.tk-card form { display: block; gap: 0; }

/* ---------- pestanas ---------- */
.tk-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin: 0 0 20px;
    background: rgba(5, 3, 12, .7);
    border: 1px solid var(--tk-linea);
    border-radius: 10px;
}
.tk-card .tk-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 7px;
    color: var(--tk-suave);
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .3px;
    transition: background .15s, color .15s;
}
.tk-card .tk-tab:hover { color: var(--tk-texto); background: rgba(140, 80, 200, .1); }
.tk-card .tk-tab.on {
    color: #1a0f02;
    background: linear-gradient(135deg, #b58222 0%, var(--tk-oro) 45%, var(--tk-oro2) 100%);
    box-shadow: 0 2px 12px rgba(200, 150, 42, .3);
}
.tk-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #ff5d6c;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 0 0 2px rgba(14, 8, 24, .9);
}
.tk-card .tk-tab.on .tk-badge { box-shadow: none; }

/* globito tambien en el boton "My Tickets" de las opciones */
.panel-action-btn .tk-badge { display: inline-block; margin-left: 8px; vertical-align: middle; font-family: var(--font-body, sans-serif); letter-spacing: 0; }

/* ---------- formulario ---------- */
.tk-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 16px 0 8px;
    color: var(--tk-texto);
    font-size: .86rem;
    font-weight: 700;
    letter-spacing: .3px;
}
.tk-form > .tk-label:first-child { margin-top: 0; }
.tk-cont { color: var(--tk-suave); font-size: .74rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.tk-cont.cerca { color: var(--tk-pending); }

.tk-cats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tk-cat { position: relative; display: block; cursor: pointer; }
.tk-cat input { position: absolute; opacity: 0; pointer-events: none; }
.tk-cat-in {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    height: 100%;
    padding: 12px 6px 10px;
    border: 1px solid var(--tk-linea);
    border-radius: 9px;
    background: var(--tk-campo);
    color: var(--tk-suave);
    text-align: center;
    transition: border-color .15s, background .15s, transform .15s;
    box-sizing: border-box;
}
.tk-cat-in img { width: 28px; height: 28px; image-rendering: pixelated; margin-bottom: 2px; }
.tk-cat-in b { color: var(--tk-texto); font-size: .82rem; }
.tk-cat-in small { font-size: .68rem; line-height: 1.25; }
.tk-cat:hover .tk-cat-in { border-color: var(--tk-linea2); transform: translateY(-1px); }
.tk-cat input:checked + .tk-cat-in {
    border-color: var(--tk-oro);
    background: linear-gradient(180deg, rgba(200, 150, 42, .16), rgba(200, 150, 42, .05));
    box-shadow: 0 0 0 1px rgba(200, 150, 42, .35), 0 4px 16px rgba(200, 150, 42, .15);
}
.tk-cat input:checked + .tk-cat-in b { color: var(--tk-oro2); }

.tk-card .tk-campo {
    display: block;
    width: 100%;
    margin: 0;
    padding: 11px 14px;
    min-height: 0;
    box-sizing: border-box;
    background: var(--tk-campo);
    border: 1px solid var(--tk-linea);
    border-radius: 8px;
    color: var(--tk-texto);
    font: 400 .92rem/1.5 var(--font-body, system-ui, sans-serif);
    text-align: left;
    resize: vertical;
}
.tk-card textarea.tk-campo { min-height: 130px; }
.tk-card .tk-campo:focus { outline: none; border-color: rgba(200, 150, 42, .6); box-shadow: 0 0 0 3px rgba(200, 150, 42, .12); }
.tk-card .tk-campo.mal { border-color: #ff6b6b; box-shadow: 0 0 0 3px rgba(255, 107, 107, .12); }

.tk-drop {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px dashed var(--tk-linea2);
    border-radius: 9px;
    color: var(--tk-suave);
    font-size: .8rem;
    line-height: 1.4;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.tk-drop:hover, .tk-drop.encima { border-color: var(--tk-oro); background: rgba(200, 150, 42, .06); color: var(--tk-texto); }
.tk-drop .tk-clip { font-size: 1.3rem; }
.tk-drop b { color: var(--tk-texto); }

.tk-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tk-thumbs:empty { display: none; }
.tk-thumb { position: relative; width: 84px; height: 64px; border-radius: 7px; overflow: hidden; border: 1px solid var(--tk-linea2); }
.tk-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tk-card .tk-thumb button {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .75);
    color: #fff;
    font-size: .72rem;
    line-height: 20px;
    text-align: center;
}

.tk-msg { min-height: 1.3em; margin: 12px 0 0; font-size: .84rem; text-align: center; color: var(--tk-suave); }
.tk-msg:empty { min-height: 0; margin: 0; }
.tk-msg.mal { color: #ff7b7b; }
.tk-msg.bien { color: var(--tk-resolved); }

.tk-card .tk-boton {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 14px;
    padding: 13px 18px;
    border-radius: 8px;
    background: linear-gradient(135deg, #9a6e15 0%, var(--tk-oro) 40%, var(--tk-oro2) 70%, var(--tk-oro) 100%);
    color: #140b02;
    font-size: .88rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 16px rgba(200, 150, 42, .3);
    transition: filter .15s, transform .15s;
}
.tk-card .tk-boton:hover { filter: brightness(1.08); transform: translateY(-1px); }
.tk-card .tk-boton[disabled] { opacity: .55; cursor: wait; transform: none; }
.tk-card .tk-boton.fantasma {
    background: transparent;
    color: var(--tk-suave);
    border: 1px solid var(--tk-linea2);
    box-shadow: none;
}
.tk-card .tk-boton.fantasma:hover { color: var(--tk-texto); background: rgba(140, 80, 200, .1); }

/* enviado */
.tk-hecho { text-align: center; padding: 18px 4px 6px; }
.tk-hecho .tk-check {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 2rem;
    color: #0e0818;
    background: radial-gradient(circle at 35% 30%, #b9ffd8, var(--tk-resolved));
    box-shadow: 0 0 30px rgba(74, 222, 128, .35);
    animation: tkPop .35s ease;
}
.tk-hecho h3 { margin: 0 0 6px; color: var(--tk-texto); font-size: 1.15rem; }
.tk-hecho p { margin: 0 0 16px; color: var(--tk-suave); font-size: .86rem; line-height: 1.5; }
.tk-fila { display: flex; gap: 10px; }
.tk-fila .tk-boton { margin-top: 0; }
@keyframes tkPop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- lista ---------- */
.tk-lista { display: flex; flex-direction: column; gap: 10px; }
.tk-card .tk-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    padding: 13px 15px;
    border: 1px solid var(--tk-linea);
    border-left: 3px solid var(--tk-c, var(--tk-linea2));
    border-radius: 10px;
    background: rgba(255, 255, 255, .025);
    transition: background .15s, border-color .15s, transform .15s;
}
.tk-card .tk-item:hover { background: rgba(140, 80, 200, .09); transform: translateX(2px); }
.tk-item-tit { color: var(--tk-texto); font-weight: 700; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-item-meta { grid-column: 1 / -1; color: var(--tk-suave); font-size: .74rem; }
.tk-item.nuevo { background: rgba(200, 150, 42, .07); border-color: rgba(200, 150, 42, .35); }
.tk-nuevo { color: var(--tk-oro2); font-weight: 700; }
.tk-nuevo::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--tk-oro2); box-shadow: 0 0 8px var(--tk-oro2); vertical-align: 1px; }

.tk-estado {
    align-self: start;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--tk-c);
    background: color-mix(in srgb, var(--tk-c) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--tk-c) 40%, transparent);
    white-space: nowrap;
}
.tk-c-Pending { --tk-c: var(--tk-pending); }
.tk-c-Open { --tk-c: var(--tk-open); }
.tk-c-Resolved { --tk-c: var(--tk-resolved); }
.tk-c-Closed { --tk-c: var(--tk-closed); }

.tk-vacio { text-align: center; padding: 26px 10px; color: var(--tk-suave); font-size: .88rem; line-height: 1.6; }
.tk-vacio .tk-vacio-ico { font-size: 2.2rem; display: block; margin-bottom: 6px; opacity: .8; }
.tk-card .tk-enlace { color: var(--tk-oro2); font-weight: 700; text-decoration: none; cursor: pointer; }
.tk-card .tk-enlace:hover { text-decoration: underline; }
.tk-cargando { text-align: center; color: var(--tk-suave); font-size: .85rem; padding: 20px; }

/* ---------- conversacion ---------- */
.tk-conv-cab { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--tk-linea); }
.tk-card .tk-atras { color: var(--tk-suave); font-size: .8rem; display: inline-block; margin-bottom: 10px; }
.tk-card .tk-atras:hover { color: var(--tk-oro2); }
.tk-conv-fila { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tk-conv-tit { margin: 0; color: var(--tk-texto); font-size: 1.05rem; font-weight: 700; line-height: 1.35; word-break: break-word; }
.tk-conv-meta { margin-top: 5px; color: var(--tk-suave); font-size: .75rem; }

.tk-hilo {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 52vh;
    overflow-y: auto;
    padding: 2px 4px 6px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(140, 80, 200, .45) transparent;
}
.tk-burbuja { max-width: 86%; display: flex; flex-direction: column; gap: 5px; }
.tk-burbuja.mia { align-self: flex-end; align-items: flex-end; }
.tk-burbuja.staff { align-self: flex-start; }
.tk-quien { font-size: .72rem; color: var(--tk-suave); padding: 0 4px; }
.tk-quien b { color: var(--tk-texto); }
.tk-burbuja.staff .tk-quien b { color: var(--tk-oro2); }
.tk-sello {
    display: inline-block;
    margin-right: 5px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .5px;
    color: #140b02;
    background: var(--tk-oro);
    vertical-align: 1px;
}
.tk-texto {
    padding: 11px 14px;
    border-radius: 14px;
    font-size: .88rem;
    line-height: 1.55;
    color: var(--tk-texto);
    white-space: pre-wrap;
    word-break: break-word;
}
.tk-burbuja.mia .tk-texto { background: rgba(140, 80, 200, .2); border: 1px solid rgba(160, 110, 230, .35); border-bottom-right-radius: 4px; }
.tk-burbuja.staff .tk-texto { background: rgba(200, 150, 42, .09); border: 1px solid rgba(200, 150, 42, .32); border-bottom-left-radius: 4px; }
.tk-texto a { color: var(--tk-oro2); word-break: break-all; }
.tk-imgs { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-burbuja.mia .tk-imgs { justify-content: flex-end; }
.tk-card .tk-img {
    display: block;
    width: 120px;
    height: 84px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--tk-linea2);
    background: #07040f;
    cursor: zoom-in;
}
.tk-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.tk-img:hover img { transform: scale(1.05); }

.tk-aviso {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 9px;
    font-size: .82rem;
    line-height: 1.5;
    text-align: center;
    color: var(--tk-suave);
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--tk-linea);
}
.tk-aviso.verde { color: #bdf5d2; border-color: rgba(74, 222, 128, .35); background: rgba(74, 222, 128, .06); }

.tk-resp { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--tk-linea); }
.tk-resp-caja {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 6px;
    background: var(--tk-campo);
    border: 1px solid var(--tk-linea);
    border-radius: 12px;
}
.tk-resp-caja:focus-within { border-color: rgba(200, 150, 42, .6); box-shadow: 0 0 0 3px rgba(200, 150, 42, .1); }
.tk-card .tk-resp-caja textarea {
    flex: 1;
    min-height: 40px;
    max-height: 200px;
    margin: 0;
    padding: 9px 8px;
    border: none;
    background: transparent;
    color: var(--tk-texto);
    font: 400 .9rem/1.45 var(--font-body, system-ui, sans-serif);
    text-align: left;
    resize: none;
    box-shadow: none;
    outline: none;
}
.tk-card .tk-icono {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    color: var(--tk-suave);
}
.tk-card .tk-icono:hover { background: rgba(140, 80, 200, .14); color: var(--tk-texto); }
.tk-card .tk-icono.enviar { color: #140b02; background: linear-gradient(135deg, #b58222, var(--tk-oro2)); }
.tk-card .tk-icono.enviar:hover { filter: brightness(1.1); }
.tk-card .tk-icono[disabled] { opacity: .5; cursor: wait; }
.tk-resp-pie { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; font-size: .72rem; color: var(--tk-suave); }
.tk-card .tk-resuelto {
    padding: 6px 11px;
    border-radius: 7px;
    border: 1px solid rgba(74, 222, 128, .4);
    color: #9ff0c0;
    font-size: .74rem;
    font-weight: 700;
}
.tk-card .tk-resuelto:hover { background: rgba(74, 222, 128, .1); }

.tk-card .tk-volver { margin: 18px 0 0; text-align: center; }
.tk-card .tk-volver a { color: var(--tk-oro2); font-size: .84rem; text-decoration: none; }

/* ---------- visor de imagenes ---------- */
.tk-visor {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(3, 1, 8, .9);
    backdrop-filter: blur(4px);
    cursor: zoom-out;
    animation: tkFundido .15s ease;
}
.tk-visor img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .7); }
@keyframes tkFundido { from { opacity: 0; } to { opacity: 1; } }

/* ---------- telefono ---------- */
@media (max-width: 640px) {
    .panel-card.tk-card { padding: 22px 14px 16px; }
    .tk-cats { grid-template-columns: repeat(3, 1fr); }
    .tk-cat-in small { display: none; }
    .tk-burbuja { max-width: 94%; }
    .tk-hilo { max-height: 58vh; }
    .tk-card .tk-tab { font-size: .82rem; padding: 9px 6px; }
    .tk-fila { flex-direction: column; }
}
