/* Agentes de Bolso: complementa treino.css (mesma base escura, botões e balões). */

.agentes main { max-width: 1080px; }
.ag-screen { max-width: none; }
.ag-screen > .tr-lead, .ag-screen > .tr-best { max-width: 680px; }
.ag-art { display: block; width: 100%; height: auto; }
.ag-link { color: var(--sky); font-weight: 600; }

/* Topo */
.ag-top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ag-selos { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.ag-selos li { width: 18px; height: 18px; border-radius: 6px; border: 2px solid rgba(255, 255, 255, .35); }
.ag-selos li.on { background: linear-gradient(135deg, var(--orange), #FFB800); border-color: transparent; }
.ag-colbtn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); color: #FCFCFD; font-weight: 700; font-size: 14px;
}
.ag-colbtn:hover { background: rgba(255, 255, 255, .18); }

/* Início e escolha */
.ag-trio { display: flex; gap: 8px; max-width: 520px; margin: 8px 0 0; }
.ag-trio .ag-art { width: 33%; }
.ag-starters { display: grid; gap: 12px; margin-top: 20px; }
@media (min-width: 760px) { .ag-starters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ag-starter {
  display: grid; grid-template-columns: 96px 1fr; grid-template-areas: 'art type' 'art name' 'art text'; align-items: center; column-gap: 14px;
  text-align: left; padding: 14px 16px; border-radius: 20px; cursor: pointer; color: #FCFCFD;
  background: rgba(255, 255, 255, .06); border: 2px solid rgba(255, 255, 255, .16); transition: border-color .15s, transform .15s, background-color .15s;
}
.ag-starter:hover { border-color: var(--sky); background: rgba(255, 255, 255, .1); transform: translateY(-2px); }
.ag-starter .ag-art { grid-area: art; }
.ag-starter .ag-type { grid-area: type; justify-self: start; }
.ag-starter-name { grid-area: name; font-size: 24px; }
.ag-starter-text { grid-area: text; color: var(--soft); font-size: 15px; line-height: 1.4; }
@media (min-width: 760px) {
  .ag-starter { grid-template-columns: 1fr; grid-template-areas: 'art' 'type' 'name' 'text'; text-align: center; justify-items: center; row-gap: 6px; padding: 20px; }
  .ag-starter .ag-art { width: 160px; }
  .ag-starter .ag-type { justify-self: center; }
}
.ag-type { display: inline-block; white-space: nowrap; flex: none; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .02em; color: #FFFFFF; background: #0A6CFF; }
.ag-type[data-key="pitch"] { background: #C2410C; }
.ag-type[data-key="pixel"] { background: #5E60CE; }

/* Mapa */
.ag-me-card { display: flex; align-items: center; gap: 16px; padding: 12px 18px 12px 8px; border-radius: 20px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); max-width: 560px; }
.ag-me-card .ag-art { width: 110px; flex: none; }
.ag-me-title { font-size: clamp(26px, 5vw, 36px); margin: 0 0 4px; }
.ag-me-card .ag-sub { margin: 0; }
.ag-sub { color: var(--soft); font-size: 14px; margin: 0; }
.ag-path { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 0; max-width: 640px; }
.ag-node { display: flex; gap: 16px; position: relative; padding-bottom: 20px; }
.ag-node:not(:last-child)::before { content: ''; position: absolute; left: 21px; top: 44px; bottom: 0; width: 3px; background: rgba(255, 255, 255, .15); border-radius: 2px; }
.ag-node.done:not(:last-child)::before { background: var(--sky); }
.ag-node-dot { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 700; font-size: 18px; background: rgba(255, 255, 255, .1); border: 2px solid rgba(255, 255, 255, .2); }
.ag-node.done .ag-node-dot { background: var(--sky); border-color: var(--sky); color: var(--night); }
.ag-node.current .ag-node-dot { background: var(--orange); border-color: var(--orange); color: #1F2044; box-shadow: 0 0 0 6px rgba(255, 122, 26, .25); }
.ag-node.boss .ag-node-dot { border-radius: 50%; }
.ag-node-body { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding-top: 8px; }
.ag-node-body strong { font-size: 17px; }
.ag-node.locked .ag-node-body strong { color: rgba(255, 255, 255, .6); }
.ag-node-state { font-size: 13px; font-weight: 600; color: var(--sky); }
.ag-node.locked .ag-node-state { color: rgba(255, 255, 255, .45); }
.ag-node.current .ag-node-state { color: var(--orange-text); }
.ag-node-body .btn { margin-top: 10px; }

/* Campo de batalha */
.ag-field { display: grid; gap: 10px; padding: 14px; border-radius: 24px; background: linear-gradient(180deg, rgba(77, 166, 255, .14), rgba(255, 255, 255, .03)); border: 1px solid rgba(255, 255, 255, .12); }
.ag-fighter { display: flex; align-items: center; gap: 12px; }
.ag-fighter.foe { flex-direction: row-reverse; }
.ag-art-wrap { flex: none; width: 108px; }
.ag-info { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 16px; background: rgba(5, 7, 13, .55); border: 1px solid rgba(255, 255, 255, .14); }
.ag-name { margin: 0; font-weight: 700; font-size: 18px; line-height: 1.2; }
.ag-info .ag-sub { margin-bottom: 6px; }
.ag-stats { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ag-stats li { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: rgba(255, 255, 255, .12); }
.ag-hp { display: flex; align-items: center; gap: 8px; }
.ag-hp-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); }
.ag-hp-track { flex: 1; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.ag-hp-fill { height: 100%; border-radius: 999px; background: #12B76A; transition: width .5s ease, background-color .3s; }
.ag-hp-fill.low { background: #F04438; }
.ag-hp-text { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }
@media (min-width: 760px) {
  .ag-field { grid-template-columns: 1fr 1fr; gap: 24px; padding: 18px 22px; }
  .ag-fighter.me { order: -1; }
  .ag-fighter.foe { flex-direction: row; }
  .ag-art-wrap { width: 140px; }
}
.ag-chips { list-style: none; margin: 8px 0 0; padding: 0; display: flex; gap: 5px; }
.ag-chips li { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 700; border: 2px dashed rgba(255, 255, 255, .3); color: rgba(255, 255, 255, .45); }
.ag-chips li.on { background: var(--orange); border: 2px solid var(--orange); color: #1F2044; }

.ag-quote { margin-top: 14px; padding: 20px; }
.ag-msg { margin-top: 14px; padding: 14px 18px; border-radius: 16px; background: #FFFFFF; color: var(--text); border-left: 6px solid var(--sky); }
.ag-msg p { margin: 0 0 6px; }
.ag-msg p:last-child { margin: 0; }
.ag-msg.pop { animation: rise .25s ease; }
.ag-msg .tr-sub { color: var(--muted); }
.ag-ask { font-weight: 700; color: var(--title); }
.ag-newcard { display: flex; align-items: center; gap: 6px; font-weight: 700; color: #C2410C; font-size: 14px; }
.ag-choices { margin-top: 12px; }
@media (min-width: 760px) { .ag-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ag-choice strong { display: block; }
.ag-choice-sub { display: block; font-weight: 500; font-size: 13px; opacity: .8; }

/* Animações */
.ag-shake { animation: shake .45s ease; }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.ag-captured { animation: capture .9s ease forwards; }
@keyframes capture { 40% { transform: scale(1.1); } 100% { transform: scale(.15) translateY(80px); opacity: 0; } }
.ag-leave { animation: leave .9s ease forwards; }
@keyframes leave { 100% { transform: translateX(80px); opacity: 0; } }
.ag-fainted { width: 160px; filter: grayscale(1) brightness(.6); transform: rotate(-12deg); margin: 8px 0 12px; }

/* Batalha */
.ag-battle { display: grid; gap: 16px; margin-top: 4px; }
@media (min-width: 900px) {
  .ag-battle { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
  .ag-battle .ag-chat { position: sticky; top: 16px; margin-top: 14px; }
}
.ag-hand { display: grid; gap: 10px; margin-top: 12px; }
.ag-pcard {
  display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 0 0 14px; border-radius: 16px; cursor: pointer; overflow: hidden;
  background: #FFFFFF; color: var(--text); border: 3px solid #FFFFFF; box-shadow: 0 10px 24px rgba(0, 0, 0, .3);
  transition: transform .15s, border-color .15s, opacity .15s;
}
.ag-pcard:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--orange); }
.ag-pcard:disabled { cursor: default; opacity: .5; }
.ag-pcard-head { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #1F2044; color: #FFFFFF; font-weight: 700; font-size: 13px; letter-spacing: .08em; }
.ag-pcard-head .tr-key { background: var(--orange); color: #1F2044; }
.ag-pcard-text { padding: 0 14px; font-size: 15px; line-height: 1.4; }
.ag-pcard.right { opacity: 1; border-color: #12B76A; }
.ag-pcard.right .ag-pcard-head { background: var(--ok); }
.ag-pcard.wrong { opacity: .75; border-color: #F04438; }
.ag-pcard.wrong .ag-pcard-head { background: var(--no); }
.ag-chat { order: -1; }
@media (min-width: 900px) { .ag-chat { order: 0; } }

/* Evolução */
.ag-evo { width: min(260px, 70vw); margin: 8px 0 16px; border-radius: 50%; }
.ag-evo.flash { animation: evo .22s linear infinite alternate; }
@keyframes evo { from { filter: brightness(1); } to { filter: brightness(3) saturate(0); } }
.ag-evo.done { animation: glowin 1s ease; }
@keyframes glowin { 0% { filter: drop-shadow(0 0 0 #FFB800); } 50% { filter: drop-shadow(0 0 30px #FFB800); } 100% { filter: none; } }
.ag-evo-row { display: flex; align-items: center; gap: 12px; margin: 8px 0 16px; max-width: 560px; }
.ag-evo-row figure { margin: 0; flex: 1; text-align: center; }
.ag-evo-row figcaption { font-weight: 600; font-size: 14px; color: var(--soft); }
.ag-evo-arrow .icon { width: 32px; height: 32px; color: var(--orange-text); }
.ag-unlock { border-color: var(--orange); background: rgba(255, 122, 26, .1); max-width: 680px; }
.ag-unlock p { margin: 0; color: var(--soft); }

.ag-selo-big { width: 88px; height: 88px; border-radius: 26px; display: grid; place-items: center; margin: 4px 0 16px; background: linear-gradient(135deg, var(--orange), #FFB800); box-shadow: 0 0 0 8px rgba(255, 122, 26, .2); color: #1F2044; }
.ag-selo-big .icon { width: 44px; height: 44px; stroke-width: 3; }

/* Carta final */
.ag-final { display: grid; gap: 24px; margin-top: 8px; }
@media (min-width: 900px) { .ag-final { grid-template-columns: 360px minmax(0, 1fr); align-items: start; } .ag-final-side .tr-actions:first-child { margin-top: 0; } }
.ag-tcard { width: 100%; max-width: 360px; padding: 14px; border-radius: 24px; background: linear-gradient(135deg, #0A6CFF, #4DA6FF); box-shadow: 0 20px 44px rgba(0, 0, 0, .45); }
.ag-tcard[data-key="pitch"] { background: linear-gradient(135deg, #FF7A1A, #FFB800); }
.ag-tcard[data-key="pixel"] { background: linear-gradient(135deg, #5E60CE, #A5A6F6); }
.ag-tcard > * { background: #0B1730; }
.ag-tcard-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 16px 10px; border-radius: 16px 16px 0 0; }
.ag-tcard-head strong { font-size: 22px; line-height: 1.15; }
.ag-tcard-art { padding: 6px 30px; background: radial-gradient(ellipse at 50% 20%, #0B2A5C, #05070D 75%); }
.ag-tcard-stats { margin: 0; padding: 12px 16px 4px; display: grid; gap: 6px; }
.ag-tcard-stats div { display: flex; justify-content: space-between; gap: 8px; }
.ag-tcard-stats dt { color: #9FB3D1; font-size: 14px; }
.ag-tcard-stats dd { margin: 0; font-weight: 700; }
.ag-tcard-moves { list-style: none; margin: 0; padding: 8px 16px 4px; display: grid; gap: 4px; color: var(--sky); font-weight: 700; }
.ag-tcard-moves li::before { content: '> '; }
.ag-tcard-foot { margin: 0; padding: 8px 16px 16px; border-radius: 0 0 16px 16px; color: var(--orange-text); font-size: 14px; font-weight: 600; }
.ag-final-side .tr-panel { margin-top: 8px; }

/* Coleção */
.ag-dialog {
  width: min(880px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 20px; border: 0; border-radius: 22px;
  background: #0B1730; color: #FCFCFD; box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.ag-dialog::backdrop { background: rgba(5, 7, 13, .75); }
.ag-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; position: sticky; top: -20px; padding: 4px 0 8px; background: #0B1730; z-index: 1; }
.ag-dialog-head h2 { margin: 0; font-size: 22px; color: #FCFCFD; }
.ag-dialog h3 { font-size: 16px; color: var(--sky); margin: 18px 0 10px; }
.ag-dialog .tr-sub { color: var(--soft); }
.ag-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
.ag-mini { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 12px 10px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); }
.ag-mini strong { font-size: 14px; line-height: 1.25; }
.ag-mini span:not(.ag-mini-icon) { font-size: 12px; color: var(--soft); line-height: 1.35; }
.ag-mini.missing { opacity: .55; border-style: dashed; }
.ag-mini-art { width: 72px; height: 72px; }
.ag-mini-art.icon-art { width: 56px; height: 56px; margin: 8px 0; }
.ag-mini-icon { width: 56px; height: 56px; margin: 8px 0; border-radius: 16px; display: grid; place-items: center; font-weight: 700; font-size: 26px; }
.ag-mini-icon.block { background: var(--orange); color: #1F2044; }
.ag-mini-icon.trap { background: rgba(240, 68, 56, .2); color: #FF8A80; }
.ag-mini-icon.trap .icon { width: 30px; height: 30px; }
.ag-mini-icon.q { background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .5); }

@media (prefers-reduced-motion: reduce) {
  .ag-shake, .ag-captured, .ag-leave, .ag-evo.flash, .ag-evo.done, .ag-msg.pop { animation: none; }
  .ag-hp-fill { transition: none; }
}
