@font-face { font-family: "Oswald"; font-style: normal; font-weight: 200 700; font-display: swap; src: url(../assets/fonts/oswald-latin.woff2) format("woff2"); }
:root {
  --bg: #0a0b0f;
  --bg2: #12141b;
  --panel: #171a23;
  --panel2: #1e2230;
  --line: #2a2f3f;
  --text: #eceef3;
  --muted: #9aa1b3;
  --gold: #d4af37;
  --gold2: #f1d77a;
  --red: #e0343b;
  --blue: #3a7bff;
  --green: #3ecf6e;
  --orange: #ff8a3d;
  --radius: 10px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", system-ui, sans-serif;
  --display: "Oswald", "Arial Narrow", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { overflow-x: hidden; }
button { font-family: inherit; }
#app { min-height: 100%; }
.flag { vertical-align: -3px; border-radius: 2px; flex: none; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.good { color: var(--green); }
.bad { color: var(--red); }
.warn { color: var(--orange); }
.num { font-family: var(--display); letter-spacing: .02em; }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.3; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.02rem; color: var(--gold2); }

/* ボタン */
.btn { appearance: none; border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: .7em 1.2em; border-radius: 8px; font-weight: 700; font-size: .95rem; cursor: pointer; transition: transform .08s, background .15s, border-color .15s; }
.btn:hover { border-color: var(--gold); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #e3c252, #b8922a); color: #16120a; border-color: #e3c252; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: #3a1216; border-color: #6b1d24; color: #ffb3b6; }
.btn.ghost { background: transparent; }
.btn.big { font-size: 1.15rem; padding: .9em 1.6em; }
.btn.small { padding: .4em .8em; font-size: .82rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; }

/* タイトル画面 */
.title-screen { min-height: 100vh; position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; padding: 6vh 6vw; background: #000 url(../assets/img/key_art.jpg) center/cover no-repeat; overflow: hidden; }
.title-screen::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.88) 0%, rgba(0,0,0,.55) 45%, rgba(0,0,0,.1) 100%), linear-gradient(0deg, rgba(0,0,0,.8), transparent 50%); }
.title-screen > * { position: relative; }
.logo { font-family: var(--display); font-size: clamp(3rem, 9vw, 7rem); line-height: .95; letter-spacing: .04em; margin: 0; background: linear-gradient(180deg, #fff 30%, var(--gold) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { font-size: clamp(1rem, 2.2vw, 1.35rem); color: var(--gold2); margin: .3em 0 1.8em; font-weight: 700; letter-spacing: .12em; }
.title-menu { display: flex; flex-direction: column; gap: .6rem; min-width: min(360px, 88vw); }
.title-menu .btn { text-align: left; font-size: 1.05rem; }
.version { position: absolute; right: 16px; bottom: 12px; font-size: .75rem; color: #777; }

/* 共通レイアウト */
.page { max-width: 1180px; margin: 0 auto; padding: 24px 16px 80px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel + .panel { margin-top: 14px; }
.grid2 > .panel + .panel, .grid3 > .panel + .panel { margin-top: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.tag { display: inline-block; font-size: .72rem; padding: .15em .6em; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); font-weight: 700; }
.tag.gold { border-color: var(--gold); color: var(--gold); }
.tag.red { border-color: var(--red); color: #ff8a8f; }
.tag.green { border-color: var(--green); color: var(--green); }

/* キャラ作成 */
.steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.steps span { font-size: .78rem; padding: .35em .8em; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.steps span.on { background: var(--gold); color: #111; border-color: var(--gold); font-weight: 700; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; transition: border-color .15s, transform .1s; text-align: left; color: var(--text); font-family: inherit; }
.card:hover { border-color: #5a6280; }
.card.on { border-color: var(--gold); background: linear-gradient(180deg, #232130, var(--panel)); }
.card h4 { margin: 0 0 .35em; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.card p { margin: 0; font-size: .84rem; color: var(--muted); line-height: 1.6; }
.card .img { width: 100%; aspect-ratio: 3/2; background: #000 center 20%/cover no-repeat; border-radius: 6px; margin-bottom: 10px; }
.create-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.preview { position: sticky; top: 16px; }
.preview canvas { width: 100%; background: radial-gradient(ellipse at 50% 60%, #2a2f44, #0c0d12 70%); border-radius: var(--radius); border: 1px solid var(--line); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; font-weight: 700; }
.input, select.input { width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: .65em .8em; font-size: 1rem; font-family: inherit; }
.input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.sw.on { border-color: var(--gold); transform: scale(1.1); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: .45em .9em; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); cursor: pointer; font-size: .88rem; font-family: inherit; }
.chip.on { background: var(--gold); color: #111; border-color: var(--gold); font-weight: 700; }
.alloc { display: grid; grid-template-columns: 110px 1fr 40px 76px; gap: 8px; align-items: center; margin-bottom: 6px; font-size: .9rem; }
.bar { height: 10px; background: #0c0d12; border-radius: 99px; overflow: hidden; border: 1px solid #262a38; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #b8922a, var(--gold2)); border-radius: 99px; }
.bar.blue > i { background: linear-gradient(90deg, #1d63d8, #6fb2ff); }
.bar.red > i { background: linear-gradient(90deg, #a1161c, #ff5a5f); }
.bar.green > i { background: linear-gradient(90deg, #1b8a44, #5de08c); }
.bar.orange > i { background: linear-gradient(90deg, #c45a14, #ffa35c); }
.pm { display: flex; gap: 4px; }
.pm button { width: 34px; height: 30px; padding: 0; }
.nav-bottom { display: flex; justify-content: space-between; margin-top: 20px; gap: 10px; }

/* ハブ */
.hub { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: #0d0f15; border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .me { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.side .me canvas { width: 56px; height: 56px; border-radius: 50%; background: #1a1d28; border: 2px solid var(--gold); }
.side .me b { display: block; font-size: .95rem; }
.side nav { display: flex; flex-direction: column; gap: 3px; }
.side nav button { text-align: left; background: none; border: none; color: var(--muted); padding: .65em .8em; border-radius: 7px; font-size: .92rem; cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: 10px; }
.side nav button svg { width: 18px; height: 18px; flex: none; }
.side nav button:hover { background: var(--panel); color: var(--text); }
.side nav button.on { background: var(--panel2); color: var(--gold2); font-weight: 700; }
.side nav button .dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.main { padding: 16px 22px 100px; min-width: 0; }
.topbar { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; margin-bottom: 14px; }
.topbar .item { display: flex; flex-direction: column; }
.topbar .item small { font-size: .7rem; color: var(--muted); }
.topbar .item b { font-family: var(--display); font-size: 1.1rem; letter-spacing: .02em; }
.advance { position: fixed; right: 22px; bottom: 20px; z-index: 20; box-shadow: 0 8px 30px rgba(0,0,0,.6); }
.gauge { margin-bottom: 10px; }
.gauge .lbl { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: 4px; }
.coach { display: flex; gap: 14px; align-items: flex-start; }
.coach .face { width: 64px; height: 64px; border-radius: 50%; background: #222 url(../assets/img/char_coach.jpg) center 18%/cover; flex: none; border: 2px solid var(--line); }
.coach .bubble { background: var(--panel2); border-radius: 10px; padding: 10px 14px; font-size: .92rem; line-height: 1.7; position: relative; }
.log { list-style: none; margin: 0; padding: 0; font-size: .86rem; max-height: 320px; overflow-y: auto; }
.log li { padding: 6px 0; border-bottom: 1px solid #20242f; display: flex; gap: 8px; }
.log li small { color: var(--muted); flex: none; width: 150px; }
.log li.good { color: #9ff0bb; }
.log li.bad { color: #ffb0b3; }
.log li.warn { color: #ffcf9f; }
.statlist .alloc { grid-template-columns: 110px 1fr 44px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th, .tbl td { padding: 8px 8px; border-bottom: 1px solid #232735; text-align: left; }
.tbl th { color: var(--muted); font-weight: 500; font-size: .78rem; }
.tbl tr.me td { background: rgba(212,175,55,.12); color: var(--gold2); font-weight: 700; }
.tbl-wrap { overflow-x: auto; }

/* 練習プラン */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.day b { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.day select { width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 4px; font-size: .82rem; font-family: inherit; }
.day.blocked select { border-color: var(--red); }
.opt-list { display: grid; gap: 8px; }
.opt { display: flex; gap: 10px; align-items: flex-start; background: var(--panel2); border: 2px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; text-align: left; color: var(--text); font-family: inherit; width: 100%; }
.opt.on { border-color: var(--gold); }
.opt .t { font-weight: 700; font-size: .92rem; }
.opt .d { font-size: .8rem; color: var(--muted); }
.opt .c { margin-left: auto; font-family: var(--display); white-space: nowrap; }

/* オファー */
.offer { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.offer.title { border-color: var(--gold); background: linear-gradient(90deg, rgba(212,175,55,.12), var(--panel2)); }
.offer h4 { margin: 0 0 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.offer .meta { font-size: .82rem; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }

/* 試合前 */
.tape { display: grid; grid-template-columns: 1fr 200px 1fr; gap: 10px; align-items: center; }
.tape .side-f { text-align: center; }
.tape canvas { width: 100%; max-width: 260px; aspect-ratio: 3/4; }
.tape .mid { font-size: .82rem; }
.tape .mid .r { display: grid; grid-template-columns: 1fr 90px 1fr; text-align: center; padding: 5px 0; border-bottom: 1px solid #232735; }
.tape .mid .r span:nth-child(2) { color: var(--muted); font-size: .75rem; }
.tape .mid .r .hi { color: var(--gold2); font-weight: 700; }
.vs { font-family: var(--display); font-size: 3rem; text-align: center; color: var(--gold); }
.event-title { text-align: center; font-family: var(--display); letter-spacing: .08em; color: var(--gold); font-size: 1.1rem; margin-bottom: 4px; }

/* 試合画面 */
#fightWrap { position: fixed; inset: 0; background: #000; display: flex; align-items: center; justify-content: center; z-index: 30; }
#fightWrap[hidden] { display: none; }
#cv { max-width: 100vw; max-height: 100vh; aspect-ratio: 16/9; width: 100%; height: auto; display: block; }
#fightUI { position: absolute; inset: 0; pointer-events: none; }
#fightUI > * { pointer-events: auto; }
.keys { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: .78rem; color: rgba(255,255,255,.6); background: rgba(0,0,0,.5); padding: 6px 12px; border-radius: 8px; white-space: nowrap; }
.keys kbd { background: #222; border: 1px solid #444; border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-family: var(--display); color: #fff; }
.fbtn { position: absolute; top: 10px; }
.corner { position: absolute; inset: 0; background: rgba(5,6,10,.86); display: flex; align-items: center; justify-content: center; padding: 16px; }
.corner .box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; width: min(640px, 100%); max-height: 92vh; overflow-y: auto; }
.corner .checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
#touch { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; align-items: flex-end; padding: 10px; pointer-events: none; }
#touch[hidden] { display: none; }
#touch .pad { display: grid; gap: 6px; pointer-events: auto; }
#touch .pad.l { grid-template-columns: repeat(3, 56px); }
#touch .pad.r { grid-template-columns: repeat(3, 62px); }
#touch button { height: 52px; border-radius: 12px; border: 1px solid rgba(255,255,255,.25); background: rgba(20,22,30,.65); color: #fff; font-weight: 700; font-size: .78rem; font-family: inherit; touch-action: none; user-select: none; -webkit-user-select: none; }
#touch button.on { background: rgba(212,175,55,.7); color: #111; }

/* 結果 */
.result-hero { text-align: center; padding: 30px 10px; }
.result-hero .big { font-family: var(--display); font-size: clamp(2.6rem, 8vw, 5rem); line-height: 1; letter-spacing: .04em; }
.result-hero .win { color: var(--gold); }
.result-hero .lose { color: #ff6b70; }
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.cards3 div { background: var(--panel2); padding: 10px; border-radius: 8px; font-family: var(--display); font-size: 1.2rem; }
.cards3 small { display: block; font-family: var(--font); font-size: .72rem; color: var(--muted); }

/* モーダル・トースト */
#modal:empty { display: none; }
#modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
#modal .box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 22px; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; }
#toast { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
#toast div { background: #1f2330; border: 1px solid var(--gold); padding: 10px 18px; border-radius: 8px; font-size: .9rem; animation: tin .25s; }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }
.video-overlay { position: fixed; inset: 0; background: #000; z-index: 80; display: flex; align-items: center; justify-content: center; }
.video-overlay video { width: 100%; height: 100%; object-fit: contain; }
.video-overlay .skip { position: absolute; right: 16px; bottom: 16px; }
textarea.input { min-height: 90px; font-family: monospace; font-size: .8rem; }
.belt { display: inline-flex; align-items: center; gap: 6px; padding: .3em .7em; border-radius: 6px; background: linear-gradient(180deg, #3b3115, #1d180a); border: 1px solid var(--gold); color: var(--gold2); font-weight: 700; font-size: .82rem; margin: 2px; }
.medal { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-right: 4px; }
.medal.gold { background: radial-gradient(circle at 35% 35%, #fff3b0, #d4af37); }
.medal.silver { background: radial-gradient(circle at 35% 35%, #fff, #a8adb8); }
.medal.bronze { background: radial-gradient(circle at 35% 35%, #ffd2a8, #b0703a); }

@media (max-width: 900px) {
  .hub { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; height: auto; z-index: 10; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .me { display: none; }
  .side nav { flex-direction: row; overflow-x: auto; gap: 2px; }
  .side nav button { white-space: nowrap; padding: .5em .7em; font-size: .82rem; }
  .side nav button svg { display: none; }
  .main { padding: 12px 16px 110px; }
  .grid2, .grid3, .create-layout { grid-template-columns: 1fr; }
  .preview { position: static; order: -1; }
  .preview canvas { max-height: 260px; object-fit: contain; }
  .week { grid-template-columns: repeat(2, 1fr); }
  .tape { grid-template-columns: 1fr 1fr; }
  .tape .mid { grid-column: 1 / -1; order: 3; }
  .log li small { width: 110px; }
  .advance { left: 16px; right: 16px; bottom: 12px; }
  .keys { display: none; }
  .alloc { grid-template-columns: 90px 1fr 34px 76px; }
}

/* 臨場感: 実況テロップ・セコンドの声・入場紹介・ラウンド統計 */
.ticker { position: absolute; left: 3%; bottom: 13%; max-width: 62%; display: flex; align-items: stretch; opacity: 0; pointer-events: none; }
.ticker.show { animation: tickerIn 5.5s forwards; }
@keyframes tickerIn { 0% { opacity: 0; transform: translateX(-12px); } 5% { opacity: 1; transform: none; } 82% { opacity: 1; } 100% { opacity: 0; } }
.ticker .who { background: #c0141c; color: #fff; font-weight: 900; font-size: .8rem; padding: 6px 10px; display: flex; align-items: center; }
.ticker .txt { background: rgba(8,9,14,.88); color: #fff; font-weight: 700; font-size: clamp(.78rem, 1.4vw, 1rem); padding: 6px 14px; border-left: 3px solid var(--gold); }
.shout { position: absolute; left: 3%; top: 21%; background: rgba(255,255,255,.92); color: #111; font-weight: 900; padding: 6px 12px; border-radius: 14px; font-size: clamp(.75rem, 1.3vw, .95rem); opacity: 0; pointer-events: none; }
.shout.show { animation: shout 3s forwards; }
@keyframes shout { 0% { opacity: 0; transform: scale(.9); } 8% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.intro-cards { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 0 6%; background: linear-gradient(90deg, rgba(0,0,0,.75), rgba(0,0,0,.2)); }
.intro-cards .ititle { font-family: var(--display); color: var(--gold); letter-spacing: .1em; font-size: clamp(1rem, 2.4vw, 1.6rem); }
.icard { opacity: 0; transform: translateX(-40px); transition: all .6s cubic-bezier(.2,.8,.2,1); border-left: 6px solid #c0141c; background: rgba(10,10,16,.85); padding: 12px 20px; max-width: 640px; }
.icard.blue { border-color: #1a3fbf; }
.icard.show { opacity: 1; transform: none; }
.icard .corner-lbl { font-size: .8rem; color: var(--muted); font-weight: 700; letter-spacing: .1em; }
.icard .nm { font-size: clamp(1.4rem, 3.6vw, 2.6rem); font-weight: 900; display: flex; align-items: center; gap: 12px; }
.icard .sub { color: var(--gold2); font-size: .9rem; }
.iskip { position: absolute; right: 16px; bottom: 16px; }
.rstats { display: grid; gap: 6px; margin-top: 10px; }
.rs { display: grid; grid-template-columns: 34px 1fr 34px 60px; gap: 8px; align-items: center; font-family: var(--display); }
.rs small { color: var(--muted); font-family: var(--font); font-size: .75rem; }
.rb { height: 8px; background: #1a3fbf; border-radius: 99px; overflow: hidden; }
.rb i { display: block; height: 100%; background: #c0141c; }

.side .me .avimg { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); flex: none; }
