:root{--snes-bg: #0b0b14;--snes-blue-top: #0a2472;--snes-blue-bottom: #00072d;--snes-border-outer: #ffffff;--snes-border-inner: #9bb1ff;--snes-gold: #f4c242;--snes-gold-dark: #b8860b;--snes-text: #ffffff;--snes-text-shadow: #000000;--snes-hp-green: #38b764;--snes-hp-yellow: #f4b41b;--snes-hp-red: #e43b44;--snes-mana-blue: #00b4d8;--font-retro: "Press Start 2P", monospace, sans-serif;--font-dialog: "VT323", monospace, sans-serif}*{box-sizing:border-box;margin:0;padding:0;user-select:none;-webkit-font-smoothing:none}body{background-color:var(--snes-bg);color:var(--snes-text);font-family:var(--font-retro);font-size:12px;line-height:1.6;display:flex;justify-content:center;align-items:center;min-height:100vh;padding:12px;overflow-x:hidden}.crt-overlay{pointer-events:none;position:fixed;top:0;left:0;width:100vw;height:100vh;background:linear-gradient(#12101000 50%,#00000040 50%),linear-gradient(90deg,#ff000008,#00ff0003,#0000ff08);background-size:100% 4px,6px 100%;z-index:9999}#app{width:100%;max-width:840px;min-height:640px;position:relative;display:flex;flex-direction:column;gap:14px}.snes-box{background:linear-gradient(180deg,var(--snes-blue-top) 0%,var(--snes-blue-bottom) 100%);border:4px solid var(--snes-border-outer);box-shadow:inset 0 0 0 2px #000,0 6px 16px #000000b3;border-radius:6px;padding:16px;position:relative}.snes-box:before{content:"";position:absolute;inset:2px;border:1px solid var(--snes-border-inner);border-radius:3px;pointer-events:none}.game-header{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px;padding:10px 16px}.logo-group{display:inline-flex;align-items:center;gap:10px}.logo-icon{width:28px;height:28px;image-rendering:pixelated;filter:drop-shadow(0 2px 4px rgba(0,0,0,.6))}.logo-title{color:var(--snes-gold);font-size:18px;text-shadow:2px 2px #000;letter-spacing:2px;line-height:1;display:inline-flex;align-items:center}.logo-text-block{display:flex;flex-direction:column}.logo-subtitle{font-size:8px;color:#ffd166;letter-spacing:.5px;margin-top:4px;font-family:var(--font-retro);text-shadow:1px 1px #000}.header-meta{display:flex;align-items:center;gap:12px;font-size:10px;white-space:nowrap}.header-date{white-space:nowrap;display:inline-block}.header-controls{display:flex;gap:8px;align-items:center;flex-shrink:0}.header-action-btn{white-space:nowrap;font-size:10px;padding:6px 12px;gap:6px;flex-shrink:0}.snes-btn{background:linear-gradient(180deg,#2a4b8d,#112855);color:#fff;border:2px solid #ffffff;box-shadow:inset -2px -2px #091738,inset 2px 2px #4d75be;font-family:var(--font-retro);font-size:11px;padding:8px 14px;cursor:pointer;text-shadow:1px 1px #000;display:inline-flex;align-items:center;justify-content:center;line-height:1;vertical-align:middle;gap:6px;box-sizing:border-box;transition:transform .05s ease,filter .1s ease}.snes-btn>span{display:inline-flex;align-items:center;justify-content:center;line-height:1}.btn-icon{display:inline-flex;align-items:center;justify-content:center;line-height:1;vertical-align:middle;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",Twemoji,sans-serif;font-style:normal;font-weight:400;font-size:1.15em;transform:translateY(-1px);flex-shrink:0}.snes-btn:hover{filter:brightness(1.15)}.snes-btn:active{transform:translateY(2px);box-shadow:inset 2px 2px #091738,inset -2px -2px #4d75be}.snes-btn.gold{background:linear-gradient(180deg,#e6a119,#9e6402);border-color:#ffe066;color:#fff;box-shadow:inset -2px -2px #664000,inset 2px 2px #ffc04d}.snes-btn.red{background:linear-gradient(180deg,#d90429,#700215);border-color:#ff758f;color:#fff}.snes-btn.small{font-size:9px;padding:4px 8px}.battle-btn{font-size:13px;padding:10px 28px;display:inline-flex;align-items:center;justify-content:center;gap:10px;line-height:1;vertical-align:middle}.battle-btn .btn-icon{font-size:15px;line-height:1;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle}.theme-banner{display:flex;align-items:center;justify-content:space-between;border-left:6px solid var(--snes-gold);padding:10px 14px;background:#0006;gap:12px}.theme-hero-preview{display:flex;align-items:center;gap:12px}.hero-mini-avatar{width:44px;height:44px;min-width:44px;min-height:44px;background:#00000080;border:2px solid #556699;border-radius:4px;display:inline-flex;align-items:center;justify-content:center;overflow:hidden;box-shadow:inset 1px 1px #fff3,inset -1px -1px #0009;flex-shrink:0}.hero-mini-avatar svg{width:38px;height:38px;image-rendering:pixelated;filter:drop-shadow(0 2px 3px rgba(0,0,0,.8))}.theme-title{color:var(--snes-gold);font-size:14px;font-weight:700;margin-bottom:4px}.theme-flavor{font-family:var(--font-dialog);font-size:13.5px;line-height:1.25;color:#d1d5db}.status-row{display:grid;grid-template-columns:1fr 1fr;gap:16px}@media(max-width:700px){.game-header{flex-direction:column;align-items:stretch;gap:8px}.header-controls{display:flex;justify-content:space-between;width:100%;gap:6px}.header-action-btn{flex:1;justify-content:center;padding:7px 6px;font-size:10px;white-space:nowrap}.status-row{grid-template-columns:1fr}}.stats-card{background:#0006;padding:12px;border-radius:4px;border:1px solid rgba(255,255,255,.2)}.stats-card-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;gap:8px}.stats-card-title{font-family:var(--font-retro);font-size:9px;color:var(--snes-gold);font-weight:700;letter-spacing:.5px}.stage-indicator-badge{font-family:var(--font-retro);font-size:9px;color:var(--snes-gold);background:#00000073;border:1px solid rgba(244,194,66,.5);padding:2px 6px;border-radius:2px;letter-spacing:.5px;white-space:nowrap;flex-shrink:0}.hero-identity-row{display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;min-width:0}.hero-name-container{display:inline-flex;align-items:center;gap:4px;min-width:0;flex:1 1 auto;overflow:hidden}.hero-name-badge{color:var(--snes-gold);cursor:pointer;border-bottom:1px dashed var(--snes-gold);transition:color .15s;font-size:clamp(8px,2.4vw,10px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-shrink:1}.hero-name-badge:hover{color:#fff}.hero-type-badge{font-family:var(--font-retro);font-size:clamp(7px,2vw,9px);color:#ffd166;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-shrink:0;max-width:50%;opacity:.9}.hero-name-input{background:#000c3b;border:2px solid var(--snes-gold);border-radius:2px;color:#fff;font-family:var(--font-retro);font-size:10px;padding:3px 6px;width:130px;outline:none}.hero-edit-btn{background:transparent;border:none;color:#a0a0b0;cursor:pointer;font-size:10px;padding:0 2px}.hero-edit-btn:hover{color:var(--snes-gold)}.stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:8px;font-size:10px}.stat-item span:first-child{color:#9bb1ff;display:block;font-size:9px}.stat-item span:last-child{color:#fff;font-weight:700}.hp-container{margin:6px 0}.hp-labels{display:flex;justify-content:space-between;font-size:10px;margin-bottom:2px}.hp-bar-track{background:#1a1a24;height:12px;border:2px solid #ffffff;border-radius:2px;overflow:hidden;position:relative}.hp-bar-fill{height:100%;width:100%;background-color:var(--snes-hp-green);transition:width .3s ease,background-color .3s ease}.hp-bar-fill.warn{background-color:var(--snes-hp-yellow)}.hp-bar-fill.danger{background-color:var(--snes-hp-red)}.perks-selection-container{display:flex;flex-direction:column;gap:12px}.perks-list{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}@media(max-width:700px){.perks-list{grid-template-columns:1fr}}.perk-card{background:#040f30e6;border:2px solid #587ab5;border-radius:4px;padding:12px;display:flex;flex-direction:column;justify-content:space-between;gap:10px;transition:border-color .2s,transform .1s}.perk-card.revealed{border-color:var(--snes-gold);box-shadow:0 0 10px #f4c2424d}.perk-card.unrevealed{opacity:.6;border-style:dashed;text-align:center;justify-content:center;min-height:140px}.perk-title{color:var(--snes-gold);font-size:12px;font-weight:700;line-height:1.3}.perk-desc{font-family:var(--font-dialog);font-size:13.5px;line-height:1.25;margin:3px 0 8px;color:#e5e7eb}.perk-benefit{background:#38b76426;border-left:3px solid var(--snes-hp-green);padding:4px 6px;color:#70e000;font-size:9.5px;line-height:1.3}.perk-cost{background:#e43b4426;border-left:3px solid var(--snes-hp-red);padding:4px 6px;color:#ff85a1;font-size:9.5px;line-height:1.3}.stances-container{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:12px 0}@media(max-width:700px){.stances-container{grid-template-columns:1fr}}.stance-card{background:#00000080;border:2px solid #445588;padding:10px;border-radius:4px;cursor:pointer;text-align:center;transition:all .15s}.stance-card.active{border-color:var(--snes-gold);background:#f4c24226;box-shadow:0 0 8px #f4c24266}.stance-name{font-size:12px;font-weight:700;color:#fff;margin-bottom:6px}.stance-card.active .stance-name{color:var(--snes-gold)}.stance-desc{font-size:9.5px;color:#c0c8e0;line-height:1.4}.battle-arena{display:flex;justify-content:space-around;align-items:center;min-height:190px;padding:10px;background:radial-gradient(circle,#141e4699,#050a1ee6);border:2px solid #334466;border-radius:4px;position:relative;overflow:hidden}.combatant-zone{display:flex;flex-direction:column;align-items:center;gap:6px;width:140px;position:relative}.pixel-sprite{image-rendering:pixelated;filter:drop-shadow(0 4px 6px rgba(0,0,0,.8));transition:transform .1s ease}.floating-damage{position:absolute;top:-15px;left:50%;transform:translate(-50%);font-family:var(--font-retro);font-size:16px;color:#f33;text-shadow:2px 2px #000;pointer-events:none;animation:floatUp .7s forwards;z-index:50}.floating-damage.crit{font-size:20px;color:var(--snes-gold)}.floating-damage.heal{color:var(--snes-hp-green)}@keyframes floatUp{0%{opacity:1;transform:translate(-50%) scale(1.1)}to{opacity:0;transform:translate(-50%,-35px) scale(.9)}}.shake{animation:screenShake .25s}@keyframes screenShake{0%,to{transform:translate(0)}25%{transform:translate(-6px)}75%{transform:translate(6px)}}.flash{filter:brightness(2.5) drop-shadow(0 0 10px #ff0000)}.battle-log-box{background:#000414;border:2px solid #5577aa;padding:8px 12px;min-height:90px;max-height:120px;overflow-y:auto;font-family:var(--font-dialog);font-size:15px;line-height:1.3;color:#e2e8f0}.battle-log-entry{margin-bottom:4px}.battle-log-entry.crit{color:var(--snes-gold)}.battle-log-entry.danger{color:var(--snes-hp-red)}.battle-log-entry.heal{color:var(--snes-hp-green)}.battle-outcome-banner{background:#000000a6;border:2px solid var(--snes-gold);border-radius:4px;padding:12px 18px;display:inline-block;min-width:280px;box-shadow:0 6px 16px #000c;animation:modalFadeIn .2s ease-out}.battle-outcome-banner.win{border-color:var(--snes-gold);background:linear-gradient(180deg,#f4c24233,#000519d9)}.battle-outcome-banner.loss{border-color:var(--snes-hp-red);background:linear-gradient(180deg,#e43b4440,#000519d9)}.autopsy-box{background:#b4141e26;border:2px solid var(--snes-hp-red);padding:12px;border-radius:4px;margin:10px 0}.victory-banner{color:var(--snes-gold);font-size:20px;text-align:center;text-shadow:2px 2px #000;margin-bottom:12px}.defeat-banner{color:var(--snes-hp-red);font-size:20px;text-align:center;text-shadow:2px 2px #000;margin-bottom:12px}.share-preview-card{background:#050b1a;border:1px dashed #6688cc;padding:12px;font-family:monospace;font-size:11px;white-space:pre-wrap;margin:10px 0}.toast{position:fixed;bottom:24px;left:50%;transform:translate(-50%);background:var(--snes-gold);color:#000;padding:8px 16px;font-family:var(--font-retro);font-size:11px;border:2px solid #fff;box-shadow:0 4px 12px #000c;z-index:10000;animation:fadeInOut 2.5s forwards}@keyframes fadeInOut{0%{opacity:0;transform:translate(-50%,10px)}15%{opacity:1;transform:translate(-50%)}80%{opacity:1;transform:translate(-50%)}to{opacity:0;transform:translate(-50%,-10px)}}.env-pill{font-size:9px;padding:2px 6px;border-radius:3px;background:#346;color:#fff}.modal-overlay{position:fixed;inset:0;background:#000000c7;display:flex;align-items:center;justify-content:center;z-index:10000;padding:16px;animation:modalFadeIn .15s ease-out}@keyframes modalFadeIn{0%{opacity:0}to{opacity:1}}.help-modal-box{max-width:520px;width:100%;max-height:85vh;overflow-y:auto;box-shadow:0 10px 30px #000000e6}.help-modal-box::-webkit-scrollbar{width:6px}.help-modal-box::-webkit-scrollbar-thumb{background:#46a;border-radius:3px}.help-heading{display:flex;align-items:center;gap:8px;font-size:11px;font-weight:700;line-height:1.2}.heading-emoji{display:inline-flex;align-items:center;justify-content:center;line-height:1;vertical-align:middle;font-size:13px;flex-shrink:0}.options-modal-box{max-width:480px;width:100%;max-height:85vh;overflow-y:auto;box-shadow:0 10px 30px #000000e6}.options-modal-box::-webkit-scrollbar{width:6px}.options-modal-box::-webkit-scrollbar-thumb{background:#46a;border-radius:3px}.option-row{display:flex;justify-content:space-between;align-items:center;background:#00000059;border:1px solid #334e80;border-radius:4px;padding:10px 12px;gap:12px}.option-info{flex:1;min-width:0}.option-title{color:var(--snes-gold);font-size:11px;font-weight:700;display:flex;align-items:center;gap:6px;margin-bottom:3px}.option-desc{font-family:var(--font-dialog);font-size:13px;color:#c0c8e0;line-height:1.35}@media(max-width:500px){.option-row{flex-direction:column;align-items:stretch;gap:8px}.option-row .snes-btn{width:100%}}
