html:has(.formation-shell) {font-size:100%; background:#181418;}
body:has(.formation-shell) {
  --paper:#f7ead6;
  --foil:#d7b784;
  --caption:#cbbba9;
  --case:#20191e;
  --tray:#2d2026;
  --selected:#f5cf99;
  --seam:#6a554b;
  background:radial-gradient(ellipse at 14% 20%,#33212a,transparent 63%),#181418;
}
.shell.formation-shell {
  max-width:1170px;
  padding:0 clamp(12px,3.4vw,42px) max(28px,env(safe-area-inset-bottom));
  color:var(--paper);
}
.formation-shell .topbar,.formation-shell .arc-prep-toolbar {
  height:clamp(54px,6vw,70px);
  border-bottom:1px solid #91765475;
  color:var(--caption);
}
.formation-brand {
  display:inline-flex; align-items:center; gap:9px;
  min-height:44px; min-width:0; margin-right:6px;
}
.formation-brand img:first-child {width:clamp(21px,3.5vw,34px); border-radius:50%;}
.formation-brand img:last-child {width:clamp(94px,22vw,186px); height:auto;}
.formation-shell .topbar nav {display:flex; align-items:center; gap:clamp(0px,.7vw,12px);}
.formation-shell .topbar nav button {
  display:inline-grid; place-items:center; flex:none;
  min-width:40px; height:44px; padding:3px; border:0; border-radius:0;
  color:var(--foil); background:transparent; box-shadow:none;
}
.formation-shell .topbar .profile-link {display:flex; align-items:center; gap:6px;}
.formation-shell .profile-link [data-player-name] {max-width:7em; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.formation-shell .profile-link .player-face {width:28px; height:28px; border-color:#bb9567;}
.formation-shell .topbar .sound-small:not(:focus-visible) {outline:0;}
.formation-shell .topbar .speaker-icon {width:20px; height:20px;}
.formation-shell .topbar .suit-icon {width:21px; height:24px;}
.formation-shell .topbar .icon-button:last-child {font:italic 22px/1 Georgia,serif;}
.formation-shell .topbar nav button:hover {color:#fff1d6; background:#efd9b50c;}
.formation-shell .lobby {display:block; width:100%; max-width:none; margin:0; padding:0;}
.formation-shell .preparation {
  display:grid; grid-template-columns:minmax(0,1fr); align-items:start;
  grid-template-areas:"heading" "shelf" "cards" "word" "footer" "promo";
  gap:clamp(16px,3vw,24px); padding:0;
  background:transparent; border:0; box-shadow:none;
}
.formation-shell .formation-heading {
  grid-area:heading; position:relative; isolation:isolate; overflow:hidden;
  display:flex; align-items:center; min-height:clamp(133px,19vw,202px);
  margin-bottom:-3px; padding:18px clamp(14px,3.6vw,44px);
  border-bottom:1px solid #b28b5e9e;
  background:#19151b;
}
.formation-heading::before {
  content:""; position:absolute; z-index:-2; inset:0 0 0 24%;
  background:url('./assets/story/bar-duel.webp') center 32% / cover no-repeat;
}
.formation-heading::after {
  content:""; position:absolute; z-index:-1; inset:0;
  background:linear-gradient(90deg,#1b151c 2%,#21171ef7 19%,#261923ce 33%,#27162245 54%,transparent 75%),
    linear-gradient(0deg,#1d151c88,transparent 38%);
}
.formation-heading>div {position:relative;}
.formation-heading h1 {
  margin:0 0 10px; font:600 clamp(30px,5.3vw,62px)/1.14 var(--serif);
  letter-spacing:.1em; color:#fff0d9; text-shadow:0 2px 9px #241514;
}
.formation-heading p {color:#efdfcb; font:400 clamp(12px,1.5vw,15px)/1.65 var(--sans); text-shadow:0 1px 5px #1c0d15;}
.formation-shell .preparation>.prep-shelf {grid-area:shelf;}
.formation-shell .formation-cards {grid-area:cards;}
.formation-shell .preparation>.word-loadout {grid-area:word; margin:0;}
.formation-shell .prep-footer {grid-area:footer; display:block; margin:0; padding:0; border:0;}
.formation-shell .preparation .formation-start {
  position:relative; isolation:isolate; width:100%; min-height:56px; gap:12px;
  padding:11px 28px; border:1px solid #e5ca93; border-radius:0;
  background:linear-gradient(107deg,#ad844f,#f0d5a1 32%,#edd0a3 55%,#ceaa70 88%,#b48d58);
  color:#302029; font:700 clamp(17px,2vw,21px)/1.3 var(--serif); letter-spacing:.1em;
  box-shadow:0 5px 11px -5px #0c060c;
}
.formation-start::after {
  content:""; position:absolute; pointer-events:none; inset:3px;
  border:1px solid #6d4e396b; box-shadow:inset 1px 0 #ffefd7a8;
}
.formation-start .suit-icon {width:24px; height:24px;}
.formation-shell .preparation .formation-start:hover:enabled {background-color:#efd6a2; filter:brightness(1.06);}
.formation-shell .formation-start:disabled {opacity:.45;}
.formation-shell .preparation .lobby-promo {
  grid-area:promo; margin:0; isolation:isolate; min-height:96px;
  padding:14px 18px; border:0; border-block:1px solid #9b805e73;
  color:#fff1d9; background:#231923;
}
.formation-shell .lobby-promo-cover {
  inset:0;
  background:linear-gradient(90deg,#251923 2%,#261a21f0 18%,#24172373 49%,#2417230a 95%),
    url('./assets/back-to-back.webp') 78% 35% / cover no-repeat;
}
.formation-shell .lobby-promo strong {font-size:clamp(19px,2.5vw,28px);}
.formation-shell .lobby-promo small {font-size:12px; color:#f0d5a6;}
@media (min-width:880px) {
  .formation-shell .preparation {
    grid-template-columns:minmax(0,1fr) minmax(295px,.52fr);
    grid-template-rows:auto auto auto auto 1fr;
    grid-template-areas:"heading heading" "cards shelf" "cards word" "cards footer" "cards promo";
    column-gap:clamp(20px,3vw,40px); row-gap:18px;
  }
  .formation-shell .formation-heading {min-height:178px; margin-bottom:8px;}
}
@media (max-width:600px) {
  .formation-shell .profile-link [data-player-name] {display:none;}
  .formation-shell .formation-heading {margin-inline:calc(-1 * clamp(12px,3.4vw,42px));}
  .formation-shell .formation-heading::before {inset-inline-start:22%;background-position:59% 30%;}
  .formation-shell .formation-heading::after {
    background:linear-gradient(90deg,#20151c,#20151cf2 21%,#20151caa 43%,#20151c38 65%,transparent),
      linear-gradient(0deg,#20151c99,transparent 60%);
  }
  .formation-heading h1 {margin-bottom:8px;}
  .formation-heading p {max-width:17em; text-wrap:pretty;}
}
@media (max-width:359px) {
  .formation-brand {gap:5px;}
  .formation-brand img:first-child {display:none;}
  .formation-shell .topbar nav button {min-width:37px;}
}
