/* =================== Life Pokémon Simulator =================== */
.ghost { background: transparent; }
.title .ball { display: block; width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; border: 4px solid #222; background: linear-gradient(#ef5350 0 46%, #222 46% 54%, #fff 54%); position: relative; animation: wobble 2.6s ease-in-out infinite; }
.title .ball::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; translate: -50% -50%; border-radius: 50%; background: #fff; border: 4px solid #222; }
@keyframes wobble { 0%, 60%, 100% { rotate: 0deg; } 70% { rotate: -14deg; } 80% { rotate: 12deg; } 90% { rotate: -6deg; } }
.logo h1 { font-size: clamp(2.6em, 11vw, 4.2em); }
.metabar { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.metabar span { background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; font-weight: 700; font-size: .88em; }
.heir { background: color-mix(in srgb, var(--good) 14%, var(--card)); border: 1px solid var(--good); border-radius: 12px; padding: 10px 12px; margin: 0; }

/* Vida */
.life { display: flex; flex-direction: column; height: calc(100dvh - 28px); gap: 8px; }
#app:has(.life) { padding-bottom: 14px; }
.top { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; }
.avatar { width: 58px; height: 58px; border-radius: 50%; background: var(--card2); overflow: hidden; display: flex; align-items: flex-end; justify-content: center; flex: none; border: 2px solid var(--accent); }
.avatar img { height: 74px; image-rendering: pixelated; margin-bottom: -10px; }
.who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.who b { font-family: var(--display); font-size: 1.25em; }
.who span, .who em { font-size: .84em; color: var(--muted); font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.purse { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.purse > span { font-weight: 800; font-size: .88em; }
.media { display: flex; flex-direction: column; align-items: center; background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #241c10; border-radius: 10px; padding: 2px 10px; line-height: 1.05; }
.media b { font-family: var(--display); font-size: 1.35em; }
.media small { color: #4b3a1c; font-size: .6em; font-weight: 800; letter-spacing: .1em; }
.logbox { flex: 1; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 14px 12px; }
.year h4 { position: sticky; top: -6px; background: var(--card); padding: 8px 0 4px; font-size: .95em; color: var(--accent); z-index: 1; }
.year p { margin: 3px 0; display: flex; gap: 8px; font-size: .93em; line-height: 1.35; }
.year p span { flex: none; width: 1.3em; text-align: center; }
.year p.age { display: none; }
.year p.good { color: var(--good); }
.year p.bad { color: var(--bad); }
.year p.great { color: var(--accent2); font-weight: 800; }
.year p.moment { font-weight: 800; }
.year p.event { color: var(--muted); }
.year p.evo { color: #b9a6ff; }
.statbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; }
.sb { display: flex; align-items: center; gap: 5px; font-size: .82em; }
.sb div { flex: 1; height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; }
.sb i { display: block; height: 100%; transition: width .5s; }
.sb b { width: 2em; text-align: right; }
.bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.bar button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; font-size: .74em; font-weight: 800; position: relative; }
.bar button span { font-size: 1.6em; }
.bar .age { background: linear-gradient(135deg, var(--accent), #ff5d73); color: #fff; border: 0; }
.bar .en { font-style: normal; color: var(--accent2); font-size: .85em; letter-spacing: 1px; }

/* Modales y hojas */
.modal { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(8, 6, 14, .6); opacity: 0; transition: opacity .25s; }
.modal.in { opacity: 1; }
.modal .card { width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); text-align: center; translate: 0 20px; transition: translate .25s; }
.modal.in .card { translate: 0 0; }
.ev-tag { font-size: .72em; font-weight: 800; letter-spacing: .14em; color: var(--muted); }
.cb { display: inline-block; font-size: .78em; font-weight: 800; color: var(--accent2); background: color-mix(in srgb, var(--accent2) 14%, transparent); border-radius: 99px; padding: 2px 10px; margin-bottom: 6px; }
.art { position: relative; height: 132px; display: flex; align-items: flex-end; justify-content: center; margin: 6px 0; }
.art .tr { height: 128px; image-rendering: pixelated; }
.art .portrait { width: 112px; height: 112px; border-radius: 18px; border: 3px solid var(--line); image-rendering: pixelated; align-self: center; }
.art .monart { height: 112px; image-rendering: pixelated; }
.art .monart.big { height: 128px; filter: drop-shadow(0 0 12px var(--accent2)); }
.art .monart.shiny { filter: drop-shadow(0 0 10px #fff6a0); }
.art.emoji { font-size: 4.5em; align-items: center; }
.art .evolving { animation: evolving 1.5s ease-in; }
@keyframes evolving { 0% { filter: brightness(1); } 60% { filter: brightness(8); scale: 1.1; } 100% { filter: brightness(10); scale: .9; } }
.name-tag { position: absolute; bottom: -4px; left: 50%; translate: -50% 0; background: var(--card2); border: 1px solid var(--line); border-radius: 99px; padding: 1px 10px; font-weight: 800; font-size: .82em; }
.modal h2 { font-size: 1.4em; margin: 6px 0; }
.ev-text { line-height: 1.5; margin: 8px 0 12px; }
.ev-text em { color: var(--accent2); font-style: normal; font-weight: 700; }
.ev-text.res { background: var(--card2); border-radius: 12px; padding: 10px 12px; text-align: left; }
.choices { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.choice { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; position: relative; }
.choice .ch-l { font-weight: 800; }
.choice small { font-size: .82em; }
.choice.dim { opacity: .35; }
.choice:disabled { cursor: default; }
.safe { font-size: .72em; font-weight: 800; letter-spacing: .08em; color: var(--good); text-transform: uppercase; }
.safe.battle { color: var(--accent); }
.risk { position: relative; display: flex; height: 18px; border-radius: 6px; overflow: hidden; font-size: .7em; font-weight: 800; color: #fff; }
.risk i { font-style: normal; display: flex; align-items: center; padding: 0 6px; white-space: nowrap; overflow: hidden; }
.risk .ok { background: var(--good); }
.risk .ko { flex: 1; background: var(--bad); justify-content: flex-end; }
.marker { position: absolute; top: -2px; bottom: -2px; left: 0; width: 4px; background: #fff; box-shadow: 0 0 6px #000; transition: left 1s cubic-bezier(.2, .8, .3, 1); }
.verdict { font-weight: 800; font-family: var(--display); animation: pop .3s; }
.verdict.ok { color: var(--good); }
.verdict.ko { color: var(--bad); }
@keyframes pop { from { scale: 1.5; opacity: 0; } }
.picked { font-weight: 800; color: var(--muted); text-align: left; }
.deltas { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-bottom: 4px; }
.deltas span { font-size: .8em; font-weight: 800; border-radius: 99px; padding: 2px 9px; animation: pop .35s backwards; }
.deltas span:nth-child(2) { animation-delay: .08s; }
.deltas span:nth-child(3) { animation-delay: .16s; }
.deltas span:nth-child(4) { animation-delay: .24s; }
.deltas .pos { background: color-mix(in srgb, var(--good) 20%, transparent); color: var(--good); }
.deltas .neg { background: color-mix(in srgb, var(--bad) 20%, transparent); color: var(--bad); }
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(8, 6, 14, .5); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .25s; }
.sheet.in { opacity: 1; }
.sh { position: relative; width: 100%; max-width: 720px; max-height: 86vh; overflow-y: auto; background: var(--bg2); border-radius: 22px 22px 0 0; border: 1px solid var(--line); padding: 16px 16px 26px; translate: 0 40px; transition: translate .25s; }
.sheet.in .sh { translate: 0 0; }
.sh .x { position: absolute; right: 12px; top: 12px; padding: .25em .65em; }
.sh h3 { font-size: 1.35em; margin-bottom: 4px; padding-right: 40px; }
.sh h5 { margin: 14px 0 6px; font-size: .74em; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.en-big { font-size: .7em; }
.acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.act { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 12px; }
.act .ic { font-size: 1.5em; flex: none; }
.act > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.act small { font-size: .8em; }
.act > i { font-style: normal; font-size: .75em; font-weight: 800; color: var(--accent2); white-space: nowrap; }
.act:disabled { opacity: .45; cursor: not-allowed; }
.toast { position: fixed; left: 50%; top: 14px; translate: -50% -20px; z-index: 60; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 9px 16px; box-shadow: var(--shadow); font-weight: 700; opacity: 0; transition: all .3s; max-width: calc(100vw - 32px); }
.toast.in { opacity: 1; translate: -50% 0; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.pick button { display: flex; flex-direction: column; align-items: center; }
.pick img { height: 64px; image-rendering: pixelated; }
.pick small, .hearts { color: var(--love); letter-spacing: 1px; }
.regs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.regs button { display: flex; flex-direction: column; text-align: left; }
.regs small { font-size: .78em; }

/* Personas */
.people { display: flex; flex-direction: column; gap: 6px; }
.pp { display: flex; align-items: center; gap: 10px; text-align: left; padding: 6px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; position: relative; }
.pp img { width: 52px; height: 52px; object-fit: cover; object-position: top; image-rendering: pixelated; flex: none; }
.pp > span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pp small { font-size: .8em; }
.pp .done { position: absolute; right: 12px; top: 8px; color: var(--good); font-style: normal; font-weight: 800; }
.pp.gone { opacity: .6; filter: grayscale(.8); }
.rbar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 4px; }
.rbar i { display: block; height: 100%; background: var(--accent2); }
.rbar.warm i { background: var(--love); }
.rbar.cold i { background: #6e8bd8; }
.rbar.big { height: 9px; }
.person { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; padding-right: 36px; }
.person img { height: 110px; image-rendering: pixelated; }
.person p { margin: 3px 0; }
.people.mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* Equipo y perfil */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.mc { display: flex; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.mc.partner { border-color: var(--accent2); }
.mc-img { width: 84px; flex: none; display: flex; align-items: center; justify-content: center; }
.mc-sprite { max-width: 84px; image-rendering: pixelated; }
.mc-b { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mc-x { display: flex; flex-wrap: wrap; gap: 8px; font-size: .78em; color: var(--muted); }
.mc-mv { display: flex; flex-wrap: wrap; gap: 3px; }
.mc-mv i { font-style: normal; font-size: .72em; border-left: 3px solid var(--c); background: var(--card2); border-radius: 4px; padding: 1px 6px; }
.mc-btns { display: flex; gap: 6px; margin-top: 4px; }
.mc-btns button { padding: .25em .7em; font-size: .8em; }
.rec { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0; }
.rec div { display: flex; flex-direction: column; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; }
.rec b { font-family: var(--display); font-size: 1.3em; }
.rec small { font-size: .66em; font-weight: 800; letter-spacing: .08em; text-align: center; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.bdg { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; display: flex; flex-direction: column; font-size: .88em; }
.bdg span { color: var(--accent2); letter-spacing: 2px; }
.bdg.off { opacity: .45; }
.tl, .moments { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.moments li { display: flex; gap: 8px; align-items: baseline; text-align: left; }
.bag { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.bi { display: flex; gap: 8px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.bi span { font-size: 1.5em; }
.bi div { display: flex; flex-direction: column; }
.bi small { font-size: .78em; }
.ribbons { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.rb { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; opacity: .5; }
.rb.on { opacity: 1; border-color: var(--accent2); }
.rb.fresh { animation: pop .5s; background: color-mix(in srgb, var(--accent2) 18%, var(--card)); }
.rb span { font-size: 1.8em; }
.rb small { font-size: .74em; }
.opts-row { display: flex; gap: 8px; margin-top: 16px; }
.opts-row button { flex: 1; }

/* Final */
.end { display: flex; flex-direction: column; gap: 10px; }
.end-top { display: flex; align-items: center; gap: 14px; }
.trbig { height: 150px; image-rendering: pixelated; }
.end-top h2 { font-size: 2.2em; }
.end-top p { margin: 4px 0; }
.end .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.end .card h4 { font-size: .74em; letter-spacing: .14em; color: var(--muted); margin-bottom: 8px; }
.end .pend { display: flex; gap: 12px; align-items: center; }
.end .pend .portrait { width: 80px; height: 80px; border-radius: 14px; image-rendering: pixelated; }
.heir-btn { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 6px; text-align: left; }
.heir-btn img { height: 60px; image-rendering: pixelated; }
.heir-btn span { display: flex; flex-direction: column; }

@media (max-width: 520px) {
  .statbar { grid-template-columns: repeat(2, 1fr); }
  .bar button { font-size: .66em; }
  .team, .acts { grid-template-columns: 1fr; }
}
