.tool-icon.play,
.tool-menu-icon.play {
  background: #283853;
  color: #fff;
}

.tool-icon.play img,
.tool-menu-icon.play img { filter: brightness(0) invert(1); }

.boss-play-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
  gap: clamp(32px, 6vw, 96px);
  align-items: end;
  margin: 24px auto 28px;
  padding: clamp(42px, 7vw, 100px);
  width: min(var(--max), calc(100% - 32px));
  overflow: hidden;
  border-radius: 42px;
  background:
    radial-gradient(circle at 92% 18%, rgba(254, 204, 0, .28), transparent 22%),
    linear-gradient(128deg, #18253c 0%, #283853 58%, #53668d 100%);
  color: #fff;
}

.boss-play-intro::after {
  position: absolute;
  right: -70px;
  bottom: -150px;
  width: 430px;
  height: 430px;
  border: 70px solid rgba(255,255,255,.06);
  border-radius: 50%;
  content: "";
}

.boss-play-intro > a {
  position: absolute;
  top: 30px;
  left: clamp(42px, 7vw, 100px);
  color: rgba(255,255,255,.72);
  font-size: 13px;
  text-decoration: none;
}

.boss-play-intro > a:hover { color: #fecc00; }
.boss-play-intro > div { position: relative; z-index: 1; max-width: 850px; }
.boss-play-intro .eyebrow { color: #fecc00; }
.boss-play-intro h1 {
  max-width: 760px;
  margin: 18px 0 22px;
  color: #fff;
  font-size: clamp(48px, 6.5vw, 104px);
  line-height: .92;
  letter-spacing: -.065em;
}

.boss-play-intro > div > p:last-child {
  max-width: 720px;
  color: rgba(255,255,255,.75);
  font-size: clamp(17px, 1.45vw, 22px);
  line-height: 1.5;
}

.boss-play-intro aside {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 24px;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
}

.boss-play-intro aside span {
  color: #fecc00;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
}

.boss-play-intro aside b { font-size: 18px; line-height: 1.35; }

.boss-game {
  --game-ink: #17243b;
  --game-blue: #53668d;
  --game-dark: #283853;
  --game-yellow: #fecc00;
  --game-paper: #f8f8f5;
  --game-line: #cbd2df;
  --game-muted: #707b91;
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto clamp(72px, 10vw, 150px);
  color: var(--game-ink);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.boss-game button { font-family: inherit; }

.boss-game__shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--game-line);
  border-radius: 30px;
  background:
    linear-gradient(to right, rgba(40, 56, 83, .07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(40, 56, 83, .07) 1px, transparent 1px),
    var(--game-paper);
  background-size: 38px 38px;
  box-shadow: 0 30px 90px rgba(40,56,83,.16);
}

.boss-game__bar {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid var(--game-line);
  background: rgba(248,248,245,.94);
  color: #6f7b92;
  font-size: 12px;
  letter-spacing: .08em;
}

.boss-game__rule { height: 1px; background: var(--game-line); }
.boss-game__icon { color: var(--game-blue); font-size: 16px; }
.boss-game__icon img { width: 18px; height: 18px; display: block; }
.boss-game__title { white-space: nowrap; }

.boss-game__stage {
  position: relative;
  min-height: clamp(430px, 45vw, 650px);
  padding: 58px 30px 70px;
}

.boss-game__canvas {
  display: block;
  width: 100%;
  height: clamp(340px, 37vw, 530px);
  cursor: crosshair;
  touch-action: manipulation;
}

.boss-game__canvas:focus-visible { outline: 2px solid var(--game-yellow); outline-offset: -2px; }

.boss-game__brief {
  position: absolute;
  z-index: 2;
  top: 72px;
  left: 20px;
  display: grid;
  gap: 6px;
  padding-left: 14px;
  border-left: 3px solid var(--game-yellow);
  pointer-events: none;
}

.boss-game__brief span { color: var(--game-muted); font-size: 9px; letter-spacing: .14em; }
.boss-game__brief strong { color: var(--game-dark); font-size: 11px; font-weight: 700; letter-spacing: .12em; }

.boss-game__help {
  position: absolute;
  top: 18px;
  left: 20px;
  max-width: 320px;
  margin: 0;
  color: #6f7a8e;
  font-size: 10px;
  line-height: 1.45;
}

.boss-game__edge {
  position: absolute;
  top: 17px;
  left: 50%;
  transform: translateX(-50%);
  border: 0;
  background: transparent;
  color: #778299;
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  cursor: pointer;
}

.boss-game__edge:hover,
.boss-game__edge:focus-visible { color: var(--game-dark); outline: none; }

.boss-game__config {
  position: absolute;
  z-index: 7;
  top: 48px;
  left: 50%;
  width: min(390px, calc(100% - 28px));
  transform: translateX(-50%);
  border: 1px solid var(--game-line);
  background: rgba(255,255,255,.98);
  box-shadow: 0 18px 50px rgba(40,56,83,.18);
  color: #5c687e;
  font-size: 10px;
}

.boss-game__config > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--game-line); }
.boss-game__config pre { margin: 0; padding: 14px; line-height: 1.7; white-space: pre-wrap; }
.boss-game__config i { color: var(--game-blue); font-style: normal; font-weight: 700; }

