/* Bloque 17, E2: temas VIP de la página y ajustes de vista (para todos).
   El tema sale del servidor en <html data-gdt-tema="x">: Clásico y sin VIP = sin atributo, nada de esto se aplica.
   [data-gdt-tema="clasico"] solo existe para las maquetas de /cartera.
   El acento sigue verde en todos los temas: ok y en vivo usan el mismo token, y cambiarlo les cambia el significado.
   Cartas, escudos y chips de estado tienen colores propios: el tema no los toca. */

[data-gdt-tema="clasico"] {
  --gdt-bg: #07090c; --gdt-surface-1: #0d1014; --gdt-surface-2: #14181e; --gdt-surface-3: #1c222a;
  --gdt-border: #232b35; --gdt-border-hi: #323d4a;
  --gdt-text-hi: #f2f5f7; --gdt-text: #b8c2cc; --gdt-text-mid: #7f8b98; --gdt-text-lo: #565f6a;
  --tema-nav: rgba(13, 16, 20, .86);
  --tema-fondo: radial-gradient(900px 520px at 50% -140px, rgba(0, 224, 90, .07), transparent 70%);
}
[data-gdt-tema="noche"] {
  --gdt-bg: #060a16; --gdt-surface-1: #0c1324; --gdt-surface-2: #131c33; --gdt-surface-3: #1b2642;
  --gdt-border: #293555; --gdt-border-hi: #3b4a72;
  --gdt-text-hi: #f2f5fb; --gdt-text: #c3cce0; --gdt-text-mid: #a2adc6; --gdt-text-lo: #929eb9;
  --tema-nav: rgba(12, 19, 36, .88);
  --tema-fondo: radial-gradient(1000px 560px at 50% -160px, rgba(92, 124, 255, .16), transparent 70%);
}
[data-gdt-tema="pizarron"] {
  --gdt-bg: #0d1110; --gdt-surface-1: #141918; --gdt-surface-2: #1c2221; --gdt-surface-3: #232a29;
  --gdt-border: #343e3c; --gdt-border-hi: #475452;
  --gdt-text-hi: #f4f6f3; --gdt-text: #c9d0cb; --gdt-text-mid: #a9b2ad; --gdt-text-lo: #9ba4a0;
  --tema-nav: rgba(20, 25, 24, .9);
  --tema-fondo: repeating-linear-gradient(0deg, rgba(255, 255, 255, .012) 0 1px, transparent 1px 44px),
                repeating-linear-gradient(90deg, rgba(255, 255, 255, .012) 0 1px, transparent 1px 44px);
}
[data-gdt-tema="cesped"] {
  --gdt-bg: #040d08; --gdt-surface-1: #09160e; --gdt-surface-2: #0f2016; --gdt-surface-3: #172b1f;
  --gdt-border: #21392b; --gdt-border-hi: #30503d;
  --gdt-text-hi: #f0f7f2; --gdt-text: #bfd0c5; --gdt-text-mid: #9eb2a5; --gdt-text-lo: #8fa597;
  --tema-nav: rgba(9, 22, 14, .9);
  --tema-fondo: repeating-linear-gradient(90deg, rgba(255, 255, 255, .014) 0 90px, transparent 90px 180px);
}
[data-gdt-tema="dorado"] {
  --gdt-bg: #0d0a04; --gdt-surface-1: #161109; --gdt-surface-2: #1f190e; --gdt-surface-3: #2a2214;
  --gdt-border: #3c3220; --gdt-border-hi: #57482e;
  --gdt-text-hi: #f8f4e8; --gdt-text: #d3cbb7; --gdt-text-mid: #b3aa94; --gdt-text-lo: #a59c86;
  --tema-nav: rgba(22, 17, 9, .9);
  --tema-fondo: radial-gradient(1000px 560px at 50% -160px, rgba(255, 201, 71, .13), transparent 70%);
}
[data-gdt-tema="tribuna"] {
  --gdt-bg: #100609; --gdt-surface-1: #190b10; --gdt-surface-2: #221118; --gdt-surface-3: #2d1820;
  --gdt-border: #41232e; --gdt-border-hi: #5c3241;
  --gdt-text-hi: #f8f2f4; --gdt-text: #d4c6cb; --gdt-text-mid: #b5a5ab; --gdt-text-lo: #a9989f;
  --tema-nav: rgba(25, 11, 16, .9);
  --tema-fondo: repeating-linear-gradient(135deg, rgba(255, 255, 255, .012) 0 26px, transparent 26px 52px),
                radial-gradient(1000px 520px at 50% -160px, rgba(190, 40, 80, .13), transparent 70%);
}
[data-gdt-tema="retro"] {
  --gdt-bg: #061012; --gdt-surface-1: #0c1a1d; --gdt-surface-2: #122225; --gdt-surface-3: #1a2a2e;
  --gdt-border: #284247; --gdt-border-hi: #395b61;
  --gdt-text-hi: #f6f0e0; --gdt-text: #d2cbb8; --gdt-text-mid: #b2ac99; --gdt-text-lo: #a29d8c;
  --tema-nav: rgba(12, 26, 29, .9);
  --tema-fondo: repeating-linear-gradient(0deg, rgba(255, 255, 255, .012) 0 2px, transparent 2px 5px);
}

