@charset "UTF-8";
@import url("https://bj-cdn.geemii.com/fonts/noto-sans-sc.css");
@import url("/lobby.css");
:root {
  --paper: #191d1e;
  --surface: #232b2a;
  --raised: #303d39;
  --control: #1c2422;
  --primary: #a73f38;
  --success: #9bd1af;
  --warning: #e4c18c;
  --danger: #efa28d;
  color-scheme: dark;
  --ink: #f0f1ec;
  --muted: #b6c1b9;
  --line: #b6aa8540;
  --red: #dc8c7b;
  --gold: #d9bd83;
  --white: #1c2422;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  font-size: 14px;
  line-height: 1.65;
}
/* Keep ordinary pages clear of the camera cutout with an edge-to-edge viewport. */
body:not(.in-battle) {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 10px 19px;
  border-radius: 5px;
  transition:
    background 0.16s,
    transform 0.16s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-decoration: none;
}
button:hover,
.button:hover {
  background: var(--surface);
}
button:active {
  transform: translateY(1px);
}
button:disabled {
  cursor: wait;
  opacity: 0.5;
}
button.primary,
.button.primary {
  background: var(--primary);
  color: #fff9eb;
  border-color: var(--line);
}
button.primary:hover,
.button.primary:hover {
  background: #bc4a40;
}
.text-button {
  border: none;
  padding: 6px 0;
  gap: 4px;
}
.small-button {
  padding: 5px 15px;
  font-size: 12px;
}
.full {
  width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3,
.brand,
.portrait-name {
  font-family:
    "Songti SC", "Noto Serif CJK SC", "SimSun", "Noto Sans SC", serif;
}
h1 {
  font-size: 38px;
  letter-spacing: 3px;
  line-height: 1.35;
  font-weight: 600;
}
h2 {
  font-size: 25px;
  font-weight: 600;
}
h3 {
  font-size: 20px;
  font-weight: 600;
}
p {
  line-height: 1.85;
}
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
  color: var(--ink);
  padding: 11px 12px;
  margin-top: 6px;
  outline: none;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #678676;
  box-shadow: 0 0 0 3px #67867619;
}
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
textarea {
  line-height: 1.8;
}
input:disabled {
  background: var(--raised);
  color: #777;
}
.site-header {
  height: 94px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
  max-width: 1320px;
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 4px;
}
.brand:hover {
  text-decoration: none;
}
.brand small {
  display: block;
  font:
    8px "Noto Sans SC",
    sans-serif;
  letter-spacing: 4px;
  margin-top: 7px;
}
.seal {
  background: var(--red);
  color: #fff4dc;
  font-size: 28px;
  border-radius: 3px;
  padding: 5px 7px;
  outline: 1px solid #f3d1b8;
  outline-offset: -4px;
  line-height: 1.3;
  font-weight: 400;
}
.site-header > nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-header > nav > span { display: flex; align-items: center; gap: 28px; }
.site-header > nav a {
  font-size: 14px;
  padding: 33px 2px;
}
.site-header > nav [hidden] { display: none; }
.site-header .account-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.site-header #account-nav button { padding: 6px 10px; font-size: 11px; }
.site-header > nav .current {
  border-bottom: 2px solid #bc6657;
}
.edition {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 3px;
}
main {
  max-width: 1320px;
  margin: auto;
  padding: 0 36px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--muted);
  display: block;
  text-transform: uppercase;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.muted {
  color: var(--muted);
}
.fine-print {
  font-size: 11px;
  color: var(--muted);
  margin-top: 16px;
}
.fine-print i {
  font-style: normal;
  margin: 0 15px;
  color: #b2b6a9;
}
.welcome {
  min-height: 495px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 32px;
  padding: 38px 40px;
}
.welcome h1 {
  font-size: 56px;
  line-height: 1.35;
  letter-spacing: 6px;
  margin: 20px 0;
}
.welcome h1 span {
  color: var(--red);
}
.welcome p {
  color: var(--muted);
  line-height: 1.95;
  margin-bottom: 26px;
}
.welcome .primary {
  min-width: 184px;
}
.welcome-art {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}
.art-ring {
  position: absolute;
  width: 335px;
  height: 335px;
  border: 1px solid var(--line);
  border-radius: 50%;
  opacity: 0.6;
}
.art-ring:after {
  content: "";
  position: absolute;
  inset: -17px;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.featured-card {
  position: relative;
  width: 230px;
  transform: rotate(7deg);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 10px;
  box-shadow: 12px 20px 42px #243c3519;
}
.featured-card > .portrait {
  height: 292px;
}
.featured-card > div:last-child {
  padding: 13px 8px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.featured-card b {
  font:
    22px "SimSun",
    "Noto Sans SC",
    serif;
  letter-spacing: 4px;
}
.featured-card > div:last-child > span {
  font-size: 9px;
  color: var(--muted);
}
.vertical-note {
  writing-mode: vertical-rl;
  position: absolute;
  right: 15px;
  font:
    13px "SimSun",
    "Noto Sans SC",
    serif;
  letter-spacing: 6px;
  color: var(--muted);
}
.section {
  padding: 36px 0;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}
.section-heading .eyebrow {
  margin-bottom: 9px;
}
.section-heading > a {
  font-size: 12px;
  color: var(--muted);
}
.hero-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}
.hero-tile {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.hero-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px #243c3510;
}
.hero-tile .portrait {
  height: 224px;
}
.portrait {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100px;
  background: linear-gradient(155deg, #c8d4c3 0%, #899f91 60%, #526c5e 100%);
  color: #e9eddd;
}
.portrait.ochre {
  background: linear-gradient(155deg, #e4d7b8, #b09d75 60%, #75654a);
}
.portrait.crimson {
  background: linear-gradient(155deg, #dccbc1, #b08679 60%, #794f47);
}
.portrait.indigo {
  background: linear-gradient(155deg, #c8d0d5, #8899a6 60%, #4f6574);
}
.portrait:after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 70px #263d3220;
  pointer-events: none;
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  display: block;
}
.mountains {
  position: absolute;
  inset: 20% -30% -30%;
  background: linear-gradient(
    140deg,
    transparent 42%,
    #233e3416 42%,
    #233e343b 67%,
    transparent 67%
  );
  transform: rotate(-9deg);
}
.mountains:before {
  content: "";
  position: absolute;
  inset: 15% -10% 0;
  background: linear-gradient(
    45deg,
    transparent 30%,
    #203e3320 31%,
    #203e3308 60%,
    transparent 60%
  );
  transform: rotate(13deg);
}
.portrait-glyph {
  font:
    130px "Songti SC",
    "SimSun",
    "Noto Sans SC",
    serif;
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  opacity: 0.26;
  line-height: 1;
}
.portrait-caption {
  position: absolute;
  bottom: 18px;
  left: 20px;
  font-size: 9px;
  letter-spacing: 3px;
  opacity: 0.7;
}
.portrait-name {
  position: absolute;
  right: 15px;
  top: 20px;
  writing-mode: vertical-rl;
  font-size: 22px;
  letter-spacing: 7px;
  text-shadow: 0 2px 8px #172e3355;
}
.portrait img ~ .portrait-name {
  background: #22392c77;
  padding: 8px 4px;
}
.recent-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}
.recent-list a {
  border: 1px solid var(--line);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.recent-list span {
  font-size: 11px;
  color: var(--muted);
}
footer {
  padding: 25px 0 35px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
}
.count {
  font:
    12px "Noto Sans SC",
    sans-serif;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2px 9px;
  vertical-align: middle;
}
.empty {
  padding: 50px 20px;
  text-align: center;
  border: 1px dashed var(--line);
  margin-top: 18px;
  border-radius: 8px;
}
.empty > span {
  font-size: 30px;
  color: var(--gold);
}
.empty p {
  margin: 12px 0 20px;
  color: var(--muted);
}
.spaced {
  margin: 40px 0 22px;
}
.library > .hero-grid {
  margin-top: 20px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
}
.studio {
  padding: 30px 0 60px;
}
.studio h1 {
  font-size: 30px;
  margin-top: 8px;
}
.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 40px;
}
.editor-column {
  display: grid;
  gap: 20px;
}
.editor-column h2 {
  font:
    20px "Noto Sans SC",
    sans-serif;
  margin: 12px 0;
}
.chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 12px 0 18px;
}
.chips button {
  border-radius: 25px;
  font-size: 10px;
  padding: 5px 10px;
  color: var(--muted);
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 15px;
}
.notice {
  padding: 13px 15px;
  border-left: 3px solid #bd9a60;
  background: var(--surface);
  font-size: 12px;
  margin: 18px 0;
  color: var(--warning);
}
.notice a {
  text-decoration: underline;
}
.preview-column {
  position: sticky;
  top: 25px;
  align-self: start;
  padding: 0 25px;
}
.preview-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 14px;
  letter-spacing: 2px;
}
.preview-card {
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 15px 35px #253c3510;
}
.preview-card .portrait {
  height: 330px;
  border-radius: 3px;
}
.preview-details {
  padding: 22px 18px;
}
.preview-details h2 {
  font-size: 30px;
  margin-top: 4px;
}
.hp {
  color: var(--red);
  font-size: 12px;
  letter-spacing: 2px;
}
.hp small {
  display: block;
  text-align: right;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
}
.bio {
  font-size: 12px;
  color: var(--muted);
  margin: 18px 0;
}
.printed-skill {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 15px 0 0;
  margin-top: 15px;
}
.printed-skill b {
  font:
    16px "SimSun",
    "Noto Sans SC",
    serif;
  writing-mode: vertical-rl;
  letter-spacing: 4px;
  background: var(--surface);
  padding: 8px;
  align-self: start;
}
.printed-skill p {
  font-size: 12px;
  line-height: 1.9;
}
.skill-editor {
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 5px 0 20px;
  margin: 12px 0 18px;
  min-width: 0;
}
.skill-editor legend {
  width: 100%;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.skill-editor legend button {
  font-size: 11px;
}
.skill-editor > .skill-name {
  line-height: 1.25;
}
.skill-description {
  background: var(--surface);
  padding: 6px 0;
  border-radius: 5px;
  font-size: 12px;
  margin-top: 0;
}
.skill-description .skill-description-view {
  margin: 0;
}
.skill-description .skill-tags {
  margin-top: 4px;
}
.skill-editor > .row {
  margin-top: 8px;
}
.skill-editor > .row :is(button, .button) {
  padding: 6px 13px;
  font-size: 12px;
}
.setup {
  max-width: 720px;
  margin: 60px auto;
}
.setup h1 {
  margin: 14px 0;
}
.setup-preview {
  display: flex;
  gap: 25px;
  align-items: center;
  margin: 28px 0;
}
.setup-preview .portrait {
  width: 130px;
  height: 170px;
  flex-shrink: 0;
  border-radius: 5px;
}
.setup-preview p {
  font-size: 13px;
  margin-top: 8px;
}
.small .portrait-glyph {
  font-size: 80px;
}
.loading {
  padding: 120px 20px;
  text-align: center;
  color: var(--muted);
}
.login {
  max-width: 440px;
  margin: 100px auto;
}
.login h1 {
  margin: 15px 0 30px;
}
.auth-shell { min-height: calc(100dvh - 95px); display: grid; grid-template-columns: 1fr minmax(320px, 440px); align-items: center; gap: 80px; max-width: 1040px; margin: auto; }
.auth-copy h1 { margin: 16px 0 20px; font-size: clamp(34px, 5vw, 58px); }
.auth-copy p { max-width: 520px; color: var(--muted); font-size: 15px; }
.auth-shell .login { width: 100%; margin: 40px 0; padding: 28px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: -8px 0 20px; border-bottom: 1px solid var(--line); }
.auth-tabs a { padding: 10px; text-align: center; color: var(--muted); }
.auth-tabs a.current { color: var(--ink); border-bottom: 2px solid var(--gold); font-weight: 700; }
.admin-page { padding: 54px 0 90px; }
.admin-page > .section-heading { margin-bottom: 28px; }
.assignment-panel { padding: 24px; }
.assignment-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 20px; }
.assignment-heading h2 { margin: 0; font-size: 24px; }
.assignment-heading p { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.assignment-save { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.assignment-save [role="status"] { font-size: 12px; color: var(--muted); }
.assignment-save button { white-space: nowrap; }
.assignment-list { min-width: 0; margin: 0; padding: 0; border: 0; border-top: 1px solid var(--line); }
.assignment-field { border-bottom: 1px solid var(--line); }
.assignment-field:last-child { border-bottom: 0; }
.assignment-main { display: grid; grid-template-columns: 160px minmax(0, 1fr) 200px; align-items: center; gap: 24px; min-height: 88px; padding: 16px 0; }
.assignment-title { display: grid; gap: 5px; }
.assignment-title label { margin: 0; color: var(--ink); font-size: 14px; }
.assignment-title [data-assignment-status] { font-size: 11px; }
.assignment-model { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; min-width: 0; }
.assignment-model > select { flex: 1 1 160px; width: 0; min-width: min(160px, 100%); margin: 0; text-overflow: ellipsis; }
.assignment-decision-control { flex-shrink: 0; }
.assignment-decision-control [hidden] { display: none; }
.assignment-decision-control strong { font-size: 13px; font-weight: 500; }
.assignment-no-settings { text-align: right; color: var(--muted); padding-right: 12px; }
.decision-mode-options { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; padding: 3px; gap: 3px; background: var(--paper); }
.decision-mode-options label { position: relative; margin: 0; cursor: pointer; }
.decision-mode-options input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.decision-mode-options span { display: block; padding: 8px 12px; border-radius: 4px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.decision-mode-options input:checked + span { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.decision-mode-options input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.ready-text { color: var(--success); }
.warning-text { color: var(--danger); }
.admin-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 42px 0 14px; }
.admin-heading p { color: var(--muted); font-size: 12px; }
.admin-heading code { color: var(--warning); }
.clear-provider-key { display: flex; align-items: center; gap: 8px; width: fit-content; margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.clear-provider-key input { width: auto; margin: 0; }
.provider-list { display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; }
.provider-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.provider-row > div:first-child { min-width: 0; }
.provider-row h3 { margin: 0; font-size: 17px; }
.provider-row p { max-width: 680px; margin: 6px 0 0; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-type { padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; }
.provider-status { padding: 4px 9px; border-radius: 999px; background: var(--surface); color: var(--danger); font-size: 10px; }
.provider-status.ready { background: var(--surface); color: var(--success); }
.provider-modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 24px; background: #15241dcc; backdrop-filter: blur(5px); }
.provider-modal-card { position: relative; width: min(720px, 100%); max-height: calc(100dvh - 48px); overflow: auto; padding: 30px; border-radius: 12px; background: var(--paper); box-shadow: 0 24px 80px #0d1812aa; }
.provider-modal-card h2 { margin: 6px 44px 22px 0; }
.provider-modal-close { position: absolute; top: 18px; right: 18px; width: 36px; min-width: 0; height: 36px; padding: 0; border-radius: 50%; font-size: 22px; }
.provider-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.provider-fields .wide { grid-column: 1 / -1; }
.assignment-thinking { display: flex; align-items: center; gap: 8px; min-width: 0; }
.assignment-thinking > label { margin: 0; white-space: nowrap; font-size: 12px; color: var(--muted); }
.assignment-thinking[hidden] { display: none; }
.assignment-thinking > label:not(.provider-thinking-toggle) { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; }
.assignment-thinking select { flex: 1; width: 0; min-width: 0; margin: 0; }
.assignment-thinking small { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.provider-thinking-toggle { display: flex; align-items: center; gap: 8px; margin: 0; }
.provider-thinking-toggle input { width: auto; margin: 0; }
.provider-model-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 24px 0 10px; }
.provider-model-heading h3, .provider-model-heading p { margin: 0; }
.provider-model-heading p { color: var(--muted); font-size: 12px; }
.provider-model-list { display: grid; gap: 8px; }
.provider-model-row { display: grid; grid-template-columns: minmax(0, 1fr) 155px 150px 85px auto; gap: 8px; align-items: center; }
.provider-model-row:has([data-provider-model-cache][hidden]) { grid-template-columns: minmax(0, 1fr) 180px 100px auto; }
.provider-model-row:has([data-provider-model-api][hidden]) { grid-template-columns: minmax(0, 1fr) 100px auto; }
.provider-model-row input, .provider-model-row select { margin: 0; font-family: ui-monospace, monospace; }
.provider-modal-actions { display: flex; gap: 10px; margin-top: 24px; }
.music-panel { margin-top: 24px; }
.system-content-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 18px; }
.system-content-card { display: flex; min-width: 0; padding: 24px; flex-direction: column; }
.system-content-card-heading { align-items: flex-start; gap: 16px; }
.system-content-card h3 { margin: 24px 0 8px; font-size: 16px; }
.system-content-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 22px 0; }
.system-content-stats span { padding: 16px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); text-align: center; }
.system-content-stats b { display: block; margin-bottom: 3px; color: var(--ink); font-size: 24px; }
.system-content-summary { flex: 1; }
.system-content-summary p { line-height: 1.8; }
.system-content-actions { flex-wrap: wrap; margin-top: 22px; }
.preset-card-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.preset-card-summary span { padding: 7px 10px; border-radius: 999px; background: var(--surface); font-size: 12px; }
.expansion-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.expansion-card { display: flex; flex-direction: column; min-width: 0; }
.expansion-card > img, .expansion-background { width: 100%; max-height: 300px; object-fit: cover; border-radius: 8px; }
.expansion-card p { overflow-wrap: anywhere; margin: 12px 0; }
.background-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; margin-top: 20px; }
.background-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.background-card h3 { margin: 10px 0; font-size: 16px; overflow-wrap: anywhere; }
.background-card .expansion-background { display: block; height: auto; max-height: none; aspect-ratio: auto; object-fit: contain; }
.preset-inline { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.preset-inline:last-child { border-bottom: 0; }
.preset-inline h3, .preset-inline p { margin: 0; }
.expansion-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px; margin: 16px 0; }
.expansion-checks label { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 6px; }
.expansion-checks input { width: 18px; height: 18px; margin: 0; flex: none; }
.expansion-selection { margin: 24px 0; padding: 0; border: 0; }
.expansion-editor .panel { margin-top: 20px; }
.expansion-editor .panel-row { margin-bottom: 20px; }
.music-panel > p { margin-top: 8px; font-size: 12px; }
.music-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.music-card { display: flex; flex-direction: column; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.music-card h3 { font-size: 17px; }
.music-card > .row > span { font-size: 10px; color: var(--muted); }
.music-card label { flex: 1; }
.music-card textarea { min-height: 128px; }
.music-card audio { width: 100%; height: 38px; margin: 4px 0; }
.music-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.music-actions button:only-child { grid-column: 1 / -1; }
.danger-button { margin-left: auto; color: var(--danger); }
.provider-modal-actions .danger-button { margin-left: 0; }
.provider-modal-actions [data-cmd="save-provider"] { margin-left: auto; }
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 20px);
  max-width: min(90vw, 600px);
  padding: 13px 25px;
  border-radius: 7px;
  background: #233e35;
  color: #fff9ec;
  box-shadow: 0 5px 30px #1c32282b;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 2100;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.game-page {
  padding: 23px 0 50px;
}
.game-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.game-heading h2 {
  font-size: 24px;
}
.game-heading .row {
  font-size: 12px;
}
.game-heading button {
  font-size: 11px;
  padding: 7px 12px;
}
.mode-pill {
  background: var(--surface);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
}
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 20px;
}
.table-column {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.opponents {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 18px 0;
}
.seat {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  position: relative;
  min-width: 0;
}
.seat.active {
  border-color: #a98448;
  box-shadow: 0 0 0 2px #ae8c5444;
}
.seat.dead, .self-general.dead {
  filter: grayscale(1);
  opacity: 1;
}
.seat .portrait {
  height: 116px;
  border-radius: 5px 5px 0 0;
}
.seat .portrait-name {
  font-size: 15px;
  letter-spacing: 3px;
  right: 10px;
  top: 12px;
}
.seat .portrait-caption {
  font-size: 8px;
  bottom: 10px;
  left: 10px;
}
.seat-info {
  padding: 10px;
}
.role {
  display: inline-block;
  font-size: 10px;
  background: var(--surface);
  color: var(--muted);
  padding: 2px 7px;
  border-radius: 3px;
  white-space: nowrap;
}
.role.lord {
  background: var(--surface);
  color: var(--danger);
}
.seat-info h3 {
  font-size: 18px;
  margin: 4px 0;
}
.seat-info > .health,
.seat-info > .muted {
  display: block;
  font-size: 10px;
}
.health {
  color: var(--danger);
  font-size: 12px;
}
.seat-skills {
  margin-top: 6px;
  font-size: 10px;
}
.seat-skills details {
  border-top: 1px solid var(--line);
}
.seat-skills summary {
  cursor: pointer;
  padding: 3px 0;
}
.seat-skills p {
  font-size: 10px;
  line-height: 1.7;
  padding: 5px 0;
}
.table-center {
  min-height: 195px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 20px;
  isolation: isolate;
}
.table-watermark {
  position: absolute;
  font:
    80px "SimSun",
    "Noto Sans SC",
    serif;
  letter-spacing: 30px;
  color: #425d4610;
  z-index: -1;
  white-space: nowrap;
}
.deck-label {
  font-size: 10px;
  color: var(--muted);
  position: absolute;
  top: 12px;
  right: 16px;
}
.player-area {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 17px 20px;
}
.self-heading,
.self-heading > div {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
}
.self-heading {
  justify-content: space-between;
  font-size: 11px;
}
.self-heading b {
  font:
    20px "SimSun",
    "Noto Sans SC",
    serif;
}
.self-heading > span {
  color: var(--muted);
}
.self-skills {
  display: flex;
  gap: 16px;
  font-size: 11px;
  margin: 12px 0;
}
.self-skills summary {
  cursor: pointer;
  color: var(--muted);
}
.self-skills details {
  max-width: 360px;
}
.self-skills p {
  background: var(--surface);
  padding: 10px;
  margin-top: 5px;
}
.hand {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  /* Top padding keeps lifted selected cards inside the scroll area. */
  padding: 18px 3px;
  min-height: 130px;
}
.playing-card {
  width: 74px;
  min-width: 74px;
  height: 107px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 5px 7px;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: 0 2px 3px #243c3510;
}
.playing-card > span {
  align-self: flex-start;
  font-size: 9px;
  color: var(--muted);
}
.playing-card b {
  font:
    36px "SimSun",
    "Noto Sans SC",
    serif;
}
.playing-card small {
  font-size: 8px;
  color: var(--muted);
}
.playing-card.unavailable {
  background: var(--surface);
  color: var(--muted);
}
.playing-card.playable {
  border-color: #7e9871;
}
.playing-card:hover {
  transform: translateY(-4px);
}
.playing-card.selected {
  border: 2px solid var(--gold);
  background: var(--surface);
  transform: translateY(-7px);
}
.card-tip {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}
.action-zone {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.action-zone > p {
  font-size: 12px;
  color: var(--muted);
  min-height: 22px;
}
.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.action-buttons button {
  font-size: 11px;
  padding: 8px 12px;
}
.battle-log {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  align-self: start;
  overflow: hidden;
}
.battle-log h3 {
  font:
    15px "Noto Sans SC",
    sans-serif;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.battle-log h3 span {
  font-size: 9px;
  color: var(--muted);
  float: right;
  margin-top: 3px;
}
#log-scroll {
  height: 575px;
  overflow: auto;
  padding: 0 14px;
  scrollbar-width: thin;
}
#log-scroll p {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.9;
}
#log-scroll small {
  display: inline-block;
  font-size: 8px;
  margin-right: 7px;
  color: var(--muted);
  min-width: 15px;
}
.result {
  margin-top: 25px;
  text-align: center;
}
.result h2 {
  margin: 15px 0;
}
.result p {
  font-size: 12px;
  color: var(--muted);
}
.result .row {
  justify-content: center;
  margin-top: 22px;
}
.result-stats {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 18px;
  font-size: 13px;
}
@media (min-width: 1500px) {
  .site-header,
  main {
    max-width: 1400px;
  }
  .hero-tile .portrait {
    height: 250px;
  }
  .welcome {
    min-height: 540px;
  }
  .welcome h1 {
    font-size: 64px;
  }
  .featured-card {
    width: 250px;
  }
  .featured-card > .portrait {
    height: 315px;
  }
  .seat .portrait {
    height: 145px;
  }
}
@media (max-width: 1000px) {
  .site-header,
  main {
    padding-left: 22px;
    padding-right: 22px;
  }
  .welcome {
    padding: 35px 10px;
  }
  .welcome h1 {
    font-size: 47px;
  }
  .hero-grid {
    gap: 14px;
  }
  .hero-tile .portrait {
    height: 180px;
  }
  .studio-layout {
    gap: 20px;
    grid-template-columns: 1fr 0.85fr;
  }
  .preview-column {
    padding: 0;
  }
  .preview-card .portrait {
    height: 260px;
  }
  .game-layout {
    grid-template-columns: 1fr;
  }
  .battle-log {
    margin-top: 5px;
  }
  #log-scroll {
    height: 200px;
  }
  .opponents {
    gap: 12px;
  }
  .seat .portrait {
    height: 135px;
  }
  .table-center {
    min-height: 170px;
  }
  .recent-list {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 1000px) {
  .assignment-main { grid-template-columns: 140px minmax(0, 1fr) 180px; gap: 16px; }
}
@media (max-width: 650px) {
  .site-header {
    height: 76px;
    padding: 0 17px;
  }
  .site-header > nav { gap: 10px; }
  .site-header > nav > span { gap: 10px; }
  .site-header > nav a { padding-left: 0; padding-right: 0; }
  .site-header .account-name { display: none; }
  .auth-shell { min-height: auto; display: block; padding-top: 30px; }
  .auth-copy { text-align: center; }
  .auth-copy h1 { font-size: 31px; }
  .auth-shell .login { margin: 28px 0 60px; }
  .assignment-panel { padding: 18px; }
  .assignment-heading { align-items: stretch; flex-direction: column; gap: 14px; margin-bottom: 12px; }
  .assignment-save { justify-content: space-between; flex-direction: row-reverse; }
  .assignment-main { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 18px 0; }
  .assignment-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .assignment-title [data-assignment-status] { white-space: nowrap; }
  .assignment-no-settings { display: none; }
  .assignment-thinking > label:not(.provider-thinking-toggle) { width: auto; }
  .system-content-grid { grid-template-columns: 1fr; }
  .system-content-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-heading { align-items: stretch; flex-direction: column; }
  .admin-heading > .row { flex-wrap: wrap; }
  .provider-row { align-items: stretch; flex-direction: column; }
  .provider-row > .row { justify-content: space-between; }
  .provider-modal { padding: 10px; }
  .provider-modal-card { max-height: calc(100dvh - 20px); padding: 24px 18px; }
  .provider-fields { grid-template-columns: 1fr; }
  .provider-fields .wide { grid-column: auto; }
  .provider-model-row { grid-template-columns: minmax(0, 1fr) 100px; }
  .provider-model-row button { grid-column: 1 / -1; justify-self: end; }
  .music-grid { grid-template-columns: 1fr; }
  .admin-heading { display: block; }
  .brand {
    font-size: 23px;
    gap: 9px;
  }
  .brand small {
    font-size: 7px;
  }
  .seal {
    font-size: 23px;
  }
  .site-header > nav {
    gap: 17px;
  }
  .site-header > nav a {
    font-size: 12px;
    padding: 26px 0;
  }
  .edition {
    display: none;
  }
  main {
    padding: 0 17px;
  }
  .welcome {
    grid-template-columns: 1fr;
    position: relative;
    padding: 34px 0 30px;
    min-height: unset;
    gap: 12px;
  }
  .welcome h1 {
    font-size: 43px;
    letter-spacing: 4px;
  }
  .welcome-art {
    display: none;
  }
  .welcome p {
    font-size: 13px;
  }
  .welcome .fine-print {
    margin-top: 22px;
  }
  .section {
    padding: 28px 0;
  }
  .section-heading {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
  }
  .section-heading h1 {
    font-size: 31px;
  }
  .section-heading h2 {
    font-size: 23px;
  }
  .hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
  }
  .hero-tile .portrait {
    height: 195px;
  }
  .portrait-glyph {
    font-size: 110px;
  }
  #content-panel-heroes .hero-tile .portrait-name {
    left: 10px;
    bottom: 9px;
    font-size: 15px;
    letter-spacing: 1px;
  }
  .recent-list a {
    flex-direction: column;
    gap: 3px;
  }
  .studio-layout {
    display: flex;
    flex-direction: column-reverse;
  }
  .preview-column {
    position: static;
    width: 100%;
    max-width: 400px;
    margin: auto;
  }
  .preview-card .portrait {
    height: 245px;
  }
  .preview-details {
    padding: 15px;
  }
  .preview-details h2 {
    font-size: 25px;
  }
  .preview-label {
    margin-bottom: 8px;
  }
  .panel {
    padding: 19px;
  }
  .studio > .section-heading .row {
    gap: 8px;
  }
  .studio > .section-heading button {
    font-size: 11px;
    padding: 8px 13px;
  }
  .setup {
    margin: 30px auto;
  }
  .setup h1 {
    font-size: 32px;
  }
  .setup-preview {
    align-items: flex-start;
    gap: 15px;
  }
  .setup-preview .portrait {
    width: 100px;
    height: 150px;
  }
  .setup-preview h2 {
    font-size: 23px;
  }
  .setup-preview p {
    font-size: 11px;
  }
  .game-heading {
    align-items: flex-start;
    gap: 10px;
  }
  .game-heading .row {
    gap: 8px;
  }
  .game-heading .mode-pill {
    display: none;
  }
  .game-heading .eyebrow {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .game-heading h2 {
    font-size: 23px;
  }
  .game-layout {
    gap: 10px;
  }
  .opponents {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 11px 11px 0;
    gap: 9px;
  }
  .seat {
    display: flex;
    align-items: stretch;
    min-height: 116px;
  }
  .seat .portrait {
    width: 61px;
    min-width: 61px;
    height: auto;
    min-height: 115px;
    border-radius: 5px 0 0 5px;
  }
  .seat .portrait-glyph {
    font-size: 50px;
  }
  .seat .portrait-name {
    font-size: 13px;
    right: 7px;
    top: 10px;
  }
  .seat .portrait-caption {
    display: none;
  }
  .seat-info {
    padding: 7px;
    flex: 1;
  }
  .seat-info h3 {
    font-size: 17px;
  }
  .seat-info > .health,
  .seat-info > .muted {
    font-size: 9px;
  }
  .seat .role {
    font-size: 8px;
    padding: 1px 4px;
  }
  .seat-skills {
    font-size: 9px;
  }
  .seat-skills p {
    font-size: 10px;
    word-break: break-word;
  }
  .table-center {
    min-height: 150px;
    padding: 28px 14px 18px;
  }
  .current-event .eyebrow {
    font-size: 9px;
  }
  .player-area {
    padding: 13px 11px;
  }
  .self-heading,
  .self-heading > div {
    gap: 8px;
  }
  .self-heading b {
    font-size: 18px;
  }
  .self-heading > span {
    font-size: 9px;
  }
  .playing-card {
    width: 65px;
    min-width: 65px;
    height: 99px;
  }
  .hand {
    gap: 7px;
  }
  .action-buttons button {
    font-size: 11px;
  }
  .battle-log h3 {
    padding: 12px;
  }
  .result .row {
    gap: 10px;
  }
  .result h2 {
    font-size: 23px;
  }
  .result-stats {
    flex-direction: column;
    gap: 8px;
  }
  .login {
    margin-top: 60px;
  }
  footer {
    display: block;
    font-size: 10px;
  }
  footer span {
    display: block;
    margin-top: 5px;
  }
  .library .section-heading .row button {
    font-size: 12px;
  }
  .library > .hero-grid {
    margin-top: 16px;
  }
  .preview-column .fine-print {
    margin-bottom: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.voice-editor audio { display: block; width: 100%; max-width: 100%; margin: 12px 0; }
.voice-clip { padding: 14px 0; border-top: 1px solid var(--line, #d7d3c8); margin-top: 14px; }

.custom-card-editor { margin: 18px 0; border: 1px solid var(--line, #ccc); border-radius: 12px; padding: 16px; min-width: 0; }
.content-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; margin: 22px 0 0; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.content-tabs button { border: 0; background: transparent; box-shadow: none; min-width: 0; padding-inline: 8px; }
.content-tabs button.active { color: #fff; background: var(--raised); }
.expansion-editor [data-content-panel][hidden] { display: none; }
.custom-card-art { width: 120px; max-height: 180px; object-fit: cover; border-radius: 8px; }
.preset-card-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.preset-card-row label { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; min-width: 0; margin: 0; }
.preset-card-row input[type="checkbox"] { flex: 0 0 18px; width: 18px; height: 18px; margin: 2px 0 0; padding: 0; }
.preset-card-row label span { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.preset-card-row > input[type="number"] { min-width: 0; margin: 0; }
.preset-card-row small { color: var(--muted); line-height: 1.5; }
@media (max-width: 520px) { .preset-card-row { grid-template-columns: minmax(0, 1fr) 72px; gap: 8px; } }
.playing-card { position: relative; overflow: hidden; }
.hand-card-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .25; pointer-events: none; }
.playing-card > span, .playing-card > b, .playing-card > small { position: relative; }

.rooms-page { width: 100%; margin: 24px 0; }
.room-forms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin: 24px 0; }
.room-seats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 24px 0; }
.room-seat { border: 1px solid var(--line); border-radius: 8px; padding: 16px; overflow-wrap: anywhere; }
.room-seat.mine { border: 2px solid #8c682e; }
.room-seat h2 { font-size: 18px; }
.rooms-page form { margin-block: 20px; }
.rooms-page select, .rooms-page input { max-width: 100%; }
.online-battle { display: grid; grid-template-columns: 1fr auto; gap: 3px 6px; font-size: 11px; color: #e7d5aa; margin-bottom: 6px; }
.online-battle [data-online-clock] { grid-row: 2; grid-column: 1 / -1; }
.online-battle button { grid-row: 1; grid-column: 2; padding: 3px 6px; font-size: 11px; }
@media (max-width: 640px) { .room-forms { grid-template-columns: 1fr; gap: 8px; } .room-seats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Common controls and surfaces use the same palette as the lobby. */
.site-header { background: var(--paper); }
.seal { background: var(--primary); }
button:hover, .button:hover { background: var(--raised); }
button.primary:hover, .button.primary:hover { background: #bc4a40; }
label { color: var(--muted); }
input::placeholder, textarea::placeholder { color: #9ba9a1; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px #d9bd8326; }
input:disabled, textarea:disabled, select:disabled { background: var(--raised); color: var(--muted); }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--gold); }
.notice { background: #353126; color: var(--warning); border-color: var(--gold); }
.provider-status { background: #42302b; color: var(--danger); }
.provider-status.ready { background: #293e33; color: var(--success); }
.content-tabs button.active { background: var(--raised); color: #f3e9cd; box-shadow: inset 0 -2px var(--gold); }
.room-seat { border-color: var(--line); background: var(--surface); }
.room-seat.mine { border-color: var(--gold); }
.setup-hero[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 2px #d9bd8333; }

.judgment-editor { margin:12px 0; padding:12px; border:1px solid #7c7050; border-radius:8px; }
.judgment-editor fieldset { min-width:0; margin:10px 0; }
.preset-faces { margin:8px 0 18px; padding:10px; border:1px solid #5b665b; border-radius:8px; }
.preset-faces summary { cursor:pointer; }
.face-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:8px; max-height:420px; overflow:auto; }
.face-grid .fields { margin:0; padding:6px; }
.judgment-zone { max-height:48px; overflow:auto; display:flex; flex-wrap:wrap; gap:3px; margin-top:4px; position:relative; z-index:3; pointer-events:auto; }
.judgment-zone button { padding:3px 5px; font-size:11px; color:#f1d6a0; border:1px solid #a88749; }

.judgment-editor .fields > button { grid-column:1 / -1; justify-self:start; white-space:nowrap; }

.site-header #account-nav button[data-cmd="toggle-music"],
.site-header #account-nav button[data-cmd="refresh-page"],
.site-header #account-nav button[data-cmd="logout"] { display: inline-flex; align-items: center; justify-content: center; width: 40px; min-height: 40px; padding: 8px; flex-shrink: 0; border: 0; background: transparent; box-shadow: none; }
.site-header #account-nav button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.site-header #account-nav > .account-name,
.site-header #account-nav > a,
.site-header #account-nav > button { color: var(--ink); }

.custom-card-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.custom-card-entry { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: start; justify-content: start; gap: 14px; width: 100%; min-width: 0; padding: 16px; text-align: left; }
.custom-card-entry img, .custom-card-placeholder { width: 96px; height: 135px; object-fit: cover; border-radius: 8px; }
.custom-card-placeholder { display: grid; place-items: center; border: 1px solid var(--line); font-size: 26px; }
.custom-card-summary { display: grid; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.custom-card-summary strong { font-size: 18px; }

/* Portrait previews for the six standard card illustrations. */
.builtin-card-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 172px), 184px)); gap: 10px; margin-top: 14px; }
.builtin-card-grid .expansion-background { display: block; width: min(100%, 120px); height: auto; max-height: none; margin-inline: auto; aspect-ratio: 2 / 3; object-fit: cover; }
.builtin-card-grid .background-card { padding: 10px; }
.builtin-card-grid label { margin: 8px 0; gap: 5px; font-size: 12px; }
.builtin-card-grid input { padding: 7px 8px; font-size: 13px; }
.builtin-card-grid .row { gap: 6px; }
.builtin-card-grid button { flex: 1; padding: 8px 5px; font-size: 12px; white-space: nowrap; }

#content-panel-heroes .hero-tile .portrait { height: auto; aspect-ratio: 2 / 3; }
#content-panel-heroes .hero-tile .portrait img { position: absolute; inset: 0; }

/* 武将卡只显示立绘与姓名：姓名固定在立绘左下角，整卡仍是查看/编辑入口。 */
#content-panel-heroes .hero-tile .portrait:before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  height: 46%;
  background: linear-gradient(transparent, #14231cd0);
  pointer-events: none;
}
#content-panel-heroes .hero-tile .portrait-name {
  right: auto;
  top: auto;
  left: 16px;
  bottom: 14px;
  z-index: 2;
  writing-mode: horizontal-tb;
  font-size: 20px;
  letter-spacing: 3px;
  padding: 0;
  background: none;
}
#content-panel-heroes .hero-tile .portrait-caption { display: none; }
.hero-tile .hero-tile-open {
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: none;
  cursor: pointer;
}
.hero-tile .hero-tile-open:hover { background: none; }
.hero-tile .hero-tile-open:focus-visible { outline: 2px solid var(--gold); outline-offset: -3px; }

.preset-backgrounds { min-width: 0; margin: 16px 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }

.admin-menu { position: relative; }
.admin-menu summary { cursor: pointer; list-style: none; color: var(--ink); padding: 8px 0; }
.admin-menu summary::-webkit-details-marker { display: none; }
.admin-menu summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.site-header .admin-menu-options { position: absolute; top: calc(100% + 8px); right: 0; z-index: 100; display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 180px; max-width: calc(100vw - 32px); padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 12px 32px #0006; }
.site-header .admin-menu-options a { padding: 12px 14px; white-space: nowrap; border-radius: 6px; color: var(--ink); }
.site-header .admin-menu-options a:hover, .site-header .admin-menu-options a[aria-current="page"] { background: var(--raised); color: var(--gold); }

.setup-details { margin: 20px 0; }
.setup-details > summary { cursor: pointer; color: var(--muted); padding: 10px 0; }

.setup-selection-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.setup-selection-heading h2 { margin: 0; font-size: 16px; }
.setup-selection-heading > span { color: var(--muted); font-size: 13px; }
.setup-random > span { background: linear-gradient(135deg, #394a40, #222e28); color: var(--gold); }

.setup-choices { min-width: 0; margin: 0 0 24px; padding: 0; border: 0; }
.setup-choices legend { margin-bottom: 12px; padding: 0; color: var(--muted); font-size: 14px; }
.setup-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 10px; }
#game-preset .setup-choice-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.setup-choice-grid button { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-width: 0; min-height: 52px; padding: 14px 16px; text-align: left; white-space: normal; overflow-wrap: anywhere; border: 2px solid transparent; background: var(--raised); }
.setup-choice-grid button b { display: block; font-size: 14px; }
.setup-choice-grid button small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.setup-choice-grid button[aria-pressed="true"] { border-color: var(--gold); background: #34433a; color: #f3e9cd; box-shadow: 0 0 0 2px #d9bd8322; }
.setup-choice-grid button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

#game-player-count .setup-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.setup-choices-icon .setup-choice-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 96px), 1fr)); }
.setup-choices-icon .setup-choice-grid button { align-items: center; justify-content: center; gap: 8px; min-height: 96px; padding: 16px 10px; text-align: center; }
.setup-choices-icon .setup-choice-grid button b { font-size: 13px; }
.setup-choices-icon .setup-choice-grid .role-icon { width: 30px; height: 30px; fill: var(--muted); }
.setup-choices-icon .setup-choice-grid button[aria-pressed="true"] .role-icon { fill: var(--gold); }
.setup-choices-icon .setup-choice-grid button[aria-pressed="true"][data-value="lord"] .role-icon { fill: #d9bd83; }
.setup-choices-icon .setup-choice-grid button[aria-pressed="true"][data-value="loyal"] .role-icon { fill: #7fa87f; }
.setup-choices-icon .setup-choice-grid button[aria-pressed="true"][data-value="rebel"] .role-icon { fill: #c15a4e; }
.setup-choices-icon .setup-choice-grid button[aria-pressed="true"][data-value="spy"] .role-icon { fill: #8a7bbf; }

.setup-choices .role-help { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; min-height: 0; padding: 0; margin-left: 4px; border: 1px solid var(--muted); border-radius: 50%; background: transparent; color: var(--muted); font-size: 11px; vertical-align: middle; }
.role-help-dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); }
.role-help-dialog::backdrop { background: #0009; }
.role-help-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.role-help-dialog h2 { margin: 0; font-size: 22px; }
.role-help-dialog header button { padding: 4px 12px; font-size: 24px; }
.role-help-dialog dt { margin-top: 18px; font-weight: 700; color: var(--gold); }
.role-help-dialog dd { margin: 5px 0 0; line-height: 1.7; }
.role-help-dialog > p { font-size: 13px; color: var(--muted); line-height: 1.7; }

#role .setup-choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
#role .setup-choice-grid button { flex: 0 0 auto; min-height: 40px; padding: 8px 14px; align-items: center; }
#role .setup-choice-grid button b { font-size: 13px; }

.expansion-card > p.muted { margin-top: auto; padding-top: 12px; }
.expansion-card > a { align-self: flex-start; }

.library > .expansion-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) {
  .library > .expansion-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .library > .expansion-grid { grid-template-columns: 1fr; }
}

.preset-owner-line { display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px; }
.preset-owner-line > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.preset-owner-line > a { flex-shrink: 0; white-space: nowrap; }

.expansion-card > .expansion-card-main { display: block; align-self: stretch; color: inherit; text-decoration: none; border-radius: 8px; }
.expansion-card-main > img { display: block; width: 100%; max-height: 300px; object-fit: cover; border-radius: 8px; }
.expansion-card-main:hover h2 { color: var(--gold); }
.expansion-card-main:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }

.expansion-card-main > h2 { margin: 16px 0; }
.expansion-card-main > h2:first-child { margin-top: 0; }
.expansion-card-main > p { margin: 0; }

.expansion-card > .preset-owner-line { margin-top: auto; padding-top: 12px; margin-bottom: 0; }
.expansion-card > .preset-owner-line + p.muted { margin-top: 8px; padding-top: 0; }

.library > .section-heading h1, .library > .section-heading h2 { font-size: 30px; line-height: 1.35; letter-spacing: 3px; }
@media (max-width: 650px) {
  .library > .section-heading h1, .library > .section-heading h2 { font-size: 26px; }
}

/* Ordinary pages share one outer frame; both battle layouts own their spacing. */
body:not(.in-battle):not(.in-formation) #app {
  padding-top: 24px;
  padding-bottom: max(40px, env(safe-area-inset-bottom, 0px));
  padding-left: max(var(--page-gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--page-gutter), env(safe-area-inset-right, 0px));
}
body:not(.in-battle):not(.in-formation) .site-header {
  padding-left: max(var(--page-gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--page-gutter), env(safe-area-inset-right, 0px));
}
body:not(.in-battle):not(.in-formation) #app > :is(.section, .formation-setup, .setup, .game-lobby, .lobby-priority, .library, .studio, .admin-page, .skill-workbench, .auth-shell) {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
body:not(.in-battle):not(.in-formation) #app > .rooms-page { margin: 0; }
@media (max-width: 600px) {
  body:not(.in-battle):not(.in-formation) #app { padding-top: 16px; padding-bottom: max(24px, env(safe-area-inset-bottom, 0px)); }
}

/* Compact public expansion directory; preset management keeps its own layout. */
.pack-directory h1 { display: flex; align-items: center; gap: 12px; }
.pack-directory-total { font-size: 14px; font-weight: 400; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.pack-directory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.pack-directory-card { min-width: 0; display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pack-directory-main { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 18px; align-items: start; }
.pack-directory-cover { height: 132px; overflow: hidden; border-radius: 8px; background: #182522; display: grid; place-items: center; color: var(--accent); }
.pack-directory-cover img { width: 100%; height: 100%; object-fit: cover; }
.pack-directory-copy { min-width: 0; }
.pack-directory-copy h2 { margin: 10px 0 8px; font-size: 22px; line-height: 1.35; overflow-wrap: anywhere; }
.pack-directory-badges { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 11px; }
.pack-directory-badges .pack-playable { color: #a5c9af; }
.pack-directory-description { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pack-directory-counts { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 18px 0; color: var(--muted); font-size: 13px; }
.pack-directory-counts b { color: var(--ink); font-weight: 500; }
.pack-directory-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.pack-directory-footer .button { font-size: 13px; padding: 9px 14px; }
.pack-directory-footer .pack-trial { border: 0; padding: 9px 4px; color: var(--ink); font-size: 13px; }
.pack-unavailable { font-size: 12px; }
@media (max-width: 760px) {
  .pack-directory-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .pack-directory-card { padding: 16px; }
  .pack-directory-main { grid-template-columns: 88px minmax(0, 1fr); gap: 14px; }
  .pack-directory-cover { height: 118px; }
  .pack-directory-copy h2 { font-size: 20px; }
  .pack-directory-counts { gap: 8px 14px; }
}

/* Public elemental attachment and reaction state. */
.element-status{font-size:10px;line-height:1.3;color:#fff6d8;background:#172238ed;padding:2px 4px;border-radius:4px;max-width:100%;overflow-wrap:anywhere}
.formation-unit>.element-status{position:absolute;top:24px;left:3px;right:3px;z-index:3;pointer-events:none}
.element-help{font-size:13px;line-height:1.6;margin:8px 0}.element-help p{white-space:normal}
.card-face .card-pips.fire{color:#b62c16}.card-face .card-pips.water{color:#125aa6}.card-face .card-pips.thunder{color:#7638a4}.card-face .card-pips.grass{color:#376d10}.card-face .card-pips.ice{color:#147581}.card-face .card-pips.wind{color:#137154}.card-face .card-pips.rock{color:#876014}

/* Shared rule-derived skill reading layout, including narrow battle dialogs. */
.skill-description-view { margin: .55rem 0 1.15rem; overflow-wrap: anywhere; }
/* Preserve authored paragraphs in card and skill detail views. */
.skill-effect-lines p,
.skill-resource-details .fine-print,
.hand-card-dialog > p,
.equipment-detail-entry > p,
.formation-card-description p,
.formation-treasure-effect,
.formation-judgment-list p,
#content-panel-cards article > p {
  white-space: pre-line;
}
.skill-description-view .skill-cadence { color: var(--gold, #896833); font-size: .85rem; line-height: 1.5; margin: 0 0 .5rem; }
.skill-description-view .skill-effect-lines p { margin: .3rem 0; padding-left: min(calc(var(--skill-depth) * .75rem), 3rem); line-height: 1.65; font-size: 1rem; }
/* Supplemental author copy stays visible, with a quieter annotation hierarchy. */
.skill-description-view .skill-supplement {
  margin: .5rem 0 0;
  color: var(--muted, #aebbb3);
  font-size: .85rem;
  font-weight: 400;
  line-height: 1.65;
}
.skill-description-view .skill-supplement p { margin: 0; font: inherit; color: inherit; white-space: pre-line; }
.skill-description-view .skill-supplement p + p { margin-top: .25rem; }
.skill-description-view .skill-tags { margin: .5rem 0 0; color: var(--muted, #78877e); font-size: .78rem; line-height: 1.5; }
.skill-rule-details { margin-top: .65rem; font-size: .85rem; }
.skill-rule-details summary { cursor: pointer; color: var(--muted, #78877e); }
.skill-description-view .skill-rule-details p { margin-top: .5rem; font-size: .85rem; line-height: 1.7; }

.skill-name, .printed-skill .skill-name, .formation-hero-skill-list .skill-name, .program-preview h2 { color: var(--gold); }

/* Draft: portrait choices, independently scrolling rules, persistent confirmation. */
.hero-draft-page { height:100dvh; min-height:0; overflow:auto; padding:clamp(12px,2.5vw,32px); color:#f2ecdf; background:linear-gradient(#101b24bd,#101820ed); }
.hero-draft-table { width:100%; max-width:1440px; height:100%; min-height:0; margin:auto; display:flex; flex-direction:column; gap:18px; }
.hero-draft-header { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-shrink:0; }
.hero-draft-header>div { text-align:center; }
.hero-draft-header h1 { margin:0; font-size:clamp(22px,2.5vw,34px); color:#f2dfb2; }
.hero-draft-header p { margin:6px 0 0; color:#c8c7be; }
.hero-draft-header a,.hero-draft-header>span { color:#d0c4ac; font-size:14px; }
.hero-draft-workspace { display:grid; grid-template-columns:minmax(0,2.2fr) minmax(280px,1fr); gap:24px; flex:1; min-height:180px; }
.hero-draft-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; min-height:0; align-items:stretch; padding-top:5px; }
.hero-draft-card { position:relative; padding:0; min-width:0; overflow:hidden; border:1px solid #ffffff29; border-radius:12px; background:linear-gradient(145deg,#31434b,#17212a); color:#fff4da; text-align:left; transition:transform .18s,border-color .18s,box-shadow .18s; }
.hero-draft-card>img { width:100%; height:100%; position:absolute; inset:0; object-fit:cover; object-position:center top; }
.hero-draft-card::after { content:""; position:absolute; inset:0; background:linear-gradient(transparent 45%,#10171bcc 80%,#10171b); pointer-events:none; }
.hero-draft-card:hover:not(:disabled),.hero-draft-card.is-selected { transform:translateY(-4px); border-color:#e7ca86; box-shadow:0 0 0 1px #e7ca8666,0 12px 28px #0004; }
.hero-draft-card:focus-visible,.hero-draft-seats button:focus-visible { outline:3px solid #f8e4ac; outline-offset:3px; }
.hero-draft-card:disabled { opacity:.45; }
.hero-draft-card-caption { position:absolute; bottom:24px; left:16px; right:12px; z-index:1; }
.hero-draft-card-caption strong { display:block; font-family:"Noto Sans SC",sans-serif; font-size:clamp(24px,2.6vw,38px); font-weight:600; margin-bottom:10px; }
.hero-draft-card-caption small { font-size:12px; color:#ded7c7; display:block; }
.hero-draft-check { display:none; position:absolute; right:12px; top:12px; z-index:1; border-radius:50%; width:28px; height:28px; text-align:center; line-height:28px; background:#e7ca86; color:#24231c; }
.is-selected .hero-draft-check { display:block; }
.hero-draft-placeholder { display:grid; place-items:center; height:75%; font:80px "Noto Sans SC",sans-serif; opacity:.35; }
.hero-draft-details { min-height:0; overflow:auto; padding:24px; border:1px solid #e7ca8626; border-radius:12px; background:#101a22c9; scrollbar-width:thin; }
.hero-draft-eyebrow { font-size:12px; letter-spacing:3px; color:#b6aa90; }
.hero-draft-details h2 { margin:8px 0; font-size:30px; color:#ecd4a2; }
.hero-draft-details header>p { color:#bcbeb7; font-size:13px; }
.hero-draft-skills section { padding:18px 0; border-top:1px solid #ffffff14; }
.hero-draft-skills h3 { margin:0 0 10px; font-size:16px; color:#eee1c4; }
.hero-draft-skills .skill-effect-lines p { font-size:14px; line-height:1.8; margin:0; color:#dfdfd7; }
.hero-draft-skills .skill-tags { font-size:12px; color:#a8b0ac; }
.hero-draft-footer { flex-shrink:0; display:flex; justify-content:space-between; align-items:center; gap:16px; border-top:1px solid #e7ca8626; padding-top:16px; }
.hero-draft-footer strong { font-size:18px; color:#ead6ae; }
.hero-draft-footer p { margin:6px 0 0; color:#aeb7b8; font-size:13px; }
.hero-draft-footer .primary { min-width:180px; min-height:48px; background:linear-gradient(110deg,#d5b878,#f0d99f); border:1px solid #ebd49e; color:#28271f; font-weight:700; }
.hero-draft-seats { display:flex; gap:10px; }
.hero-draft-seats button { flex:1; min-height:44px; background:#17232dcc; border:1px solid #ffffff26; color:#c9c7be; }
.hero-draft-seats button[aria-pressed="true"] { border-color:#e7ca86; color:#f0d99f; }
.hero-draft-seats span { margin-left:8px; }
.hero-draft-deployment { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.hero-draft-deployment button { min-height:44px; }
.hero-draft-deployment button[aria-pressed="true"] { outline:2px solid #e8cb87; }
@media(max-height:600px) and (min-width:701px) {
 .hero-draft-page { padding:12px 20px; } .hero-draft-table { gap:10px; }
 .hero-draft-header h1 { font-size:22px; } .hero-draft-header p { margin:2px; font-size:12px; }
 .hero-draft-details { padding:14px; } .hero-draft-footer { padding-top:8px; }
 .hero-draft-card-caption { bottom:12px; left:10px; } .hero-draft-card-caption strong { font-size:24px; margin-bottom:4px; }
 .hero-draft-workspace { gap:14px; grid-template-columns:minmax(0,1.7fr) minmax(250px,1fr); }
}
@media(max-width:700px) {
 .hero-draft-page { padding:14px; } .hero-draft-table { height:auto; min-height:100%; gap:16px; }
 .hero-draft-header { flex-wrap:wrap; gap:10px; } .hero-draft-header>div { order:2; width:100%; }
 .hero-draft-workspace { display:flex; flex-direction:column; gap:18px; }
 .hero-draft-options { height:clamp(200px,58vw,340px); flex-shrink:0; gap:8px; }
 .hero-draft-card-caption { bottom:12px; left:8px; right:6px; } .hero-draft-card-caption strong { font-size:24px; }
 .hero-draft-card-caption small { font-size:10px; line-height:1.6; } .hero-draft-check { right:6px; top:6px; width:22px; height:22px; line-height:22px; }
 .hero-draft-details { overflow:visible; padding:18px; } .hero-draft-footer { position:sticky; bottom:-14px; margin:0 -14px -14px; padding:14px; background:#101a22f5; z-index:2; }
 .hero-draft-footer .primary { min-width:118px; } .hero-draft-footer p { max-width:210px; font-size:12px; }
 .hero-draft-seats { gap:5px; } .hero-draft-seats button { padding:6px; font-size:12px; } .hero-draft-seats span { display:block; margin:4px 0 0; }
 .hero-draft-deployment { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(prefers-reduced-motion:reduce) { .hero-draft-card { transition:none; } }


body:is(.in-battle,.in-formation) .game-page.hero-draft-page { padding:clamp(12px,2.5vw,32px); }
.game-page.hero-draft-page.table-themed,.game-page.hero-draft-page.table-scene { background:linear-gradient(#101b24c9,#101820ed),var(--table-background,url('https://bj-cdn.geemii.com/backgrounds/standard/cloud-pass-v1.png')) center/cover!important; }
@media(max-height:600px) and (min-width:701px) { body:is(.in-battle,.in-formation) .game-page.hero-draft-page { padding:12px 20px; } }
@media(max-width:700px) { body:is(.in-battle,.in-formation) .game-page.hero-draft-page { padding:14px; } }

/* The selected portrait and its drawer form one expanding character card. */
.hero-draft-workspace { display:flex; min-height:240px; gap:0; }
.hero-draft-options { display:flex; width:100%; max-width:1120px; margin:0 auto; gap:16px; padding:0; }
.hero-draft-options.has-details { max-width:none; }
.hero-draft-choice { display:flex; flex:1; min-width:0; min-height:0; position:relative; border:1px solid #ffffff29; border-radius:14px; overflow:hidden; background:#142029; }
.hero-draft-choice.is-expanded { flex:4; border-color:#e7ca86; box-shadow:0 12px 36px #0004; }
.hero-draft-choice .hero-draft-card { width:100%; flex:1; border:0; border-radius:0; box-shadow:none; }
.hero-draft-choice .hero-draft-card:hover,.hero-draft-choice .hero-draft-card.is-selected { transform:none; box-shadow:none; }
.hero-draft-choice.is-expanded .hero-draft-card { flex:0 0 40%; }
.hero-draft-choice:focus-within { outline:2px solid #e7ca8680; outline-offset:2px; }
.hero-draft-card-hint { display:block; margin-top:12px; font-size:12px; color:#d6bf8d; }
.has-details .hero-draft-choice:not(.is-expanded) .hero-draft-card-caption { left:12px; right:8px; }
.has-details .hero-draft-choice:not(.is-expanded) .hero-draft-card-caption strong { font-size:clamp(18px,2vw,28px); overflow-wrap:anywhere; }
.has-details .hero-draft-choice:not(.is-expanded) .hero-draft-card-caption small { display:none; }
.hero-draft-choice .hero-draft-details { display:flex; flex-direction:column; flex:1; min-width:0; border:0; border-left:1px solid #e7ca8633; border-radius:0; padding:22px; overflow:hidden; background:linear-gradient(110deg,#1b292f,#111d26); animation:draft-unfold .24s ease-out; }
.hero-draft-details>header { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; flex-shrink:0; }
.hero-draft-details header p { margin:4px 0 16px; font-size:12px; color:#bcbeb7; }
.hero-draft-close { flex-shrink:0; width:36px; min-height:36px; padding:0; font-size:24px; background:transparent; border:0; color:#d8cbb0; }
.hero-draft-details .hero-draft-skills { overflow:auto; min-height:0; flex:1; scrollbar-width:thin; padding-right:8px; }
.hero-draft-details .hero-draft-footer { position:static; margin:0; padding:14px 0 0; background:transparent; display:flex; flex-wrap:wrap; gap:10px; }
.hero-draft-details .hero-draft-footer strong { font-size:14px; }
.hero-draft-details .hero-draft-footer p { font-size:12px; }
.hero-draft-details .hero-draft-footer .primary { flex:1; min-width:120px; }
.hero-draft-instruction { text-align:center; margin:0; color:#c0b59e; flex-shrink:0; }
@keyframes draft-unfold { from { opacity:0; transform:translateX(-22px); } to { opacity:1; transform:translateX(0); } }
@media(max-height:600px) and (min-width:701px) {
 .hero-draft-workspace { min-height:190px; }
 .hero-draft-options { gap:10px; }
 .hero-draft-choice .hero-draft-details { padding:12px; }
 .hero-draft-details h2 { font-size:22px; margin:2px 0; }
 .hero-draft-details header p { margin-bottom:6px; }
 .hero-draft-details .hero-draft-eyebrow { display:none; }
 .hero-draft-details .hero-draft-footer { padding-top:8px; }
 .hero-draft-details .hero-draft-footer>div { display:none; }
 .hero-draft-details .hero-draft-footer .primary { min-height:40px; }
 .hero-draft-card-hint { margin-top:4px; }
}
@media(max-width:700px) {
 .hero-draft-workspace { min-height:0; display:block; }
 .hero-draft-options { height:clamp(210px,52vh,440px); gap:8px; }
 .hero-draft-options.has-details { height:clamp(170px,28vh,260px); }
 .hero-draft-choice.is-expanded { flex:1; overflow:visible; }
 .hero-draft-choice.is-expanded .hero-draft-card { flex:1; border-radius:13px; overflow:hidden; }
 .hero-draft-choice .hero-draft-details { position:fixed; left:8px; right:8px; bottom:0; height:49dvh; z-index:30; border:1px solid #e7ca8677; border-radius:20px 20px 0 0; padding:16px 18px max(14px,env(safe-area-inset-bottom)); box-shadow:0 -14px 40px #0005; animation:draft-rise .24s ease-out; }
 .hero-draft-card-caption strong,.has-details .hero-draft-choice:not(.is-expanded) .hero-draft-card-caption strong { font-size:20px; }
 .hero-draft-card-caption { bottom:10px; }
 .hero-draft-card-caption small { display:none; }
 .hero-draft-details h2 { font-size:24px; margin:4px 0; }
 .hero-draft-details header p { margin-bottom:8px; }
 .hero-draft-details .hero-draft-footer { flex-wrap:nowrap; }
 .hero-draft-details .hero-draft-footer .primary { flex:0 0 auto; }
 .hero-draft-table:has(.has-details) { padding-bottom:49dvh; }
 .hero-draft-deploy-footer { position:static; margin:0; }
}
@keyframes draft-rise { from { opacity:0; transform:translateY(40px); } to { opacity:1; transform:translateY(0); } }
@media(prefers-reduced-motion:reduce) { .hero-draft-choice .hero-draft-details { animation:none; } }

.hero-draft-card-caption .hero-draft-epithet { display:block; margin-top:8px; color:#dbc9a4; font-size:14px; line-height:1.6; font-weight:400; overflow-wrap:anywhere; text-shadow:0 1px 4px #000; }
.hero-draft-details .hero-draft-footer .primary { width:100%; flex:1; }
@media(max-width:700px) { .hero-draft-card-caption .hero-draft-epithet { font-size:11px; margin-top:4px; } }

/* Resolved reaction names above damage numbers; never intercept input. */
.reaction-effect{position:fixed;z-index:95;pointer-events:none;text-align:center;font-weight:900;line-height:1.3;padding:0 4px;box-sizing:border-box;overflow-wrap:anywhere;text-shadow:0 2px 3px #000,0 0 5px #000,1px 0 #332516,-1px 0 #332516}
.reaction-effect[data-mode="formation"]{z-index:1102}

/* Shield hits remain distinct from HP damage and reaction names. */
.shield-effect{position:fixed;z-index:43;pointer-events:none;box-sizing:border-box;border:2px solid #b6e9ff;box-shadow:inset 0 0 22px #72caff88,0 0 10px #9cdfff66;background:radial-gradient(ellipse,transparent 45%,#67baf544);color:#d9f5ff}
.shield-effect[data-mode="formation"]{z-index:1102}
.shield-effect>b{position:absolute;top:66%;left:0;width:100%;text-align:center;line-height:1.3;text-shadow:0 2px 3px #07192c,0 0 5px #07192c;overflow-wrap:anywhere}
.shield-effect.is-broken{border-style:dashed;border-color:#ffe5a8;color:#ffe5a8;box-shadow:inset 0 0 22px #edc87966,0 0 12px #edc87966}

@media (max-width: 900px) and (orientation: landscape) {
  .provider-model-row { grid-template-columns: minmax(90px, 1fr) 130px 140px 70px auto; }
  .provider-model-row button { grid-column: auto; }
}
