* { box-sizing: border-box; }
body { font-family: sans-serif; margin: 0; background: #12152a; color: #f0f2fa; font-size: 17px; line-height: 1.6; }
header { padding: 14px 16px; background: #1e2442; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; border-bottom: 2px solid #39406b; }
header h1 { font-size: 24px; margin: 0; color: #ffd75e; letter-spacing: 1px; }
.bar { font-size: 14px; color: #c3cbe4; line-height: 1.7; }
nav#tabs { display: flex; gap: 6px; padding: 10px 12px 2px; flex-wrap: wrap; }
nav#tabs button { background: #262c4e; color: #cfd6f2; border: 2px solid #39406b; border-radius: 999px; padding: 9px 18px; cursor: pointer; font-size: 16px; font-weight: bold; }
nav#tabs button.active { background: linear-gradient(90deg, #4f7cff, #8a4fff); color: #fff; border-color: transparent; box-shadow: 0 3px 10px rgba(90, 90, 255, .45); }
main { padding: 14px 16px 44px; }
.card { background: #1e2442; border: 2px solid #333c66; border-radius: 16px; padding: 18px; margin-bottom: 16px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.card h2 { margin: 0 0 12px; font-size: 20px; color: #ffd75e; }
.card h3 { font-size: 18px; margin: 10px 0 8px; }
.row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
input[type=text], input[type=password], select { background: #0d1017; color: #fff; border: 2px solid #39406b; border-radius: 10px; padding: 11px 12px; font-size: 16px; }
button { background: linear-gradient(180deg, #4f7cff, #3b5bdb); color: #fff; border: none; border-radius: 12px; padding: 11px 20px; cursor: pointer; font-size: 16px; font-weight: bold; box-shadow: 0 3px 8px rgba(0,0,0,.3); }
button:active { transform: scale(.97); }
button:disabled { opacity: .45; cursor: default; box-shadow: none; }
button.sub { background: #46538a; }
button.danger { background: #d64545; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.mcard { background: #232a4e; border: 2px solid #333c66; border-radius: 16px; padding: 12px 8px; text-align: center; cursor: pointer; }
.mcard img { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; transform: scale(1.06); display: block; margin: 0 auto; }
.mcard .nm { font-weight: bold; margin-top: 6px; font-size: 17px; }
.mcard .sub { font-size: 13px; color: #a7b0cf; line-height: 1.5; }
.hidden { display: none !important; }
.msg { color: #ffd75e; font-size: 15px; font-weight: bold; min-height: 1em; }
.err { color: #ff9090; }
.detail { display: flex; gap: 18px; flex-wrap: wrap; }
.detail img.main { width: 240px; height: 240px; object-fit: cover; background: #0d1017; border-radius: 50%; transform: scale(1.05); }
.stats { font-size: 16px; line-height: 1.75; }
.hpbar { background: #333; border-radius: 4px; height: 14px; overflow: hidden; }
.hpbar > div { background: #51cf66; height: 100%; transition: width .3s; }
.battle { display: flex; gap: 12px; flex-wrap: wrap; }
.fighter { flex: 1; min-width: 220px; background: #1a1f30; border: 1px solid #2c3352; border-radius: 10px; padding: 10px; text-align: center; }
.fighter img { width: 160px; height: 160px; object-fit: contain; }
.log { background: #0d1017; border-radius: 12px; padding: 12px; height: 190px; overflow-y: auto; font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.maintenance { background: #5c1a1a; text-align: center; padding: 40px 16px; font-size: 18px; }
table { border-collapse: collapse; font-size: 14px; }
td, th { border: 1px solid #39406b; padding: 6px 10px; }
/* 転生グレードによる名前色（v69） */
.g0 { color: #fff; } .g1 { color: #51cf66; } .g2 { color: #4dabf7; } .g3 { color: #b197fc; }
.g4 { color: #ffa94d; } .g5 { color: #ff6b6b; }
.g6 { background: linear-gradient(90deg, #ff6b6b, #ffd75e, #51cf66, #4dabf7, #b197fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* スタート画面 */
#start-screen { padding: 24px 16px 40px; }
.start-hero { max-width: 640px; margin: 0 auto; text-align: center; background: #1a1f30; border: 1px solid #2c3352; border-radius: 14px; padding: 28px 20px 22px; }
.start-title { font-size: 38px; font-weight: bold; color: #ffd75e; letter-spacing: 2px; }
.start-tag { font-size: 16px; line-height: 1.9; color: #e6ebfa; margin: 12px 0 4px; }
.start-arts { display: flex; justify-content: center; gap: 6px; margin: 14px 0 6px; flex-wrap: wrap; }
.start-arts img { width: 104px; height: 104px; object-fit: cover; border-radius: 50%; transform: scale(1.05); }
.start-btns { display: flex; justify-content: center; gap: 12px; margin: 16px 0 10px; flex-wrap: wrap; }
.start-btn { font-size: 17px; font-weight: bold; padding: 12px 34px; border-radius: 8px; }
.start-hero .sub { font-size: 12px; color: #9aa3c2; }
/* 戦闘アリーナ */
.arena { background: linear-gradient(180deg, #232a4a 0%, #171c30 70%, #12172a 100%); border: 1px solid #39406b; border-radius: 12px; padding: 12px 10px 10px; margin-bottom: 10px; overflow: hidden; }
.arena-head { text-align: center; font-weight: bold; font-size: 17px; color: #ffd75e; margin-bottom: 8px; }
#battle-screen { max-width: 880px; margin: 0 auto; padding: 12px; }
.challenge-btn { width: 100%; font-size: 21px; font-weight: bold; padding: 17px; border-radius: 14px; margin-top: 10px; background: linear-gradient(90deg, #ff8a4f, #ff4f6d); }
.stage { display: flex; flex-direction: column; justify-content: space-between; min-height: 350px; gap: 2px; }
.stage .side { display: flex; flex-direction: row; align-items: flex-end; gap: 10px; max-width: 97%; }
.stage .side.foe { align-self: flex-end; flex-direction: row-reverse; }
.stage .side.me { align-self: flex-start; }
.vs { font-size: 22px; font-weight: bold; color: #ff8787; align-self: center; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.fimg-wrap { position: relative; height: 158px; flex: none; display: flex; align-items: flex-end; justify-content: center; }
.fimg-wrap img { max-width: 210px; max-height: 158px; object-fit: contain; border-radius: 50%; transform: scale(1.07); filter: drop-shadow(0 10px 10px rgba(0,0,0,.55)); }
#preview-box img { border-radius: 50%; transform: scale(1.05); }
.gauge { height: 12px; background: #141a2e; border-radius: 6px; overflow: hidden; flex: 1; }
.gauge i { display: block; height: 100%; border-radius: 6px; transition: width .4s; }
.gauge.exp i { background: linear-gradient(90deg, #2f9e6e, #6fe3a5); }
.gauge.hp i { background: #43c465; }
.gauge.atk i { background: #ef6461; }
.gauge.def i { background: #5b8def; }
.gauge.spd i { background: #f2c14e; }
.lv-block { margin: 6px 0 8px; }
.lv-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.lv-num { font-size: 27px; font-weight: bold; color: #ffd94d; }
.lv-evo { font-size: 14px; color: #9fd8ff; font-weight: bold; }
.lv-block .gauge { height: 14px; }
.lv-sub { font-size: 13px; color: #b6bdd2; margin-top: 3px; }
.stat-gauges { margin: 8px 0; }
.stat-row { display: flex; align-items: center; gap: 9px; margin: 5px 0; }
.stat-row .lb { width: 38px; font-size: 14px; font-weight: bold; color: #dbe2f2; }
.stat-row .vl { min-width: 124px; text-align: right; font-size: 15px; }
.stat-row .vl small { color: #98a2ba; font-size: 12px; }
.official-links { padding: 8px 14px 0; font-size: 13px; color: #a7b0cf; }
.official-links a { color: #9fd8ff; }
#raising-bar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 9px; padding: 8px 12px; background: rgba(16, 20, 38, .95); border-bottom: 2px solid #39406b; cursor: pointer; }
#raising-bar.hidden { display: none; }
#raising-bar img { width: 38px; height: 38px; object-fit: cover; border-radius: 50%; transform: scale(1.06); flex: none; }
#raising-bar .rb-name { font-size: 15px; font-weight: bold; white-space: nowrap; }
#raising-bar .rb-name small { color: #ffd94d; font-size: 13px; }
#raising-bar .gauge { height: 11px; }
#raising-bar .rb-pct { font-size: 13px; color: #b6bdd2; min-width: 36px; text-align: right; }
.plate { width: 205px; flex: none; background: rgba(13,16,23,.85); border: 2px solid #39406b; border-radius: 12px; padding: 9px 11px; }
@media (max-width: 560px) {
  .stage { min-height: 300px; }
  .plate { width: 160px; }
  .fimg-wrap { height: 118px; }
  .fimg-wrap img { max-width: 138px; max-height: 118px; }
  .fname { font-size: 13px; }
}
.fname { font-weight: bold; font-size: 15px; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { font-size: 12px; border-radius: 6px; padding: 1px 7px; vertical-align: 2px; font-weight: bold; }
.chip.me { background: #3b5bdb; color: #fff; }
.chip.foe { background: #a33; color: #fff; }
.hpbar.big { height: 16px; border: 1px solid #000; }
.hpbar.big > div { transition: width .45s ease, background .45s ease; }
.gaugebar { background: #22263a; border-radius: 4px; height: 9px; overflow: hidden; margin-top: 5px; border: 1px solid #000; }
.gaugebar > div { background: #4dabf7; height: 100%; transition: width .45s ease; }
.fhp { font-size: 13px; color: #e6ebfa; margin-top: 3px; }
.fsub { font-size: 12px; color: #a7b0cf; margin-top: 2px; }
.banner { text-align: center; font-size: 17px; font-weight: bold; min-height: 1.5em; padding: 8px 6px 2px; color: #fff; }
.banner.show { animation: bannerPop .25s ease; }
.banner.k-crit { color: #ffa94d; font-size: 18px; }
.banner.k-skill { color: #b197fc; font-size: 18px; }
.banner.k-heal { color: #51cf66; }
.banner.k-evade { color: #9aa3c2; }
.floater { position: absolute; top: 34%; left: 50%; transform: translateX(-50%); font-size: 27px; font-weight: bold; color: #fff; text-shadow: 0 2px 6px #000, 0 0 2px #000; pointer-events: none; animation: floatUp .95s ease-out forwards; z-index: 3; white-space: nowrap; }
.floater.crit { color: #ffa94d; font-size: 36px; }
.floater.skill { color: #b197fc; font-size: 31px; }
.floater.heal { color: #51cf66; }
.floater.miss { color: #ced4e8; font-size: 21px; }
.lunge-p { animation: lungeP .38s ease; }
.lunge-e { animation: lungeE .38s ease; }
.hit { animation: hitShake .42s ease; }
.bbrow { gap: 10px; margin: 2px 0 10px; }
.bbtn { font-size: 17px; font-weight: bold; padding: 13px 24px; border-radius: 12px; }
.bbtn.skill { background: #7048c9; }
@keyframes lungeP { 35% { transform: translate(26px, -18px) scale(1.05); } }
@keyframes lungeE { 35% { transform: translate(-26px, 18px) scale(1.05); } }
@keyframes hitShake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-7px); filter: brightness(2.2); } 45% { transform: translateX(6px); } 70% { transform: translateX(-4px); filter: brightness(1.6); } }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 12px) scale(.8); } 18% { opacity: 1; transform: translate(-50%, 0) scale(1.12); } 100% { opacity: 0; transform: translate(-50%, -52px) scale(1); } }
@keyframes bannerPop { 0% { transform: scale(1.12); } 100% { transform: scale(1); } }
