:root {
  color-scheme: dark;
  color: #fff;
  background: #100c1b;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
#practice-chooser {
  --diagonal-top: 59%;
  --diagonal-bottom: 41%;
  --launch-inset: max(clamp(40px, 7svh, 64px), calc(env(safe-area-inset-bottom) + 18px));
  --launch-height: 51px;
  --copy-gap: clamp(14px, 2.4svh, 24px);
  position: relative;
  isolation: isolate;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.chooser-heading {
  position: absolute;
  z-index: 2;
  top: max(22px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  text-align: center;
  pointer-events: none;
  text-shadow: 0 2px 8px #090511, 0 0 29px #0009;
}
.chooser-heading p, .chooser-heading h1 { margin: 0; }
.chooser-heading h1 { font-size: clamp(21px, 4.1vw, 49px); line-height: 1.12; text-wrap: balance; }
.chooser-heading .chooser-brand {
  margin-bottom: .65em;
  font-size: clamp(10px, 1.18vw, 14px);
  font-weight: 700;
  letter-spacing: .29em;
  color: #e5dbee;
}
#choose-hint { margin-top: .65em; font-size: clamp(12px, 1.6vw, 16px); color: #f0e7f8; }
.chooser-teams { position: absolute; inset: 0; }
.team-choice { position: absolute; width: 1px; height: 1px; opacity: 0; }
.chooser-team {
  --rim: 2px;
  position: absolute;
  inset: 0;
  display: block;
  cursor: pointer;
  touch-action: manipulation;
  clip-path: var(--shape);
  background: linear-gradient(155deg, var(--highlight), var(--rim-color) 42%, var(--ink) 82%, var(--highlight));
}
.chooser-team::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: var(--inside);
  background:
    linear-gradient(180deg, #080712e0 0%, #0d091b80 15%, transparent 32%, transparent 55%, var(--veil) 80%, #090710 100%),
    url('./assets/practice-chooser-spies-20261206.webp') center / cover no-repeat,
    radial-gradient(ellipse at var(--faction-x) 47%, var(--ink) 0%, #0b0917 75%);
  filter: saturate(.87) brightness(.89);
}
.chooser-team.attack {
  --faction-x: 24%;
  --highlight: #d6b1ff;
  --rim-color: #8a42bb;
  --ink: #512279;
  --veil: #1a0e2ce0;
  --shape: polygon(0 0, calc(var(--diagonal-top) - 1px) 0, calc(var(--diagonal-bottom) - 1px) 100%, 0 100%);
  --inside: polygon(var(--rim) var(--rim), calc(var(--diagonal-top) - var(--rim) - 1px) var(--rim), calc(var(--diagonal-bottom) - var(--rim) - 1px) calc(100% - var(--rim)), var(--rim) calc(100% - var(--rim)));
}
.chooser-team.defense {
  --faction-x: 76%;
  --highlight: #ffdf91;
  --rim-color: #b98437;
  --ink: #714818;
  --veil: #291b0de6;
  --shape: polygon(calc(var(--diagonal-top) + 1px) 0, 100% 0, 100% 100%, calc(var(--diagonal-bottom) + 1px) 100%);
  --inside: polygon(calc(var(--diagonal-top) + var(--rim) + 1px) var(--rim), calc(100% - var(--rim)) var(--rim), calc(100% - var(--rim)) calc(100% - var(--rim)), calc(var(--diagonal-bottom) + var(--rim) + 1px) calc(100% - var(--rim)));
}
.team-copy {
  position: absolute;
  left: var(--faction-x);
  bottom: calc(var(--launch-inset) + var(--launch-height) + var(--copy-gap));
  width: min(37%, 440px);
  display: grid;
  justify-items: center;
  gap: 5px;
  transform: translateX(-50%);
  text-align: center;
  text-shadow: 0 2px 10px #08050e, 0 0 20px #08050e;
  text-wrap: balance;
}
.team-identity {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1vw, 12px);
  text-align: start;
}
.team-identity img {
  flex: none;
  width: clamp(34px, min(9vw, 9svh), 72px);
  height: auto;
  filter: drop-shadow(0 0 13px var(--ink));
}
.team-copy strong { display: block; font-size: clamp(22px, min(4.7vw, 6svh), 56px); font-weight: 820; line-height: 1.04; }
.team-name { display: block; color: var(--highlight); font-size: clamp(10px, 1.35vw, 17px); font-weight: 800; letter-spacing: .15em; }
.team-role { font-size: clamp(12px, 1.7vw, 20px); font-weight: 650; }
.team-goal {
  position: relative;
  font-size: clamp(12px, 1.6vw, 18px);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--highlight);
  color: var(--highlight);
  font-weight: 690;
}
.team-choice:is(:focus-visible,:checked) + .chooser-team { --rim: 5px; }
.team-choice:is(:focus-visible,:checked) + .chooser-team::before { filter: saturate(1.16) brightness(1.16); }
.team-choice:checked + .chooser-team .team-copy img { filter: drop-shadow(0 0 16px var(--highlight)); }
.chooser-teams:has(.team-choice:checked) .team-choice:not(:checked) + .chooser-team::before { filter: saturate(.70) brightness(.74); }
.chooser-start {
  --launch-edge: #dab8ff;
  --launch-color: #291445;
  position: absolute;
  z-index: 2;
  bottom: var(--launch-inset);
  left: 50%;
  visibility: hidden;
  transform: translateX(-50%);
}
.chooser-teams:has(.team-choice:checked) .chooser-start { visibility: visible; }
.chooser-teams:has(#choose-defender:checked) .chooser-start { --launch-edge: #ffdb8b; --launch-color: #422e16; }
#practice-start {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  width: min(80vw, 320px);
  min-height: var(--launch-height);
  padding: 10px 24px;
  border: 2px solid var(--launch-edge);
  border-radius: 999px;
  font: inherit;
  font-size: clamp(15px, 2.2vw, 21px);
  font-weight: 780;
  color: #fff;
  background: var(--launch-color);
  box-shadow: 0 4px 26px #05030b, 0 0 17px color-mix(in srgb,var(--launch-edge),transparent 62%);
  cursor: pointer;
  touch-action: manipulation;
}
#practice-start:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
#practice-start span { font-size: 1.4em; line-height: .8; }
@media (hover:hover) {
  .team-choice:not(:checked) + .chooser-team:hover { --rim: 4px; }
  #practice-start:hover { background: color-mix(in srgb,var(--launch-color),var(--launch-edge) 22%); }
}
@media (orientation:portrait) {
  #practice-chooser { --diagonal-top: 56%; --diagonal-bottom: 44%; }
  .chooser-team::before { background-size: 100% 100%, auto 91%, 100% 100%; }
  .chooser-team.attack::before { background-position: center, 29% top, center; }
  .chooser-team.defense::before { background-position: center, 72.5% top, center; }
  .team-copy { width: 39%; }
}
@media (orientation:portrait) and (max-width:380px) {
  :lang(de) .team-copy strong { font-size: 16px; }
}
@media (max-height:560px) and (orientation:landscape), (max-height:470px) and (orientation:portrait) {
  #practice-chooser {
    --launch-inset: max(20px, calc(env(safe-area-inset-bottom) + 8px));
    --launch-height: 44px;
    --copy-gap: 10px;
  }
  .chooser-heading { top: max(9px, env(safe-area-inset-top)); }
  .chooser-heading .chooser-brand { margin-bottom: 4px; }
  .chooser-heading h1 { font-size: clamp(18px, 5.4vh, 27px); }
  #choose-hint { margin-top: 4px; }
  .team-copy { gap: 3px; }
  .team-identity img { width: clamp(32px, 10svh, 44px); }
  .team-copy strong { font-size: clamp(20px, 6.6svh, 30px); }
  .team-role, .team-goal { font-size: clamp(11px, 4vh, 16px); }
  .team-goal { margin-top: 4px; padding-top: 4px; }
  #practice-start { padding: 6px 19px; }
}
@media (orientation:landscape) and (min-aspect-ratio: 3/2) and (max-aspect-ratio: 2/1) and (max-height:400px) {
  .chooser-team::before { background-position: center, center 73%, center; }
}
