.match { max-width: 1560px; margin: 0 auto; padding: 18px clamp(12px, 2vw, 28px) 40px; }

.mhead { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-bottom: 16px; }
.mhead .side { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-size: clamp(18px, 2.2vw, 28px); letter-spacing: 1px; }
.mhead .side.p2 { justify-content: flex-end; }
.mhead .side .nm { text-shadow: 0 0 18px var(--s); }
.mhead .mid { text-align: center; }
.mhead .vs { font-family: var(--num); font-weight: 800; font-size: 13px; letter-spacing: 6px; color: var(--gold); }
.mhead .turn { font: 700 clamp(26px, 3vw, 40px) var(--num); line-height: 1; margin: 2px 0 6px; letter-spacing: 1px; }
.mhead .turn small { font-size: .5em; color: var(--mute); }
.mhead .meta { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--dim); }

.timer { position: relative; width: 46px; height: 46px; margin: 0 auto 4px; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 4; }
.timer .bg { stroke: rgba(255,255,255,.08); }
.timer .fg { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke .3s; }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font: 700 14px var(--num); }

.avatar {
  display: inline-grid; place-items: center; border-radius: 50%; color: var(--c); flex: none;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 35%, #000), #0f1019 70%);
  box-shadow: 0 0 0 2px var(--s), 0 0 22px color-mix(in srgb, var(--c) 45%, transparent);
}
.avatar .cls-icon { width: 60%; height: 60%; }

.mgrid { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr) minmax(250px, 320px); gap: 18px; align-items: start; }
.stage { position: relative; padding: 26px clamp(10px, 3vw, 46px) 60px; }
.stage-inner { max-width: min(100%, calc((100vh - 230px) * 1.22)); margin: 0 auto; }

