#lobby {
  --back: #0d1729;
  --pane: #16243a;
  --rim: #2b3b54;
  --quiet: #b6c0d0;
  --cream: #fff5e7;
  --peach: #ffad88;
  --sea: #8fdfd0;
  height: 100%;
  overflow-y: auto;
  background: radial-gradient(ellipse at 75% 8%, #20324b 0, transparent 45%), var(--back);
  color: var(--cream);
}
#lobby[hidden] { display: none; }
.lobby-container { width: min(1180px, calc(100% - 64px)); margin-inline: auto; }
.lobby-header { background: #111d30; border-bottom: 1px solid #293951; padding-top: env(safe-area-inset-top); }
.header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
#lobby a { color: inherit; text-decoration: none; }
#lobby form, #lobby h1, #lobby h2, #lobby p { margin: 0; }
#lobby button, #lobby select, #lobby input { font: inherit; }
#lobby button:not(:disabled), #lobby a, #lobby select, #lobby input { cursor: pointer; }
#lobby :focus-visible { outline: 2px solid #ffd4a5; outline-offset: 4px; }
#lobby-content:focus, #lobby-content h1:focus { outline: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 900; white-space: nowrap; letter-spacing: .04em; }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px;
  background: #ffad88; box-shadow: inset 0 -4px #e38369, 0 0 24px #ff997529;
}
.brand-mark i { width: 18px; height: 20px; background: #302233; clip-path: polygon(50% 0,100% 20%,91% 68%,50% 100%,9% 68%,0 20%); }
.brand-mark i::after { content: ''; display: block; background: #ffe3ac; width: 11px; height: 11px; margin: 4px auto; rotate: 45deg; scale: .6; }
.lobby-nav { display: flex; gap: 5px; }
.lobby-nav a { flex: 1; white-space: nowrap; text-align: center; padding: 11px 16px; border-radius: 10px; font-weight: 700; }
#lobby .lobby-nav a { color: var(--quiet); }
#lobby .lobby-nav a:hover { color: var(--cream); background: #243551; }
#lobby .lobby-nav a[aria-current="page"] { color: var(--peach); background: #352b3a; }
.currency { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 8px 12px; border: 1px solid #67523c; border-radius: 999px; background: #352b2c; color: #ffe0a0; }
.currency-name { font-size: 12px; }
.currency strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.coin { width: 17px; height: 17px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: #ffcf75; border: 2px solid #fff0b0; box-shadow: inset 0 -2px #c88744; }
.coin::before { content: ''; width: 5px; height: 5px; rotate: 45deg; background: #8b552d; }
.lobby-content { padding-block: clamp(24px, 4vw, 47px) max(38px, env(safe-area-inset-bottom)); }
.home-grid { display: grid; grid-template-columns: 1.75fr 1fr; gap: 20px; }
.hero, .team-strip, .progress-panel, .mission-card, .profile-card, .gacha-panel, .pool-panel, .shop-card, .settings-panel {
  overflow: hidden; border: 1px solid var(--rim); border-radius: 22px; background: var(--pane);
}
.hero-scene {
  position: relative; overflow: hidden; height: clamp(195px, 25vw, 322px);
  background: linear-gradient(0deg, #34324a 0 10%, #88647a 10.4% 12%, #f9a287 12.2%, #e18e96 41%, #6c648f 73%, #2a3456);
}
.hero-scene::before {
  content: ''; position: absolute; width: 38%; aspect-ratio: 1; border-radius: 50%; left: 31%; top: 9%;
  background: #ffd6a4; box-shadow: 0 0 70px #ffc48e7d;
}
.hero-scene::after {
  content: ''; position: absolute; inset: 7% 4% 26%;
  background: radial-gradient(circle at 12% 18%, #ffdcb7 0 1px, transparent 3px),
    radial-gradient(circle at 26% 29%, #fff2c9 0 2px, transparent 3px),
    radial-gradient(circle at 68% 7%, #ffe0b5 0 1px, transparent 3px),
    radial-gradient(circle at 79% 32%, #fff0cf 0 2px, transparent 3px),
    radial-gradient(circle at 92% 17%, #ffdcb7 0 1px, transparent 3px);
  pointer-events: none;
}
.hero-city { position: absolute; left: -2%; right: -2%; bottom: 11%; height: 49%; display: flex; align-items: end; gap: 1.4%; }
.hero-city i {
  position: relative; flex: 1; height: var(--high, 50%); background: #3f3d58;
  border-top: 3px solid #74617a; box-shadow: inset -10px 0 #34364d;
}
.hero-city i::after {
  content: ''; position: absolute; inset: 14% 20% 8%;
  background: repeating-linear-gradient(90deg, #433f59 0 7px, transparent 7px 12px), repeating-linear-gradient(0deg, transparent 0 9px, #e2a38f 9px 12px);
  opacity: .55;
}
.hero-city i:nth-child(3n + 1) { --high: 86%; }
.hero-city i:nth-child(3n + 2) { --high: 66%; }
.hero-city i:nth-child(4n) { --high: 42%; }
.hero-team { position: absolute; inset: 1% 8% 0; display: flex; justify-content: center; align-items: end; isolation: isolate; }
.hero-team .unit-art { flex: 1; background: none; margin-inline: -3%; max-width: 215px; overflow: visible; }
.hero-team .unit-art canvas { width: 100%; height: auto; filter: drop-shadow(3px 6px 0 #291e3170); animation: hero-bob 4s ease-in-out infinite; }
.hero-team .unit-art:nth-child(2) { translate: 0 -3%; scale: 1.13; z-index: 1; }
.hero-team .unit-art:first-child:not(:only-child) { translate: 4% 4%; scale: .91; }
.hero-team .unit-art:nth-child(3) { translate: -1% 1%; scale: .96; }
.hero-team .unit-art:first-child canvas { animation-delay: -.8s; }
.hero-team .unit-art:nth-child(3) canvas { animation-delay: -2s; }
@keyframes hero-bob { 50% { transform: translateY(-4px); } }
.hero-brief { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 22px 25px 25px; }
#lobby .mission-label { color: var(--peach); font-size: 13px; font-weight: 900; letter-spacing: .08em; }
#lobby h1 { font-size: clamp(32px, 5vw, 52px); letter-spacing: -.045em; line-height: 1.13; font-weight: 900; }
#lobby .hero-brief h1 { margin-block: 6px 8px; }
#lobby .hero-brief p:last-child { color: var(--quiet); font-size: 14px; }
.lbtn {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 9px 16px; border: 1px solid transparent; border-radius: 11px; font-weight: 900 !important;
  text-align: center; white-space: nowrap; transition: background .16s, translate .16s;
}
#lobby .lbtn.primary { background: #ffb18c; color: #302130; box-shadow: inset 0 -3px #d88972; }
#lobby .lbtn.primary:hover:not(:disabled) { background: #ffc7aa; translate: 0 -1px; }
#lobby .lbtn.secondary { background: #263853; border-color: #425573; color: #f2e9df; }
#lobby .lbtn.secondary:hover:not(:disabled) { background: #364c6d; }
#lobby .lbtn:disabled { color: #abb8cc; background: #25314a; border-color: #36435a; box-shadow: none; cursor: default; }
.home-side { display: grid; grid-template-rows: 1fr 1fr auto; gap: 14px; }
.shortcut {
  position: relative; isolation: isolate; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 20px; min-height: 110px; overflow: hidden; border: 1px solid #775b74; border-radius: 20px;
  background: linear-gradient(120deg, #4b354d, #382e45); transition: border-color .16s, background .16s;
}
.shortcut-shop { background: linear-gradient(120deg, #483830, #31334d); border-color: #6f5c5d; }
.shortcut-portrait {
  position: absolute; display: block; pointer-events: none; right: -13px; bottom: -25px;
  width: min(48%, 180px); aspect-ratio: 1; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, #e9aa686e, #e9aa6800 70%);
}
.shortcut-portrait .unit-art { height: 100%; background: transparent; }
.shortcut-portrait canvas { max-width: none; filter: drop-shadow(0 0 16px #f4b37560); }
.shortcut-shop > div { max-width: 65%; }
#lobby .shortcut:hover { border-color: #ffd1b9; }
.shortcut strong { font-size: clamp(20px, 2.8vw, 27px); font-weight: 900; }
#lobby .shortcut p { color: #eee1e8; font-size: 13px; margin-top: 5px; }
.capsule {
  width: 64px; aspect-ratio: 1; border-radius: 50%; flex: none; transform: rotate(-24deg);
  background: linear-gradient(0deg,#b985db 0 44%,#805ea9 44% 52%,#ffe1ae 52%);
  border: 2px solid #fce9cc; box-shadow: inset -5px -6px #502e7040, 5px 8px #241b37a3;
}
.capsule::after { content: ''; display: block; width: 24%; height: 16%; background: #fff7df; border-radius: 50%; margin: 15% 23%; transform: rotate(-15deg); }
.supply-art {
  display: block; width: 61px; height: 45px; border-radius: 9px; flex: none; rotate: -11deg;
  background: linear-gradient(180deg, #97dac6 0 16%, #68ad9d 17% 80%, #427e78 81%);
  border: 2px solid #c2ecdf; box-shadow: 6px 8px #1a333d;
}
.supply-art::after { content: '+'; display: grid; place-items: center; height: 100%; color: #23444c; font: 900 28px/1 system-ui; }
.progress-panel { padding: 17px 18px; }
.progress-panel > div:first-child { display: flex; justify-content: space-between; align-items: center; gap: 5px; }
.progress-panel span { color: var(--quiet); font-size: 12px; }
.progress-segments { display: flex; gap: 5px; margin-top: 12px; }
.progress-segments i { flex: 1; height: 5px; border-radius: 2px; background: #384966; }
.progress-segments .filled { background: var(--sea); }
.team-strip { margin-top: 20px; padding: 19px 22px 21px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#lobby h2 { font-size: 20px; font-weight: 900; }
#lobby .section-head p { margin-top: 3px; font-size: 13px; color: var(--quiet); }
.mini-roster { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; }
.mini-unit {
  flex: 0 1 132px; position: relative; overflow: hidden; padding: 0; color: var(--cream);
  border-radius: 12px; background: #21334e; border: 1px solid var(--rarity-edge, #41516e);
  transition: border-color .16s, translate .16s;
}
.mini-unit:hover { border-color: var(--rarity-color); translate: 0 -2px; }
.mini-unit .unit-art { height: 77px; }
.mini-unit .rarity-chip { position: absolute; top: 6px; left: 6px; padding: 1px 4px; font-size: 9px; }
.mini-unit strong { display: block; padding: 6px 4px 7px; text-align: center; font-size: 13px; }
.unit-art { display: grid; place-items: end center; overflow: hidden; background: radial-gradient(ellipse at 50% 70%, var(--glow, #587bbb), #253654); }
.unit-art canvas { display: block; width: auto; height: 100%; max-width: 100%; object-fit: contain; }
.unit-pix { --glow: #557f79; }
.unit-gpt { --glow: #427d73; }
.unit-cla { --glow: #9e6b62; }
.unit-volt { --glow: #ac754e; }
.unit-luma { --glow: #795da3; }
.unit-aegis { --glow: #9a5c5b; }

.page-title { margin-bottom: 25px; }
#lobby .page-title p { margin-top: 9px; color: var(--quiet); }
.stage-grid, .unit-grid, .shop-grid { display: grid; gap: 16px; }
.stage-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.unit-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.shop-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.mission-card { display: flex; flex-direction: column; }
.mission-landscape {
  position: relative; isolation: isolate; overflow: hidden; height: 138px;
  background: radial-gradient(circle at 45% 70%, #ffe6c4 0 22%, transparent 22.5%), linear-gradient(var(--dusk),var(--horizon));
}
.mission-landscape::before, .mission-landscape::after {
  content: ''; position: absolute; z-index: -1; inset: 16% -3% -2%;
  background: var(--terrain);
  clip-path: polygon(0 62%,15% 42%,33% 63%,46% 88%,62% 54%,78% 68%,91% 31%,100% 50%,100% 100%,0 100%);
}
.mission-landscape::after { transform: translateY(11%) scaleX(-1); background: #1c2737; opacity: .85; }
.mission-landscape span { position: absolute; left: 16px; top: 5px; color: #fff1d9; font: 900 52px/1.2 system-ui; opacity: .85; }
.mission-details { flex: 1; display: flex; flex-direction: column; padding: 17px; }
.metadata { display: flex; justify-content: space-between; align-items: center; gap: 3px; color: var(--quiet); font-size: 11px; font-weight: 700; }
.metadata > span:last-child { color: var(--sea); text-align: end; }
.locked .metadata > span:last-child { color: var(--quiet); }
.locked .mission-landscape { filter: saturate(.56); }
#lobby .mission-details h2 { margin: 5px 0 8px; font-size: 24px; }
#lobby .mission-details p, #lobby .shop-details p { color: var(--quiet); font-size: 14px; }
.mission-record { margin-top: 14px; font-size: 12px; color: #f0c6aa; flex: 1; }
.mission-action, .shop-action { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #33465e; }
.mission-action small { display: block; color: var(--quiet); font-size: 11px; }
.price { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; font-weight: 900; color: #ffda94; }
.primary .price { color: inherit; padding-left: 7px; border-left: 1px solid #6f493e75; }
.price .coin { width: 14px; height: 14px; }
#lobby .controls-help { margin-top: 16px; color: var(--quiet); font-size: 13px; }
.rarity-basic { --rarity-color: #b5d9d2; --rarity-edge: #456463; --rarity-bg: #213a3c; --rarity-glow: #71b7a486; }
.rarity-r { --rarity-color: #afe5ff; --rarity-edge: #416b8e; --rarity-bg: #223957; --rarity-glow: #68a9e284; }
.rarity-sr { --rarity-color: #e7c6ff; --rarity-edge: #775e9e; --rarity-bg: #3d2c57; --rarity-glow: #a684d783; }
.rarity-ssr { --rarity-color: #ffe0ac; --rarity-edge: #b38b59; --rarity-bg: #543d32; --rarity-glow: #ffc37d92; }
.rarity-chip {
  display: inline-flex; align-items: center; justify-content: center; padding: 3px 8px; border-radius: 5px;
  border: 1px solid var(--rarity-edge); background: var(--rarity-bg); color: var(--rarity-color);
  font: 900 11px/1.25 system-ui, sans-serif; letter-spacing: .075em; white-space: nowrap;
}
.gallery-art {
  position: relative; isolation: isolate;
  background:
    radial-gradient(circle at 50% 55%, var(--rarity-glow, #71b7a486) 0%, transparent 66%),
    linear-gradient(150deg, var(--character-hair, #587bbb), #17243b 87%);
}
.gallery-art::before, .gallery-art::after { content: ''; position: absolute; pointer-events: none; z-index: -1; }
.gallery-art::before {
  width: 56%; aspect-ratio: 1; top: 9%; left: 22%; border-radius: 50%;
  background: color-mix(in srgb, var(--character-accent, #b2d4df) 29%, transparent);
  border: 1px solid #fff1db58; box-shadow: 0 0 0 9px #fff1db0a, 0 0 0 19px #fff1db11;
}
.gallery-art::after {
  inset: 0; opacity: .72;
  background: radial-gradient(circle at 12% 24%, #fff4d9 0 1px, transparent 2px),
      radial-gradient(circle at 21% 51%, #fff4d9 0 2px, transparent 3px),
      radial-gradient(circle at 73% 19%, #fff4d9 0 1px, transparent 2px),
      radial-gradient(circle at 87% 44%, #fff4d9 0 2px, transparent 3px),
      linear-gradient(155deg, transparent 45%, #ffe9cc23 46% 47%, transparent 48% 55%, #ffe9cc14 56% 57%, transparent 58%);
}
.gallery-art canvas { filter: drop-shadow(0 7px 10px #10142595); transform-origin: center bottom; }
.collection-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
#lobby .collection-filter {
  min-height: 44px; padding: 7px 17px; color: var(--rarity-color, var(--quiet)); background: #172740;
  border: 1px solid var(--rarity-edge, #425471); border-radius: 10px; font-size: 13px; font-weight: 900;
}
#lobby .collection-filter:hover { background: #263852; }
#lobby .collection-filter[aria-pressed="true"] {
  background: var(--rarity-bg, #31425b); color: var(--rarity-color, #fff0e1); border-color: var(--rarity-color, #ffca9d);
  box-shadow: inset 0 -2px var(--rarity-color, #ffca9d);
}
#lobby .collection-empty { padding: 18px; color: var(--quiet); border: 1px dashed var(--rim); border-radius: 12px; }
.collectible-card {
  display: flex; flex-direction: column; min-inline-size: 0;
  border-color: var(--rarity-edge); border-radius: 16px; background: linear-gradient(180deg, var(--rarity-bg), #16243a 83%);
  box-shadow: 0 7px 18px #05091552;
}
.collectible-card.rarity-ssr { box-shadow: inset 0 0 0 1px #ffd4a54d, 0 7px 23px #0c0c1980; }
.card-preview {
  isolation: isolate; display: block; position: relative; padding: 0; border: 0; width: 100%; background: none; color: var(--cream);
  border-bottom: 1px solid var(--rarity-edge);
}
#lobby .card-preview:focus-visible { outline-offset: -3px; }
.collectible-card .gallery-art { height: clamp(144px, 16vw, 210px); }
.collectible-card .gallery-art canvas { transition: transform .2s ease; }
.card-preview:hover canvas, .card-preview:focus-visible canvas { transform: translateY(-3px) scale(1.05); }
.card-badges {
  display: flex; align-items: start; justify-content: space-between; gap: 4px;
  position: absolute; top: 10px; left: 10px; right: 10px; pointer-events: none;
}
.card-status {
  background: #111c30db; color: #e7edef; border: 1px solid #d0deeb50; border-radius: 5px;
  padding: 2px 5px; font-size: 10px; font-weight: 800; white-space: nowrap;
}
.is-owned .card-status { color: #d5fae4; }
.card-preview-label {
  position: absolute; right: 8px; bottom: 8px; padding: 3px 7px; background: #101c30e8; border: 1px solid #e0e7fa55;
  color: #f1ebea; border-radius: 6px; font-size: 11px; font-weight: 800;
}
.card-preview-label b { color: var(--rarity-color); margin-left: 3px; }
.collectible-body { flex: 1; display: flex; flex-direction: column; padding: 12px 13px 13px; }
#lobby .collectible-body h2 { font-size: clamp(16px, 2.1vw, 20px); line-height: 1.2; margin: 0 0 7px; overflow-wrap: anywhere; }
.character-meta { display: flex; flex-wrap: wrap; gap: 4px 9px; color: #edf0f7; font-size: 12px; font-weight: 750; }
.character-meta span:first-child { color: var(--rarity-color); }
#lobby .card-skill-label { margin-block: 10px; color: #c4cfde; font-size: 12px; min-height: 34px; }
.character-actions {
  padding-top: 9px; margin-top: auto; border-top: 1px solid #c7d4e527;
  display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.character-actions > :only-child { width: 100%; }
#lobby .character-actions .lbtn { font-size: 12px; min-height: 44px; padding: 7px 10px; }
.character-actions .price { font-size: 12px; }
#lobby .character-actions [aria-pressed="true"] { border-color: #79ad9c; }
.recruit-banner {
  min-height: 202px; display: grid; grid-template-columns: minmax(270px, .95fr) minmax(0, 1fr); align-items: center;
  position: relative; overflow: hidden; isolation: isolate; border-radius: 22px; border: 1px solid #967966;
  margin-bottom: 22px; padding: 22px 35px;
  background: radial-gradient(ellipse at 74% 48%, #cd8c7490, transparent 58%), linear-gradient(133deg, #282a44 18%, #513a54 72%, #63404e);
}
.recruit-banner::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(150deg, transparent 60%, #ffd4a528 61% 62%, transparent 63%),
    repeating-linear-gradient(120deg, #ffd4a509 0 1px, transparent 2px 36px);
}
.recruit-banner .page-title { margin: 0; z-index: 1; }
#lobby .recruit-banner .page-title p { color: #f2d9d5; max-width: 30ch; }
.shop-toolbar { display: flex; justify-content: space-between; align-items: start; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.shop-toolbar .collection-filters { margin: 0; }
#lobby .shop-toolbar .lbtn { font-size: 13px; }
.recruit-showcase { display: flex; justify-content: center; align-items: end; gap: 5px; }
.showcase-unit {
  width: min(32%, 160px); padding: 4px; border: 1px solid #e5b783; border-radius: 12px;
  background: #3e2f47; box-shadow: 0 9px 14px #16112489; transform-origin: 50% 100%;
}
.showcase-unit:first-child { rotate: -8deg; translate: 0 8px; }
.showcase-unit:nth-child(2) { scale: 1.1; z-index: 1; }
.showcase-unit:nth-child(3) { rotate: 8deg; translate: 0 8px; }
.showcase-unit .unit-art { aspect-ratio: 1; border-radius: 8px; }
.showcase-unit canvas { width: 100%; height: 100%; }
.supplies { margin-top: 36px; }
.supplies .section-head { margin-bottom: 12px; }
.shop-details h3 { margin: 0; font-size: 18px; }
.profile-dialog {
  position: fixed; width: min(760px, calc(100% - 34px)); max-height: calc(100dvh - 36px); overflow: auto;
  padding: 0; color: var(--cream); border: 1px solid var(--rarity-edge); border-radius: 20px; background: #17263c;
  box-shadow: 0 25px 80px #060910d6;
}
.profile-dialog::backdrop { background: #080c1ad9; backdrop-filter: blur(3px); }
.profile-dialog-content { display: grid; grid-template-columns: minmax(230px, .78fr) minmax(0, 1fr); }
.profile-dismiss { position: absolute; top: 9px; right: 9px; z-index: 1; }
#lobby .profile-close {
  width: 44px; height: 44px; border: 1px solid var(--rarity-edge); border-radius: 12px;
  background: #101b2ce5; color: var(--cream); font: 800 24px/1 system-ui;
}
.profile-gallery { position: relative; min-height: 100%; }
.profile-gallery .gallery-art { position: absolute; inset: 0; place-items: center; }
.profile-gallery .gallery-art::before { top: 20%; }
.profile-gallery .gallery-art canvas { height: auto; width: 100%; scale: 1.08; }
.profile-copy { padding: 22px 22px 18px; }
#lobby .profile-copy h2 { padding-right: 42px; font-size: clamp(25px, 4vw, 34px); overflow-wrap: anywhere; }
#lobby .profile-role { color: var(--rarity-color); font-size: 13px; margin: 5px 0 11px; font-weight: 800; }
#lobby .profile-summary, #lobby .profile-copy p { color: #d2dcea; }
#lobby .profile-copy .profile-role { color: var(--rarity-color); }
.profile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-block: 13px; }
.profile-stats > div { padding: 7px 9px; background: #24344c; border-radius: 8px; }
.profile-stats dt { font-size: 11px; color: #c2cddd; }
.profile-stats dd { margin: 2px 0 0; font-weight: 850; font-size: 14px; }
.profile-ability, .profile-lore { padding: 9px 12px; margin-top: 8px; border-radius: 9px; background: #202f45; }
.profile-ability { border-left: 3px solid var(--rarity-color); background: var(--rarity-bg); }
.profile-ability h3, .profile-lore h3 { margin: 0 0 4px; color: var(--rarity-color); font-size: 14px; }
#lobby .profile-ability p, #lobby .profile-lore p { font-size: 13px; line-height: 1.54; }
.profile-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 13px; }
.profile-actions .price { margin-right: auto; }
#lobby .profile-copy .profile-notice {
  margin-top: 10px; padding: 8px 10px; border-radius: 8px; border: 1px solid #5f8d85;
  background: #23463f; color: #e2fff4; font-size: 13px;
}
.gacha-layout { display: grid; grid-template-columns: 1.05fr 1fr; gap: 18px; align-items: start; }
.machine-scene {
  display: grid; place-items: center; overflow: hidden; min-height: 206px;
  background: radial-gradient(circle at 52% 56%, #f5c4a2 0 13%, #c3849e 13.4% 30%, #8c608b 30.4% 48%, #514267 49%);
}
.machine {
  position: relative; width: 137px; height: 155px; border: 4px solid #fce0c1; border-radius: 42px 42px 25px 25px;
  background: linear-gradient(#7c6b9d 0 58%, #ffb18c 58% 83%, #e78774 84%);
  box-shadow: inset 0 0 0 4px #ffe3c34f, 9px 10px #3e2f50a6;
}
.machine::before, .machine::after { content: ''; position: absolute; background: #f0d5e7; border-radius: 9px; }
.machine::before { top: 11px; left: 20px; width: 42%; height: 5px; rotate: -8deg; }
.machine::after { left: 36%; bottom: 10px; width: 28%; height: 7px; background: #402f44; }
.machine i { position: absolute; left: 41%; bottom: 22px; width: 18%; aspect-ratio: 1; border-radius: 50%; background: #51364e; box-shadow: inset 0 0 0 4px #834e62; }
.machine .capsule { display: block; position: absolute; top: 27%; left: 10%; width: 40px; animation: hero-bob 3.8s ease-in-out infinite; }
.machine .capsule:nth-child(2) { top: 19%; left: 49%; rotate: 54deg; animation-delay: -1.2s; background: linear-gradient(0deg, #6bbdaf 0 50%, #ffe8b6 51%); }
.machine .capsule:nth-child(3) { top: 35%; left: 36%; width: 34px; rotate: -12deg; animation-delay: -2.3s; background: linear-gradient(0deg, #e988a5 0 50%, #ffdeb8 51%); }
.gacha-actions, .pool-panel, .shop-details { padding: 19px; }
#lobby .gacha-actions p, #lobby .pool-panel p { margin-top: 7px; color: var(--quiet); font-size: 13px; }
#lobby .pity-label { color: var(--peach) !important; }
.gacha-actions > .lbtn { margin-top: 14px; }
.pool-row, .pull-result { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #31435d; }
.pool-row .unit-art, .pull-result .unit-art { flex: 0 0 70px; height: 58px; border: 1px solid var(--rarity-edge); border-radius: 9px; }
.pull-result .unit-art { flex-basis: 85px; height: 72px; }
.pool-row > div:nth-child(2) { flex: 1; }
.pool-row small { color: var(--quiet); display: block; font-size: 12px; }
.pool-row > strong { color: var(--peach); font-size: 14px; }
.pool-row:last-child { border-bottom: 0; }
.pull-result { margin-top: 14px; padding: 10px; border: 1px solid var(--rarity-edge); border-radius: 10px; background: var(--rarity-bg); animation: reveal .28s ease-out; }
@keyframes reveal { from { opacity: 0; translate: 0 7px; } }
.shop-visual { display: grid; place-items: center; height: 118px; background: radial-gradient(ellipse at center, #467b77, #26394c); }
.shop-cannon { background: radial-gradient(ellipse at center, #976a68, #49374c); }
.shop-cannon .supply-art { rotate: 11deg; background: #efae80; border-color: #ffddbb; }
.shop-cannon .supply-art::after { content: ''; width: 26%; height: 64%; margin: 7px auto; background: #78495a; clip-path: polygon(50% 0,100% 0,70% 40%,100% 40%,25% 100%,40% 57%,0 57%); }
#lobby .shop-details p { margin-top: 7px; }
.settings-panel { max-width: 760px; padding-inline: 16px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 7px; border-bottom: 1px solid #31435d; }
.setting-row:last-child { border-bottom: 0; }
.setting-row strong, .setting-row small { display: block; }
.setting-row small { margin-top: 4px; color: var(--quiet); font-size: 12px; }
.toggle {
  appearance: none; flex: 0 0 50px; height: 28px; padding: 3px;
  background: #394b66; border-radius: 999px; border: 1px solid #5e718c;
}
.toggle::before { content: ''; display: block; width: 20px; aspect-ratio: 1; border-radius: 50%; background: #e5e1e1; transition: translate .16s; }
.toggle:checked { background: #397d72; border-color: #89c4af; }
.toggle:checked::before { translate: 22px 0; background: #f9f4e9; }
.volume { flex: 0 1 210px; display: flex; align-items: center; gap: 9px; }
.volume input { accent-color: #ffb18c; width: 100%; }
.volume output { width: 40px; flex: none; color: var(--peach); text-align: end; }
.setting-row select { min-height: 42px; border-radius: 8px; padding: 3px 10px; color: #fff5e7; background: #263853; border: 1px solid #4d627e; }
.notice {
  position: fixed; z-index: 4; bottom: max(18px, env(safe-area-inset-bottom)); right: max(18px, env(safe-area-inset-right)); max-width: calc(100% - 36px);
  border: 1px solid #58716e; background: #173932; color: #f1fff8; padding: 11px 16px; border-radius: 10px; opacity: 0;
  translate: 0 8px; pointer-events: none; transition: opacity .2s, translate .2s;
}
.notice.visible { opacity: 1; translate: 0; }
.battle-reward { color: #9a4727; font-weight: 900; }
.reduce-motion #lobby *, .reduce-motion #cannon.full { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  #lobby * { animation: none !important; transition: none !important; }
}
@media (max-width: 920px) {
  .lobby-container { width: calc(100% - 38px); }
  .header-inner { gap: 9px; }
  .lobby-nav { gap: 2px; }
  .lobby-nav a { padding-inline: 10px; }
  .currency-name { display: none; }
  .stage-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .unit-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .mini-unit { flex-basis: 107px; }
  .character-actions .price { font-size: 11px; }
}
@media (max-width: 640px) {
  .lobby-container { width: calc(100% - 24px); }
  .header-inner { display: grid; grid-template-columns: 1fr auto; gap: 7px 8px; padding-block: 8px; }
  .brand { font-size: 18px; }
  .brand-mark { width: 34px; height: 34px; }
  .lobby-nav { grid-column: 1 / -1; grid-row: 2; }
  .lobby-nav a { padding: 11px 2px; font-size: 13px; }
  .home-grid { grid-template-columns: 1fr; gap: 13px; }
  .hero-scene { height: clamp(180px, 51vw, 245px); }
  .hero-brief { padding: 15px; align-items: start; flex-wrap: wrap; }
  .hero-team { inset-inline: 5%; }
  .hero-team .unit-art { max-width: 160px; }
  .home-side { grid-template-columns: 1fr 1fr; grid-template-rows: auto; gap: 8px; }
  .shortcut { min-height: 105px; padding: 10px; }
  .shortcut strong { font-size: 17px; }
  #lobby .shortcut p { font-size: 11px; }
  .shortcut .capsule { width: 37px; }
  .shortcut .supply-art { width: 34px; height: 28px; }
  .shortcut .supply-art::after { font-size: 20px; }
  .shortcut-portrait { right: -12px; bottom: -9px; width: 55%; }
  .progress-panel { grid-column: span 2; }
  .team-strip { padding: 14px; margin-top: 13px; }
  .mini-roster { gap: 5px; }
  .mini-unit { flex: 0 1 calc((100% - 20px) / 5); }
  .mini-unit .unit-art { height: 52px; }
  .mini-unit .rarity-chip { left: 2px; top: 3px; font-size: 8px; }
  .mini-unit strong { font-size: 11px; overflow-wrap: anywhere; }
  .stage-grid, .shop-grid, .gacha-layout { grid-template-columns: 1fr; gap: 13px; }
  .unit-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .collectible-body { padding: 9px; }
  .collectible-card .gallery-art { height: clamp(105px, 33vw, 160px); }
  .card-badges { top: 6px; left: 6px; right: 6px; }
  .card-preview-label { right: 5px; bottom: 5px; padding: 2px 4px; font-size: 10px; }
  .card-status { font-size: 9px; }
  .character-actions { gap: 7px; }
  .character-actions > .lbtn { flex: 1; }
  .collection-filters { gap: 5px; }
  #lobby .collection-filter { padding-inline: 12px; }
  .recruit-banner { grid-template-columns: 1fr; gap: 12px; padding: 17px 17px 15px; }
  .recruit-showcase { max-width: 330px; width: 100%; justify-self: center; padding-bottom: 9px; }
  .showcase-unit { width: min(29%, 96px); }
  .profile-dialog-content { grid-template-columns: 1fr; }
  .profile-gallery { height: clamp(126px, 42vw, 222px); min-height: 0; }
  .profile-gallery .gallery-art::before { width: 132px; top: 8%; left: calc(50% - 66px); }
  .profile-gallery .gallery-art canvas { height: 100%; width: auto; }
  .profile-copy { padding: 12px 14px 14px; }
  #lobby .profile-copy h2 { padding-right: 0; }
  .profile-gallery .card-badges { right: 62px; top: 12px; left: 12px; }
  .page-title { margin-bottom: 17px; }
  .mission-landscape { height: 105px; }
  .setting-row { padding-inline: 0; }
}