/* La página entera. theme.css y style.css fijan estos dos a mano. */
html[data-gdt-tema] { background-color: var(--gdt-bg) !important; }
html[data-gdt-tema] body { background: var(--tema-fondo), var(--gdt-bg); background-attachment: fixed; }
html[data-gdt-tema] .navbar { background: var(--tema-nav); }
html[data-gdt-tema] .pf-ptabs { background: var(--tema-nav); }
/* Armar: «Mis puntos» y la bienvenida traían grises a mano */
html[data-gdt-tema] .mipts, html[data-gdt-tema] #ob-card { background: var(--gdt-surface-1); }
html[data-gdt-tema] .mipts { border-color: var(--gdt-border); }
html[data-gdt-tema] .mipts-head { background: var(--gdt-surface-2); }
html[data-gdt-tema] .mipts-fecha { border-color: var(--gdt-border); }
html[data-gdt-tema] .mipts-fecha-head:hover { background: var(--gdt-surface-2); }

/* ── Ajustes de vista: para todos, también sin login ── */
html[data-gdt-letra="g"] { font-size: 112.5%; }
html[data-gdt-letra="xg"] { font-size: 125%; }
/* En el celular la barra no crece: se contrarresta la letra para que el avatar y Ingresar no queden afuera. */
@media (max-width: 480px) {
  html[data-gdt-letra="g"] .navbar { zoom: .889; height: calc(var(--gdt-nav-h) / .889); min-height: calc(var(--gdt-nav-h) / .889); }
  html[data-gdt-letra="xg"] .navbar { zoom: .8; height: calc(var(--gdt-nav-h) / .8); min-height: calc(var(--gdt-nav-h) / .8); }
}
html[data-gdt-letra] .carnet-aviso-ver { height: auto; min-height: 34px; white-space: nowrap; }
html[data-gdt-menos] { scroll-behavior: auto !important; }
html[data-gdt-menos] *, html[data-gdt-menos] *::before, html[data-gdt-menos] *::after {
  animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
  transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
}
/* Gana a los temas (más especificidad): el contraste es accesibilidad, no se pisa. */
html[data-gdt-contraste] {
  --gdt-text-hi: #ffffff; --gdt-text: #dfe5ea; --gdt-text-mid: #c3ccd4; --gdt-text-lo: #b4bec7;
  --gdt-border: #5a6673; --gdt-border-hi: #7c8896;
}

.nr-vista-btn { flex: none; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 1px solid var(--gdt-border); border-radius: var(--gdt-r-sm); background: transparent; color: var(--gdt-text); }
.nr-vista-btn:hover { border-color: var(--gdt-border-hi); color: var(--gdt-text-hi); }
.nr-vista-btn svg { width: 19px; height: 19px; }
@media (max-width: 360px) {
  .navbar:has(.nr-vista-btn) { padding-left: 4px; padding-right: 4px; gap: 2px; }
  .navbar .nav-right:has(.nr-vista-btn) { gap: 2px; }
  .nr-vista-btn { width: 28px; height: 32px; margin: 0 -4px; border: 0; }
  .nr-vista-btn + .btn-nav-login { padding: 0 7px; font-size: .7rem; letter-spacing: 0; }
}
.nr-vista-btn:focus-visible, .gv-panel button:focus-visible, .gv-panel a:focus-visible, .gv-op input:focus-visible,
.tm-chip:focus-visible { outline: 2px solid var(--gdt-accent); outline-offset: 2px; }