.viewtoggle { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0,0,0,.45); border: 1px solid var(--line); }
.viewtoggle button { white-space: nowrap; border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 12px; color: var(--dim); }
.viewtoggle button.on { background: rgba(255,255,255,.1); color: #fff; }

/* 角色卡 */
.pcard { padding: 18px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.pcard::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, transparent, var(--s), transparent); }
.pcard::after { content: ''; position: absolute; width: 260px; height: 260px; top: -140px; right: -100px; background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 30%, transparent), transparent); pointer-events: none; }
.pc-head { display: flex; gap: 14px; align-items: center; }
.pc-head .who { min-width: 0; }
.pc-head .nm { font-family: var(--display); font-size: 22px; letter-spacing: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-head .cls { font-size: 12px; color: var(--c); font-weight: 700; letter-spacing: 1px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; background: rgba(255,255,255,.06); border: 1px solid var(--line2); color: var(--dim); margin-top: 4px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.motto { font-size: 12px; color: var(--dim); font-style: italic; }

.bar-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--mute); letter-spacing: 1px; margin-bottom: 5px; }
.bar-label b { font: 700 15px var(--num); color: var(--text); letter-spacing: 0; }
.hpbar { position: relative; height: 14px; border-radius: 8px; background: rgba(0,0,0,.5); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.hpbar .ghost, .hpbar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 8px; }
.hpbar .ghost { background: rgba(255,255,255,.55); transition: width 1.1s .35s ease; }
.hpbar .fill { background: linear-gradient(90deg, color-mix(in srgb, var(--s) 70%, #000), var(--s)); transition: width .35s ease; box-shadow: 0 0 14px var(--s); }
.hpbar .fill.low { background: linear-gradient(90deg, #7a0d1f, var(--danger)); box-shadow: 0 0 14px var(--danger); }
.energy { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.energy i { height: 7px; border-radius: 3px; background: rgba(255,255,255,.08); transition: background .3s; }
.energy i.on { background: linear-gradient(180deg, #9ff0ff, #3bb6ff); box-shadow: 0 0 8px rgba(71,198,255,.6); }

.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sk { position: relative; aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; font-family: var(--display); font-size: 20px; color: var(--c); background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); overflow: hidden; }
.sk .cost { position: absolute; right: 4px; bottom: 2px; font: 700 10px var(--num); color: #7fd2ff; }
.sk .cd { position: absolute; inset: 0; display: none; place-items: center; background: rgba(5,6,10,.72); color: #fff; font: 700 18px var(--num); }
.sk.cooling .cd { display: grid; }
.sk.used { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(245,199,107,.6); }
.sk-tip { font-size: 11px; color: var(--mute); text-align: center; margin-top: -6px; min-height: 14px; }

.state { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); min-height: 20px; }
.state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mute); }
.state.thinking .dot { background: var(--gold); animation: blink 1s infinite; }
.state.done .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.statuses { display: flex; gap: 6px; flex-wrap: wrap; min-height: 22px; }
.statuses span { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--line2); }

.thought { position: relative; padding: 12px 14px; border-radius: 12px; background: rgba(0,0,0,.32); border: 1px dashed rgba(255,255,255,.12); min-height: 96px; }
.thought h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: 3px; color: var(--gold); font-weight: 700; }
.thought p { margin: 0; font-size: 13px; line-height: 1.65; color: #cfd3e6; }
.thought p.none { color: var(--mute); font-style: italic; }
.caret::after { content: '▍'; animation: blink .8s infinite; color: var(--gold); }

/* 控制条 */
.controls { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 18px 0; }
.controls .ib { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line2); background: rgba(255,255,255,.04); display: grid; place-items: center; font-size: 14px; }
.controls .ib:hover { background: rgba(255,255,255,.1); }
.controls .ib.play { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--gold2), var(--gold)); color: #1a1000; border: 0; font-size: 16px; }
.timeline { position: relative; flex: 1; height: 36px; display: flex; align-items: center; }
.timeline input { width: 100%; accent-color: var(--gold); }
.marks { position: absolute; left: 8px; right: 8px; top: 0; height: 10px; pointer-events: none; }
.marks i { position: absolute; top: 0; width: 4px; height: 8px; border-radius: 2px; transform: translateX(-50%); }
.speed { display: flex; gap: 2px; }
.speed button { border: 1px solid var(--line2); background: transparent; padding: 6px 9px; font: 700 12px var(--num); border-radius: 8px; color: var(--dim); }
.speed button.on { color: #1a1000; background: var(--gold); border-color: var(--gold); }
.follow { font-size: 12px; }

.feeds { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; }
.feed { padding: 16px; height: 300px; display: flex; flex-direction: column; }
.feed h3 { margin: 0 0 10px; font-size: 13px; letter-spacing: 3px; color: var(--gold); font-weight: 700; }
.feed .list { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.line { display: flex; gap: 10px; align-items: flex-start; animation: lineIn .3s ease both; }
@keyframes lineIn { from { opacity: 0; transform: translateY(6px); } }
.line .bub { padding: 7px 11px; border-radius: 12px 12px 12px 4px; background: rgba(255,255,255,.06); border: 1px solid color-mix(in srgb, var(--s) 40%, transparent); font-size: 13px; line-height: 1.5; }
.line.p2 { flex-direction: row-reverse; }
.line.p2 .bub { border-radius: 12px 12px 4px 12px; }
.line .t { font: 700 10px var(--num); color: var(--mute); margin-top: 10px; flex: none; }
.log .row { font-size: 12.5px; color: #c3c7da; line-height: 1.55; padding-left: 10px; border-left: 2px solid transparent; }
.log .row.turn { color: var(--gold); font-weight: 700; border: 0; padding: 6px 0 0; letter-spacing: 2px; }
.log .row.hit { border-color: var(--danger); }
.log .row.death, .log .row.end { color: #fff; font-weight: 700; border-color: var(--gold); }

/* 结算 */
.result { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; background: radial-gradient(circle at 50% 45%, rgba(20,16,40,.7), rgba(3,3,8,.92)); backdrop-filter: blur(6px); }
.result.show { display: grid; animation: fadeIn .5s; }
@keyframes fadeIn { from { opacity: 0; } }
.result .card { text-align: center; padding: 40px 56px; position: relative; }
.result .rays { position: absolute; left: 50%; top: 110px; width: 520px; height: 520px; transform: translate(-50%, -50%); background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--c) 30%, transparent) 0 8deg, transparent 8deg 20deg); border-radius: 50%; mask: radial-gradient(closest-side, #000 30%, transparent); animation: spin 30s linear infinite; z-index: -1; }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.result .big { font-family: var(--display); font-size: clamp(48px, 8vw, 92px); letter-spacing: 12px; margin: 18px 0 4px; background: linear-gradient(180deg, #fff, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 30px rgba(245,199,107,.5)); }
.result .who { font-size: 22px; font-weight: 700; }
.result .why { color: var(--dim); margin: 8px 0 22px; }
.result .elo { display: flex; gap: 28px; justify-content: center; margin-bottom: 26px; font-size: 13px; color: var(--dim); }
.result .elo b { font: 700 20px var(--num); display: block; color: var(--text); }
.result .elo .up { color: var(--ok); }
.result .elo .down { color: var(--danger); }
.result .acts { display: flex; gap: 12px; justify-content: center; }

.countdown { position: absolute; inset: 0; display: none; place-items: center; z-index: 50; pointer-events: none; }
.countdown.show { display: grid; }
.countdown div { font-family: var(--display); font-size: clamp(40px, 7vw, 84px); letter-spacing: 8px; text-shadow: 0 0 30px var(--gold); color: #fff; }

@media (max-width: 1180px) {
  .mgrid { grid-template-columns: 1fr 1fr; }
  .stage { grid-column: 1 / -1; order: -1; }
  .feeds { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .mgrid { grid-template-columns: 1fr; }
  .mhead { grid-template-columns: 1fr; text-align: center; }
  .mhead .side, .mhead .side.p2 { justify-content: center; }
  .controls { flex-wrap: wrap; }
}
