:root {
  color: #172033;
  background: #f5f7fb;
  font-family: Inter, "Noto Sans JP", system-ui, sans-serif;
  font-synthesis: none;
  --blue: #335cff;
  --blue-soft: #edf1ff;
  --line: #dce2ed;
  --muted: #68758a;
  --surface: #fff;
  --success: #07855b;
  --danger: #c53d4d;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 80% 0, #e9edff 0, transparent 28rem), #f5f7fb; }
button, input { font: inherit; }
button { cursor: pointer; }
.site-header { height: 72px; padding: 0 clamp(20px, 5vw, 76px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--blue); color: #fff; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 11px; }
.network-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.network-status i { width: 8px; height: 8px; border-radius: 50%; background: #e5a92e; }
.network-status.ready i { background: #18a978; }
.network-status.error i { background: var(--danger); }
main { width: min(1440px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 72px; }
.hero { display: flex; justify-content: space-between; gap: 28px; align-items: flex-end; margin-bottom: 34px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
h1 { margin: 0; font-size: clamp(34px, 4vw, 58px); line-height: 1.1; letter-spacing: -.045em; }
.hero > div > p:last-child { max-width: 650px; margin: 18px 0 0; color: var(--muted); line-height: 1.8; }
.hero-rule { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.hero-rule span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-size: 22px; font-weight: 800; }
.hero-rule p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.hero-rule strong { color: #172033; font-size: 14px; }
.notice { margin-bottom: 18px; padding: 13px 16px; border: 1px solid #f2c7cc; border-radius: 12px; background: #fff3f4; color: #9d2634; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 390px); gap: 18px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.94); box-shadow: 0 18px 50px rgba(40,55,90,.07); }
.catalog-panel { padding: clamp(18px, 3vw, 30px); }
.deck-panel { position: sticky; top: 18px; padding: 24px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.025em; }
.count-badge { padding: 7px 10px; border-radius: 999px; background: #f1f3f7; color: var(--muted); font-size: 12px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.game-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); transition: transform .18s, box-shadow .18s, border-color .18s; }
.game-card:hover { transform: translateY(-2px); border-color: #bfc9df; box-shadow: 0 12px 28px rgba(40,55,90,.1); }
.card-art { aspect-ratio: 16/10; display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, #e4eaff, #f6f8ff); color: var(--blue); font-size: 44px; font-weight: 900; }
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 15px; }
.card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card-title h3 { overflow: hidden; margin: 0; font-size: 16px; white-space: nowrap; text-overflow: ellipsis; }
.card-title small { flex: 0 0 auto; color: var(--muted); }
.chain-badge { width: fit-content; margin: 7px 0 9px; padding: 4px 8px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid #dbe3f4; border-radius: 999px; color: #4a5870; font-size: 10px; font-weight: 800; }
.chain-badge i { width: 7px; height: 7px; border-radius: 50%; background: #718096; }
.chain-43114 i { background: #e84142; }.chain-8217 i { background: #87d300; }.chain-137 i { background: #8247e5; }.chain-1 i { background: #627eea; }
.card-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin: 14px 0; }
.card-stats span { padding: 8px 4px; border-radius: 9px; background: #f4f6fa; text-align: center; font-size: 11px; color: var(--muted); }
.card-stats strong { display: block; margin-top: 2px; color: #172033; font-size: 14px; }
.card-tactics { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 10px; }
.card-tactics span { padding: 4px 7px; border: 1px solid #dbe3f4; border-radius: 999px; background: #f8faff; color: #48618f; font-size: 10px; font-weight: 700; }
.card-ability { min-height: 34px; margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.add-button { width: 100%; min-height: 40px; border: 0; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-weight: 750; }
.add-button:hover { background: #dfe6ff; }
.player-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 20px; padding: 4px; border-radius: 12px; background: #f1f3f7; }
.player-tab { min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 800; }
.player-tab.active { background: #fff; color: var(--blue); box-shadow: 0 2px 8px rgba(40,55,90,.1); }
.field-label { display: block; margin: 0 0 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.wallet-input { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; outline: 0; }
.wallet-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.formation-help { margin: 15px 0 9px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.formation { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 17px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(#f8faff 50%, #f1f5fc 50%); }
.formation-slot { position: relative; min-width: 0; aspect-ratio: 1; padding: 7px; border: 1px dashed #b9c4d7; border-radius: 11px; background: rgba(255,255,255,.68); color: var(--muted); font-size: 10px; }
.formation-slot.selected { border: 2px solid var(--blue); background: var(--blue-soft); color: var(--blue); }
.formation-slot.occupied { border-style: solid; background: #fff; color: #172033; }
.formation-slot strong { display: block; overflow: hidden; margin-top: 5px; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.formation-slot small { display: block; margin-top: 3px; color: var(--muted); }
.formation-slot .remove-unit { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: #f1f3f7; color: var(--danger); font-size: 14px; }
.formation-slot .slot-actions { position: absolute; top: 3px; right: 3px; display: flex; gap: 3px; align-items: center; }
.formation-slot .slot-actions [data-leader] { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: #fff5cf; color: #936b00; font-size: 13px; }
.formation-slot .slot-actions .remove-unit { position: static; display: grid; place-items: center; }
.battle-log .leader { background: #fff8df; color: #725400; }
.tactic-rules { display: grid; gap: 4px; margin: 9px 0; padding: 0; list-style: none; }
.tactic-rules li { display: flex; gap: 7px; align-items: center; padding: 6px 8px; border-radius: 8px; background: #f4f7fc; color: var(--muted); font-size: 11px; }
.tactic-rules b { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); }
.deck-actions { display: grid; gap: 9px; }
.button { min-height: 46px; border-radius: 12px; font-weight: 800; }
.button:disabled { cursor: wait; opacity: .55; }
.button.secondary { border: 1px solid var(--line); background: #fff; color: #172033; }
.button.primary { border: 0; background: var(--blue); color: #fff; box-shadow: 0 9px 20px rgba(51,92,255,.22); }
.result { margin-top: 14px; padding: 14px; border-radius: 12px; background: #eefaf6; color: #086f4e; font-size: 13px; line-height: 1.6; }
.battle-log { max-height: 260px; overflow: auto; margin: 10px 0 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: #101827; color: #dce5f5; }
.battle-log li { display: grid; grid-template-columns: 42px 1fr; gap: 8px; padding: 9px 11px; border-bottom: 1px solid #263247; font-size: 11px; line-height: 1.5; }
.battle-log li:last-child { border-bottom: 0; }
.battle-log b { color: #8da7ff; }
.battle-log li.heal { color: #9ce6c6; }
.battle-log li.heal b { color: #4fd39a; }
.empty-state { grid-column: 1/-1; padding: 70px 20px; text-align: center; color: var(--muted); }
.empty-state span { display: block; color: var(--blue); font-size: 40px; }
.empty-state h3 { margin: 10px 0 6px; color: #172033; }
.empty-state p { margin: 0; font-size: 13px; }
@media (max-width: 860px) {
  .site-header { height: 62px; padding-inline: 16px; }
  .network-status { font-size: 0; }
  main { width: min(100% - 24px, 680px); padding-top: 30px; }
  .hero { display: block; }
  .hero-rule { width: fit-content; margin-top: 20px; }
  .workspace { grid-template-columns: 1fr; }
  .deck-panel { position: static; order: -1; }
  .card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 520px) {
  .brand small { display: none; }
  h1 { font-size: 34px; }
  .hero > div > p:last-child { font-size: 14px; }
  .catalog-panel, .deck-panel { padding: 17px; border-radius: 17px; }
  .card-grid { grid-template-columns: 1fr; }
  .card-art { aspect-ratio: 2/1; }
  .card-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
.campaign-strip { margin: 0 auto 24px; padding: 20px; display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.8fr); gap: 24px; align-items: center; }
.commander-progress h2 { margin: 2px 0 12px; }
.profile-level { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.xp-track { height: 7px; margin: 10px 0 5px; overflow: hidden; border-radius: 999px; background: #e7ebf2; }
.xp-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2b66f6, #21b68c); transition: width .25s ease; }
.mission-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mission { min-height: 82px; padding: 12px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; text-align: left; border: 1px solid #d9e0ea; border-radius: 12px; background: #fff; color: inherit; cursor: pointer; }
.mission > span { grid-row: 1 / 3; align-self: center; color: #7a8597; font-weight: 800; }
.mission strong { align-self: end; }
.mission small { color: #687386; }
.mission.active { border-color: #2b66f6; box-shadow: 0 0 0 2px rgba(43,102,246,.1); }
@media (max-width: 800px) { .campaign-strip { grid-template-columns: 1fr; } .mission-list { grid-template-columns: 1fr; } }