.gv-panel { position: fixed; z-index: 10050; top: calc(var(--gdt-nav-h) + 8px); right: 16px; width: min(320px, calc(100vw - 32px));
  max-height: calc(100vh - var(--gdt-nav-h) - 24px); overflow-y: auto; padding: 1rem; color: var(--gdt-text);
  background: var(--gdt-surface-2); border: 1px solid var(--gdt-border-hi); border-radius: var(--gdt-r-md); box-shadow: var(--gdt-shadow-md); }
.gv-panel[hidden] { display: none; }
.gv-cab { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.gv-cab h2 { margin: 0; font: 600 1rem/1.3 'DM Sans', sans-serif; letter-spacing: 0; color: var(--gdt-text-hi); }
.gv-cerrar { width: 36px; height: 36px; padding: 0; font-size: 1.25rem; line-height: 1; cursor: pointer; border: 0; border-radius: var(--gdt-r-sm);
  background: transparent; color: var(--gdt-text); }
.gv-cerrar:hover { background: var(--gdt-surface-3); color: var(--gdt-text-hi); }
.gv-rot { display: block; margin: 0 0 .4rem; font-size: .85rem; color: var(--gdt-text); }
.gv-letras { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; margin-bottom: .8rem; }
.gv-letras button { min-height: 44px; padding: .3rem; font: 500 .82rem/1.15 'DM Sans', sans-serif; cursor: pointer; border-radius: var(--gdt-r-sm);
  border: 1px solid var(--gdt-border-hi); background: var(--gdt-surface-3); color: var(--gdt-text); }
.gv-letras button[aria-pressed="true"] { border-color: var(--gdt-accent); color: var(--gdt-text-hi); box-shadow: inset 0 0 0 1px var(--gdt-accent); }
.gv-op { display: flex; align-items: flex-start; gap: .55rem; min-height: 44px; padding: .4rem 0; cursor: pointer; font-size: .88rem; color: var(--gdt-text-hi); }
.gv-op input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--gdt-accent); }
.gv-op small { display: block; margin-top: 1px; font-size: .78rem; color: var(--gdt-text); }
.gv-pie { margin: .55rem 0 0; font-size: .78rem; line-height: 1.45; color: var(--gdt-text); }

/* ── Temas en /cartera, pestaña VIP ── */
.tm-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: .45rem; margin-bottom: .7rem; }
.tm-chip { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: .4rem .55rem; text-align: left; cursor: pointer;
  font: 500 .84rem/1.2 'DM Sans', sans-serif; border-radius: var(--gdt-r-sm); border: 1px solid var(--gdt-border-hi);
  background: var(--gdt-surface-2); color: var(--gdt-text-hi); }
.tm-chip[aria-pressed="true"] { border-color: var(--gdt-accent); box-shadow: inset 0 0 0 1px var(--gdt-accent); }
.tm-mues { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--gdt-border-hi);
  background: linear-gradient(135deg, var(--gdt-bg) 0 50%, var(--gdt-surface-3) 50%); }
.tm-maqueta { overflow: hidden; border-radius: var(--gdt-r-md); border: 1px solid var(--gdt-border-hi); color: var(--gdt-text);
  background: var(--tema-fondo), var(--gdt-bg); }
.tm-m-nav { display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; background: var(--tema-nav); border-bottom: 1px solid var(--gdt-border); }
.tm-m-nav b { color: var(--gdt-text-hi); font-size: .85rem; }
.tm-m-nav span { margin-left: auto; padding: .2rem .6rem; border-radius: var(--gdt-r-pill); background: #00e05a; color: #04120a; font-size: .74rem; font-weight: 600; }
.tm-m-cuerpo { padding: .7rem; }
.tm-m-caja { padding: .6rem .7rem; border-radius: var(--gdt-r-sm); background: var(--gdt-surface-1); border: 1px solid var(--gdt-border); }
.tm-m-caja b { display: block; margin-bottom: .35rem; color: var(--gdt-text-hi); font-size: .86rem; }
.tm-m-fila { display: flex; justify-content: space-between; gap: .5rem; padding: .3rem .45rem; margin-top: .25rem; border-radius: 6px;
  background: var(--gdt-surface-2); font-size: .8rem; }
.tm-m-fila i { font-style: normal; color: var(--gdt-accent); font-weight: 600; }
.tm-m-nota { margin: .45rem 0 0; color: var(--gdt-text-mid); font-size: .76rem; }
.tm-accion { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .7rem; margin: .7rem 0 .9rem; }
.tm-accion p { margin: 0; flex: 1 1 220px; font-size: .82rem; color: var(--gdt-text); }