.boss-game__live {
  position: absolute;
  top: 14px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  padding: 0 14px;
  border: 1px solid var(--game-line);
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: #59667d;
  font-size: 9px;
  letter-spacing: .14em;
}

.boss-game__live::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3f9b61;
  box-shadow: 0 0 0 4px rgba(63,155,97,.12);
  content: "";
}

.boss-game__legend {
  position: absolute;
  z-index: 2;
  top: 76px;
  right: 20px;
  display: flex;
  gap: 13px;
  color: #7a8497;
  font-size: 8px;
  letter-spacing: .08em;
  pointer-events: none;
}

.boss-game__legend span { display: inline-flex; align-items: center; gap: 5px; }
.boss-game__legend i { width: 6px; height: 6px; background: #e44747; }
.boss-game__legend .is-camera { background: #53668d; }
.boss-game__legend .is-access { background: #19a0a8; }
.boss-game__legend .is-client { background: #3f9b61; }
.boss-game__legend .is-team { background: #8b62b4; }

.boss-game__status {
  position: absolute;
  left: 20px;
  bottom: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #66738a;
  font-size: 10px;
}

.boss-game__status i { width: 6px; height: 6px; border-radius: 50%; background: #3f9b61; }
.boss-game.has-signal .boss-game__status i { animation: boss-signal .7s ease; }

.boss-game__telemetry {
  position: absolute;
  left: 50%;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  color: #68758b;
  font-size: 10px;
  letter-spacing: .03em;
  white-space: nowrap;
}

.boss-game__telemetry strong { color: var(--game-blue); font-weight: 600; }
.boss-game__telemetry .is-good { color: #347e50; }
.boss-game__telemetry em { font-style: normal; opacity: .45; }

.boss-game__score {
  position: absolute;
  right: 150px;
  bottom: 22px;
  display: flex;
  gap: 15px;
  color: #68758b;
  font-size: 9px;
  letter-spacing: .08em;
}

.boss-game__score b { color: var(--game-dark); }

.boss-game__actions { position: absolute; right: 16px; bottom: 13px; display: flex; gap: 6px; }
.boss-game__actions button {
  display: grid;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  place-items: center;
  border: 1px solid var(--game-line);
  background: rgba(255,255,255,.9);
  color: var(--game-blue);
  font-size: 10px;
  cursor: pointer;
}

.boss-game__actions button:hover,
.boss-game__actions button:focus-visible,
.boss-game__actions button[aria-pressed="true"] { background: var(--game-dark); color: #fff; outline: none; }

.boss-game__protocol {
  position: absolute;
  z-index: 8;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(460px, calc(100% - 40px));
  gap: 9px;
  padding: 26px 30px;
  transform: translate(-50%, -46%) scale(.96);
  border: 1px solid var(--game-yellow);
  background: rgba(40,56,83,.96);
  box-shadow: 0 24px 70px rgba(40,56,83,.34);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transition: opacity .22s ease, transform .35s cubic-bezier(.2,.9,.2,1.2);
}

.boss-game__protocol span { color: var(--game-yellow); font-size: 10px; letter-spacing: .24em; }
.boss-game__protocol strong { font-size: clamp(16px, 2vw, 23px); letter-spacing: .08em; }
.boss-game.is-completing .boss-game__protocol { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.boss-game.is-completing .boss-game__stage::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(254,204,0,.12) 50%, transparent 65%);
  content: "";
  pointer-events: none;
  animation: boss-scan .9s ease both;
}

.boss-game__start,
.boss-game__over {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(24,37,60,.95);
  color: #fff;
  text-align: center;
  backdrop-filter: blur(7px);
}

.boss-game__start[hidden],
.boss-game__over[hidden] { display: none; }
.boss-game__start img { width: 76px; height: 76px; margin-bottom: 18px; border-radius: 20px; }
.boss-game__start > p,
.boss-game__over > p { margin: 0 0 12px; color: var(--game-yellow); font-size: 10px; font-weight: 800; letter-spacing: .22em; }
.boss-game__start h2,
.boss-game__over h2 { max-width: 640px; margin: 0 0 14px; color: #fff; font-family: inherit; font-size: clamp(30px, 4vw, 60px); line-height: 1; letter-spacing: -.05em; }
.boss-game__start > span,
.boss-game__over > span { max-width: 550px; color: rgba(255,255,255,.72); font-size: 13px; line-height: 1.5; }
.boss-game__start .button,
.boss-game__over .button { margin-top: 26px; border: 0; background: var(--game-yellow); color: #111; cursor: pointer; }
.boss-game__start small { margin-top: 18px; color: rgba(255,255,255,.45); font-size: 9px; letter-spacing: .14em; }

.boss-game__controls {
  display: none;
  grid-template-columns: repeat(3, 46px);
  grid-template-rows: repeat(2, 46px);
  justify-content: center;
  gap: 6px;
  padding: 15px;
  border-top: 1px solid var(--game-line);
  background: rgba(248,248,245,.96);
}

.boss-game__controls button { border: 1px solid var(--game-line); background: #fff; color: var(--game-dark); font-size: 17px; cursor: pointer; }
.boss-game__controls button:active { background: var(--game-dark); color: #fff; }
.boss-game__controls [data-dir="up"] { grid-column: 2; }
.boss-game__controls [data-dir="left"] { grid-column: 1; grid-row: 2; }
.boss-game__controls [data-dir="down"] { grid-column: 2; grid-row: 2; }
.boss-game__controls [data-dir="right"] { grid-column: 3; grid-row: 2; }

.boss-game__credit {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  padding: 14px 20px 16px;
  border-top: 1px solid var(--game-line);
  background: #fff;
  color: #7a8497;
  font-size: 10px;
}

.boss-game__credit a { color: var(--game-dark); font-weight: 800; text-decoration: none; }
.boss-game__credit a:hover { color: #b18d00; }

.boss-play-how {
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  gap: clamp(36px, 8vw, 120px);
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto clamp(80px, 11vw, 160px);
}

.boss-play-how h2 { max-width: 440px; margin-top: 15px; font-size: clamp(38px, 4vw, 68px); line-height: .98; letter-spacing: -.055em; }
.boss-play-how ol { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; padding: 0; border-top: 1px solid #d6dbe4; list-style: none; }
.boss-play-how li { min-height: 190px; padding: 28px; border-right: 1px solid #d6dbe4; border-bottom: 1px solid #d6dbe4; }
.boss-play-how li:nth-child(2n) { border-right: 0; }
.boss-play-how li span { display: block; margin-bottom: 42px; color: #8b96aa; font-size: 11px; }
.boss-play-how li b { display: block; margin-bottom: 8px; color: #283853; font-size: 21px; }
.boss-play-how li p { margin: 0; color: #707b8f; line-height: 1.45; }
.boss-play-more { margin-bottom: 120px; }

@keyframes boss-scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes boss-signal { 0% { box-shadow: 0 0 0 0 rgba(63,155,97,.45); } 100% { box-shadow: 0 0 0 12px rgba(63,155,97,0); } }

@media (max-width: 1180px) {
  .boss-game__score { display: none; }
  .boss-game__legend { top: 96px; }
}

@media (max-width: 820px) {
  .boss-play-intro { grid-template-columns: 1fr; padding-top: 90px; border-radius: 28px; }
  .boss-play-intro aside { max-width: 480px; }
  .boss-game__bar { grid-template-columns: auto 1fr auto; gap: 10px; }
  .boss-game__bar .boss-game__rule:first-of-type { display: none; }
  .boss-game__title { font-size: 9px; }
  .boss-game__stage { min-height: 470px; padding: 62px 10px 72px; }
  .boss-game__canvas { height: 340px; margin-top: 35px; }
  .boss-game__help { top: 116px; left: 12px; max-width: 235px; font-size: 9px; }
  .boss-game__brief { top: 59px; left: 12px; max-width: 200px; }
  .boss-game__brief strong { font-size: 9px; }
  .boss-game__legend { top: 97px; right: 10px; gap: 7px; }
  .boss-game__legend span { gap: 3px; font-size: 7px; }
  .boss-game__live { right: 10px; }
  .boss-game__edge { left: auto; right: 90px; transform: none; }
  .boss-game__status { display: none; }
  .boss-game__telemetry { right: 110px; bottom: 16px; left: 12px; width: auto; transform: none; flex-wrap: wrap; justify-content: flex-start; gap: 3px 8px; line-height: 1.35; }
  .boss-game__telemetry em { display: none; }
  .boss-game__actions { right: 10px; bottom: 11px; }
  .boss-game__sound { display: none !important; }
  .boss-game__controls { display: grid; }
  .boss-play-how { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .boss-play-intro { padding: 72px 22px 30px; gap: 17px; }
  .boss-play-intro > a { top: 24px; left: 22px; }
  .boss-play-intro h1 { margin: 12px 0 16px; font-size: clamp(42px, 13vw, 58px); }
  .boss-play-intro > div > p:last-child { margin-bottom: 0; font-size: 16px; }
  .boss-play-intro aside { display: none; }
  .boss-game__shell { border-radius: 20px; }
  .boss-game__legend span:nth-child(4),
  .boss-game__legend span:nth-child(5) { display: none; }
  .boss-game__edge { display: none; }
  .boss-game__stage { min-height: 450px; padding: 58px 6px 70px; }
  .boss-game__canvas { height: 326px; margin-top: 32px; }
  .boss-game__start,
  .boss-game__over { padding: 22px 18px; }
  .boss-game__start img { width: 60px; height: 60px; margin-bottom: 12px; }
  .boss-game__start h2,
  .boss-game__over h2 { font-size: clamp(30px, 10vw, 44px); }
  .boss-game__start .button,
  .boss-game__over .button { min-height: 48px; margin-top: 20px; }
  .boss-game__controls { grid-template-columns: repeat(3, 54px); grid-template-rows: repeat(2, 54px); gap: 7px; padding: 16px; }
  .boss-game__controls button { min-width: 54px; min-height: 54px; border-radius: 10px; touch-action: manipulation; }
  .boss-game__actions button { min-width: 44px; height: 44px; }
  .boss-game__telemetry { right: 106px; bottom: 18px; }
  .boss-game__credit { justify-content: center; flex-wrap: wrap; text-align: center; }
  .boss-play-how ol { grid-template-columns: 1fr; }
  .boss-play-how li { border-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .boss-game__protocol,
  .boss-game.is-completing .boss-game__stage::after { animation: none; transition: none; }
}
