:root {
  --ink: #e9e2d1;
  --muted: #938d80;
  --coal: #11110f;
  --coal2: #181713;
  --panel: #201e19;
  --line: #38352d;
  --amber: #f3a629;
  --amber2: #ffd16c;
  --red: #e46243;
  --green: #9eb879;
  --radius: 4px;
  --display: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --mono: "Lucida Console", "Courier New", monospace;
  --body: Inter, Arial, sans-serif;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--coal);
  color: var(--ink);
  font-family: var(--body);
}
body {
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 20% -10%, #312518 0, transparent 36%),
    linear-gradient(135deg, #11110f, #15140f);
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
.hidden {
  display: none !important;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: -60px;
  left: 12px;
  background: var(--amber);
  color: #17130c;
  padding: 12px;
}
.skip-link:focus {
  top: 12px;
}
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.topbar {
  height: 76px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #302e28;
  position: relative;
  z-index: 10;
  background: rgba(17, 17, 15, 0.84);
  backdrop-filter: blur(16px);
}
.brand {
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 4px;
}
.brand-mark {
  width: 39px;
  height: 34px;
  display: block;
  position: relative;
}
.brand-mark:before {
  content: "";
  position: absolute;
  width: 30px;
  height: 10px;
  bottom: 3px;
  left: 4px;
  background: var(--amber);
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
}
.brand-mark:after {
  content: "";
  position: absolute;
  width: 6px;
  height: 20px;
  left: 18px;
  bottom: 11px;
  background: var(--amber);
  transform: rotate(60deg);
  transform-origin: bottom;
}
.brand-mark i {
  position: absolute;
  width: 7px;
  height: 7px;
  border: 2px solid var(--amber);
  border-radius: 50%;
  bottom: -1px;
}
.brand-mark i:nth-child(1) {
  left: 7px;
}
.brand-mark i:nth-child(2) {
  left: 17px;
}
.brand-mark i:nth-child(3) {
  left: 27px;
}
.brand b {
  font: 800 17px/14px var(--display);
  letter-spacing: 3px;
}
.brand small {
  display: block;
  color: var(--amber);
  font: 600 12px/13px var(--mono);
  letter-spacing: 6px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.icon-button {
  width: 39px;
  height: 39px;
  border: 1px solid var(--line);
  background: #191814;
  border-radius: 3px;
  font-size: 19px;
}
.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--amber);
  color: var(--amber);
}
.connection {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  text-transform: uppercase;
  font: 500 12px var(--mono);
  letter-spacing: 1px;
  margin-right: 14px;
}
.connection i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #776c5d;
}
.connection.online i {
  background: #87b864;
  box-shadow: 0 0 8px #87b864;
}
.connection.connecting i {
  background: var(--amber);
  animation: pulse 1s infinite;
}
.screen {
  display: none;
  min-height: calc(100vh - 76px);
}
.screen.active {
  display: block;
}
.home-screen {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(55px, 10vh, 120px) clamp(25px, 8vw, 130px);
  grid-template-columns: minmax(350px, 1fr) minmax(330px, 420px);
  gap: 7vw;
  align-items: center;
}
.home-screen.active {
  display: grid;
}
.home-copy {
  position: relative;
  z-index: 3;
  max-width: 650px;
}
.eyebrow {
  color: var(--amber);
  font: 600 12px var(--mono);
  letter-spacing: 2.4px;
  text-transform: uppercase;
  margin: 0 0 15px;
}
.home-copy h1,
.section-heading h1 {
  font: 800 clamp(60px, 7.7vw, 112px) / 0.84 var(--display);
  letter-spacing: -2px;
  text-transform: uppercase;
  margin: 0;
  max-width: 680px;
  text-shadow: 0 3px 0 #060606;
}
.lede {
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.6;
  color: #aaa396;
  max-width: 490px;
  margin: 30px 0;
}
.feature-line {
  display: flex;
  gap: 26px;
  font: 600 12px var(--mono);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.feature-line i {
  font-style: normal;
  color: var(--amber);
  margin-right: 6px;
}
.panel {
  background: linear-gradient(
    145deg,
    rgba(35, 33, 27, 0.96),
    rgba(25, 24, 20, 0.97)
  );
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}
.entry-card {
  padding: 34px;
  position: relative;
  z-index: 4;
}
.field-label,
.control-label {
  display: block;
  color: #aaa396;
  font: 600 12px var(--mono);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 9px;
}
input,
select {
  border: 1px solid #48443a;
  background: #151511;
  border-radius: 3px;
  outline: 0;
  min-height: 48px;
  padding: 0 14px;
}
input:focus,
select:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 2px rgba(243, 166, 41, 0.12);
}
#playerName {
  width: 100%;
  font-size: 17px;
  margin-bottom: 14px;
}
.primary-button,
.secondary-button {
  min-height: 50px;
  border: 0;
  border-radius: 3px;
  text-transform: uppercase;
  font: 700 12px var(--mono);
  letter-spacing: 1.2px;
}
.primary-button {
  background: var(--amber);
  color: #1a150b;
  padding: 0 22px;
}
.primary-button:hover {
  background: var(--amber2);
  transform: translateY(-1px);
}
.primary-button:disabled {
  filter: grayscale(0.7);
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.primary-button.big {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.primary-button.big b {
  font-size: 22px;
}
.secondary-button {
  border: 1px solid #5b5548;
  background: #2a2821;
  padding: 0 25px;
}
.secondary-button:hover {
  border-color: var(--amber);
}
.rule {
  display: flex;
  align-items: center;
  color: #777165;
  text-transform: uppercase;
  font: 500 12px var(--mono);
  letter-spacing: 1px;
  margin: 25px 0;
}
.rule:before,
.rule:after {
  content: "";
  height: 1px;
  background: #39362f;
  flex: 1;
}
.rule span {
  padding: 0 12px;
}
.join-row {
  display: grid;
  grid-template-columns: 1fr 105px;
  gap: 9px;
}
.join-row input {
  text-align: center;
  font: 600 20px var(--mono);
  letter-spacing: 8px;
  padding-left: 22px;
}
.form-status {
  min-height: 16px;
  font: 500 12px var(--mono);
  color: var(--red);
  margin: 15px 0 0;
}
.resume-box {
  text-align: center;
}
.resume-box strong {
  display: block;
  font: 700 38px var(--display);
  text-transform: uppercase;
  margin: 8px 0 22px;
}
.resume-box .primary-button {
  width: 100%;
}
.text-button,
.danger-text {
  background: none;
  border: 0;
  color: #9e978a;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 12px;
  padding: 13px;
}
.hero-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -1;
}
.sun {
  position: absolute;
  width: 46vw;
  max-width: 700px;
  aspect-ratio: 1;
  border-radius: 50%;
  left: 14%;
  top: 17%;
  background: radial-gradient(
    circle,
    #cf6427 0,
    #71331d 42%,
    rgba(73, 32, 20, 0.1) 70%
  );
  filter: blur(0.2px);
  opacity: 0.32;
}
.ridge {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 0;
  clip-path: polygon(
    0 60%,
    7% 49%,
    14% 57%,
    22% 29%,
    31% 57%,
    40% 37%,
    50% 58%,
    60% 31%,
    67% 52%,
    77% 39%,
    86% 61%,
    94% 46%,
    100% 54%,
    100% 100%,
    0 100%
  );
}
.ridge.far {
  height: 43%;
  background: #1e1c17;
}
.ridge.near {
  height: 31%;
  background: #181713;
  clip-path: polygon(
    0 54%,
    8% 43%,
    17% 60%,
    27% 49%,
    37% 70%,
    47% 53%,
    57% 65%,
    68% 39%,
    76% 58%,
    86% 43%,
    94% 60%,
    100% 47%,
    100% 100%,
    0 100%
  );
}
.hero-tank {
  position: absolute;
  left: 37%;
  bottom: 25%;
  width: 82px;
  height: 25px;
  background: #4b4332;
  border-radius: 10px 13px 5px 5px;
  transform: skewX(-4deg);
}
.hero-tank:before {
  content: "";
  position: absolute;
  width: 48px;
  height: 16px;
  background: #4b4332;
  border-radius: 50% 50% 0 0;
  top: -10px;
  left: 17px;
}
.hero-tank:after {
  content: "";
  position: absolute;
  width: 55px;
  height: 5px;
  background: #4b4332;
  left: 45px;
  top: -9px;
  transform: rotate(-28deg);
  transform-origin: left;
}
.hero-tank i {
  position: absolute;
  inset: 18px 4px -6px;
  background: repeating-radial-gradient(
    circle at 8px 50%,
    #111 0 4px,
    #665d48 5px 7px
  );
  border-radius: 6px;
}
.lobby-screen {
  padding: 50px clamp(22px, 6vw, 92px);
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 32px;
}
.section-heading h1 {
  font-size: clamp(46px, 6vw, 78px);
}
.room-code {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font: 500 12px var(--mono);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.room-code button {
  background: #191814;
  border: 1px dashed #665d4d;
  padding: 10px 15px;
  min-width: 120px;
}
.room-code b {
  display: block;
  color: var(--amber2);
  font: 600 25px var(--mono);
  letter-spacing: 5px;
}
.room-code small {
  color: #827b6e;
}
.lobby-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(430px, 1.3fr);
  gap: 18px;
}
.roster-panel,
.setup-panel,
.roster-card,
.chat-card {
  padding: 22px;
}
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #39362e;
  padding-bottom: 15px;
  margin-bottom: 10px;
}
.panel-title h2 {
  margin: 0;
  font: 700 20px var(--display);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.panel-title > span {
  font: 500 12px var(--mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.roster-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 10px 6px;
  border-bottom: 1px solid #302e27;
  min-height: 57px;
}
.tank-avatar {
  width: 31px;
  height: 20px;
  position: relative;
  filter: drop-shadow(0 2px 2px #000);
}
.tank-avatar:before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 0;
  height: 10px;
  background: var(--tank, #aaa);
  clip-path: polygon(9% 0, 91% 0, 100% 78%, 87% 100%, 13% 100%, 0 78%);
}
.tank-avatar:after {
  content: "";
  position: absolute;
  width: 17px;
  height: 8px;
  left: 7px;
  top: 2px;
  border-radius: 7px 7px 0 0;
  background: var(--tank, #aaa);
  box-shadow: 7px -3px 0 -3px var(--tank, #aaa);
}
.roster-info b {
  display: block;
  font-size: 13px;
}
.roster-info small {
  color: #777166;
  font: 500 12px var(--mono);
  text-transform: uppercase;
}
.crown {
  color: var(--amber);
  font-size: 13px;
  margin-left: 6px;
}
.promote-button {
  background: #28261f;
  border: 1px solid #464138;
  font: 500 12px var(--mono);
  text-transform: uppercase;
  padding: 7px 9px;
}
.promote-button:hover {
  border-color: var(--amber);
}
.quiet {
  font-size: 12px;
  color: #736d63;
  line-height: 1.5;
  margin: 18px 5px 0;
}
.options-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 17px 14px;
  padding-top: 12px;
}
.option-field label {
  display: block;
  color: #9b9588;
  font: 500 12px var(--mono);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.option-field select,
.option-field input {
  width: 100%;
  min-height: 42px;
  font: 500 12px var(--mono);
}
.option-field input[type="number"] {
  padding-right: 2px;
}
.option-field.disabled {
  opacity: 0.45;
}
.lobby-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-top: 25px;
}
.lobby-footer .danger-text {
  justify-self: start;
  color: #b97767;
}
.lobby-footer p {
  font: 500 12px var(--mono);
  color: #918b80;
  text-transform: uppercase;
}
.launch {
  justify-self: end;
  min-width: 210px;
}
.launch span {
  margin-left: 17px;
}
.game-screen {
  padding: 20px clamp(12px, 2.5vw, 42px) 28px;
  max-width: 1600px;
  margin: auto;
}
.battle-head {
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 54px;
  align-items: center;
  gap: 22px;
}
.battle-head .eyebrow {
  margin: 0 0 2px;
}
.battle-head h1 {
  font: 700 24px var(--display);
  margin: 0;
  text-transform: uppercase;
}
.wind-box {
  display: flex;
  align-items: center;
  gap: 13px;
  border-right: 1px solid var(--line);
  padding-right: 24px;
}
.wind-box > span {
  font: 500 12px var(--mono);
  color: var(--muted);
  text-transform: uppercase;
}
.wind-box div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wind-box i {
  font-style: normal;
  color: var(--amber);
  font-size: 21px;
}
.wind-box b {
  font: 600 13px var(--mono);
}
.timer {
  width: 48px;
  height: 48px;
  position: relative;
  display: grid;
  place-items: center;
}
.timer svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}
.timer circle {
  fill: none;
  stroke: #3b372e;
  stroke-width: 2;
}
.timer circle + circle {
  stroke: var(--amber);
  stroke-dasharray: 107;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.4s;
}
.timer b {
  font: 600 12px var(--mono);
}
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 16px;
}
.arena-column {
  min-width: 0;
}
.canvas-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #090a09;
  overflow: hidden;
  border: 1px solid #4b4538;
  box-shadow: 0 17px 50px #0008;
}
.canvas-shell canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: auto;
  touch-action: none;
}
.canvas-message {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0c0b08a6;
  text-transform: uppercase;
  text-align: center;
}
.canvas-message strong {
  font: 800 clamp(42px, 8vw, 90px) / 1 var(--display);
  color: var(--amber2);
  letter-spacing: 2px;
  text-shadow: 0 4px #000;
}
.canvas-message span {
  font: 500 12px var(--mono);
  letter-spacing: 2px;
  margin-top: 8px;
}
.control-deck {
  margin-top: 12px;
  min-height: 88px;
  display: grid;
  grid-template-columns: 160px minmax(180px, 1fr) minmax(150px, 0.65fr) 130px;
  align-items: center;
  padding: 12px;
  gap: 10px;
}
.control-group {
  display: grid;
  grid-template-columns: 37px 1fr 37px;
  align-items: end;
  gap: 6px;
}
.control-group .control-label {
  grid-column: 1/-1;
  margin: 0;
}
.control-group button,
.mobile-move button {
  height: 38px;
  border: 1px solid #4a453a;
  background: #181713;
  border-radius: 2px;
  font-size: 18px;
}
.control-group button:hover {
  border-color: var(--amber);
}
.control-group output {
  height: 38px;
  background: #12120f;
  display: grid;
  place-items: center;
  border: 1px solid #39362e;
  font: 600 16px var(--mono);
  color: var(--amber2);
}
.power-control div {
  position: relative;
}
.power-control output {
  display: block;
  text-align: center;
  padding-top: 3px;
  border: 0;
  height: 19px;
  background: none;
}
.power-control input {
  padding: 0;
  width: 100%;
  min-height: 18px;
  height: 18px;
  accent-color: var(--amber);
  display: block;
}
.weapon-control select {
  width: 100%;
  height: 43px;
  min-height: 43px;
  font: 500 12px var(--mono);
  padding-right: 5px;
}
.fire-button {
  height: 59px;
  border: 1px solid #ffbb41;
  background: linear-gradient(#f8b537, #da8317);
  color: #211608;
  border-radius: 3px;
  font: 800 20px var(--display);
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow: inset 0 0 0 2px #ffe19c44;
}
.fire-button:hover {
  filter: brightness(1.12);
}
.fire-button:disabled {
  filter: grayscale(1);
  opacity: 0.35;
  cursor: not-allowed;
}
.fire-button kbd {
  display: block;
  font: 500 12px var(--mono);
  letter-spacing: 1px;
}
.mobile-move {
  display: none;
}
.sidebar {
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto;
  gap: 12px;
  min-height: 0;
}
.roster-card,
.chat-card {
  box-shadow: none;
}
.score-head,
.game-player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px 45px;
  gap: 7px;
  align-items: center;
}
.score-head {
  font: 500 12px var(--mono);
  color: #6e695f;
  text-transform: uppercase;
  padding: 0 3px 5px;
}
.game-player {
  position: relative;
  padding: 9px 3px;
  border-top: 1px solid #343129;
  font-size: 12px;
}
.game-player.turn {
  background: linear-gradient(90deg, #f3a62917, transparent);
}
.game-player.turn:before {
  content: "";
  position: absolute;
  left: -22px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--amber);
}
.game-player.dead {
  opacity: 0.35;
}
.game-player-name {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}
.game-player-name .tank-avatar {
  transform: scale(0.72);
  margin-left: -4px;
  flex: 0 0 26px;
}
.game-player-name b {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hp {
  height: 5px;
  background: #3a342c;
}
.hp i {
  display: block;
  height: 100%;
  background: var(--green);
}
.game-player output {
  font: 600 12px var(--mono);
  text-align: right;
}
.chat-card {
  display: flex;
  flex-direction: column;
  min-height: 180px;
}
.chat-log {
  flex: 1;
  overflow: auto;
  min-height: 80px;
  max-height: 240px;
  padding-right: 3px;
}
.chat-empty {
  color: #676158;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  margin-top: 28px;
}
.chat-message {
  font-size: 12px;
  line-height: 1.45;
  margin: 8px 0;
  word-break: break-word;
}
.chat-message b {
  margin-right: 5px;
}
.chat-card form {
  display: grid;
  grid-template-columns: 1fr 37px;
  gap: 5px;
  margin-top: 10px;
}
.chat-card input {
  min-height: 36px;
  height: 36px;
  font-size: 12px;
  padding: 0 9px;
}
.chat-card form button {
  border: 0;
  background: var(--amber);
  color: #19140a;
  font-size: 18px;
}
.side-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.side-actions button {
  background: #1d1c18;
  border: 1px solid #39362e;
  min-height: 51px;
  font-size: 17px;
}
.side-actions button span {
  display: block;
  color: #8f897e;
  font: 500 12px var(--mono);
  text-transform: uppercase;
  margin-top: 3px;
}
.side-actions button:hover {
  border-color: #756b59;
}
.modal {
  width: min(940px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  background: #191814;
  color: var(--ink);
  border: 1px solid #544e41;
  border-radius: 4px;
  padding: 0;
  box-shadow: 0 30px 100px #000c;
}
.modal::backdrop {
  background: #070706c7;
  backdrop-filter: blur(5px);
}
.modal-head {
  display: flex;
  align-items: center;
  padding: 24px 27px;
  border-bottom: 1px solid #3c382f;
}
.modal-head .eyebrow {
  margin: 0 0 4px;
}
.modal-head h2 {
  font: 800 36px/1 var(--display);
  text-transform: uppercase;
  margin: 0;
}
.close-button {
  margin-left: auto;
  border: 1px solid #454036;
  width: 37px;
  height: 37px;
  background: #201e19;
  font-size: 22px;
}
.cash {
  margin-left: auto;
  text-align: right;
  padding-right: 24px;
}
.cash span {
  display: block;
  color: var(--muted);
  font: 500 12px var(--mono);
  text-transform: uppercase;
}
.cash b {
  font: 700 22px var(--mono);
  color: var(--amber2);
}
.shop-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 27px;
  border-bottom: 1px solid #302e27;
}
.shop-tabs {
  display: flex;
  gap: 4px;
  overflow: auto;
}
.shop-tabs button {
  border: 0;
  border-radius: 2px;
  background: none;
  padding: 8px 12px;
  color: #888276;
  font: 500 12px var(--mono);
  text-transform: uppercase;
}
.shop-tabs button.active {
  background: #3a3326;
  color: var(--amber2);
}
.shop-tools label {
  font: 500 12px var(--mono);
  color: var(--muted);
  text-transform: uppercase;
}
.shop-tools select {
  min-height: 34px;
  height: 34px;
  font-size: 12px;
  margin-left: 5px;
}
.shop-list {
  padding: 8px 27px;
  max-height: 460px;
  overflow: auto;
}
.shop-item {
  display: grid;
  grid-template-columns: 38px minmax(150px, 1fr) minmax(100px, 1.8fr) 75px 112px;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  border-bottom: 1px solid #302d26;
}
.item-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: #2d2920;
  border: 1px solid #403b31;
  color: var(--amber);
  font: 700 14px var(--mono);
  border-radius: 50%;
}
.item-name b {
  display: block;
  font: 600 12px var(--mono);
}
.item-name small,
.shop-description {
  color: #7d776d;
  font-size: 12px;
}
.shop-price {
  text-align: right;
  font: 600 12px var(--mono);
  color: var(--amber2);
}
.shop-actions {
  display: flex;
}
.shop-actions button {
  width: 38px;
  height: 31px;
  border: 1px solid #494438;
  background: #24221c;
}
.shop-actions output {
  display: grid;
  place-items: center;
  width: 35px;
  font: 600 12px var(--mono);
}
.shop-actions button:disabled {
  opacity: 0.3;
}
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 27px;
  border-top: 1px solid #3c382f;
}
.modal-foot p {
  font: 500 12px var(--mono);
  color: var(--muted);
  text-transform: uppercase;
}
.compact-modal {
  width: min(500px, calc(100vw - 28px));
}
.compact-modal .lobby-roster {
  padding: 10px 24px 22px;
}
.danger-button {
  border: 1px solid #7c493e;
  background: #3a211c;
  color: #e8a596;
  min-height: 47px;
  margin: 0 24px 24px;
  width: calc(100% - 48px);
  text-transform: uppercase;
  font: 600 12px var(--mono);
}
.toggle-row,
.volume-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 26px;
  border-bottom: 1px solid #37332b;
}
.toggle-row b {
  display: block;
  font-size: 13px;
}
.toggle-row small {
  color: var(--muted);
  font-size: 12px;
}
.toggle-row input {
  width: 42px;
  min-height: 24px;
}
.volume-row {
  font: 500 12px var(--mono);
  text-transform: uppercase;
}
.volume-row input {
  width: 65%;
  padding: 0;
  accent-color: var(--amber);
}
.shortcut-help {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 22px 26px;
  gap: 13px;
  font: 500 12px var(--mono);
  color: #aaa398;
}
.shortcut-help > b {
  grid-column: 1/-1;
  color: var(--ink);
  text-transform: uppercase;
}
.shortcut-help kbd {
  padding: 3px 6px;
  border: 1px solid #4a453a;
  border-bottom-width: 2px;
  margin-right: 3px;
}
.toast-stack {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: #29261f;
  border-left: 3px solid var(--amber);
  box-shadow: 0 10px 35px #0008;
  padding: 12px 16px;
  max-width: 330px;
  font-size: 12px;
  animation: toastIn 0.25s ease-out;
}
.toast.error {
  border-color: var(--red);
}
@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.join-row > * {
  min-width: 0;
}
.canvas-message button {
  margin-top: 22px;
}
.game-player,
.chat-message {
  font-size: 12px;
}
.score-head,
.panel-title > span {
  font-size: 12px;
}
.side-actions button span {
  font-size: 12px;
}
.control-deck {
  grid-template-columns: 145px minmax(170px, 1fr) minmax(
      140px,
      0.65fr
    ) 84px 120px;
}
.mobile-move {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  align-self: end;
}
.mobile-move .control-label {
  grid-column: 1/-1;
  margin-bottom: 0;
}
.mobile-move .control-label b {
  color: var(--amber2);
}
@media (min-width: 951px) {
  .game-layout {
    grid-template-columns: minmax(
        0,
        min(100%, calc((100dvh - 296px) * 4 / 3))
      ) 296px;
    justify-content: center;
  }
  .canvas-shell,
  .control-deck {
    width: 100%;
  }
  .game-player {
    font-size: 13px;
  }
  .chat-message,
  .chat-card input {
    font-size: 12px;
  }
  .score-head {
    font-size: 12px;
  }
  .side-actions button span {
    font-size: 12px;
  }
}
@media (min-width: 951px) and (max-height: 800px) {
  .control-deck {
    grid-template-columns: 112px minmax(112px, 1fr) minmax(
        106px,
        0.8fr
      ) 72px 68px;
    padding: 8px;
    gap: 6px;
  }
  .control-group {
    grid-template-columns: 32px 1fr 32px;
  }
  .fire-button {
    font-size: 17px;
    padding: 0;
  }
  .weapon-control select {
    font-size: 12px;
    padding-left: 7px;
  }
  .mobile-move button {
    padding: 0;
  }
  .roster-card,
  .chat-card {
    padding: 17px;
  }
  .game-layout {
    gap: 12px;
  }
}
@media (max-width: 950px) {
  .home-screen.active {
    grid-template-columns: 1fr;
    padding-top: 50px;
  }
  .home-copy {
    text-align: center;
    margin: auto;
  }
  .lede {
    margin: 24px auto;
  }
  .feature-line {
    justify-content: center;
  }
  .entry-card {
    width: min(430px, 100%);
    margin: auto;
  }
  .hero-tank {
    display: none;
  }
  .lobby-grid {
    grid-template-columns: 1fr;
  }
  .game-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .side-actions {
    grid-column: 1/-1;
  }
  .chat-log {
    max-height: 180px;
  }
  .control-deck {
    grid-template-columns: 140px 1fr 160px 115px;
  }
  .game-screen {
    padding-top: 8px;
  }
  .battle-head {
    height: 56px;
  }
}
@media (max-width: 650px) {
  .topbar {
    height: 60px;
    padding: 0 14px;
  }
  .connection span {
    display: none;
  }
  .screen {
    min-height: calc(100vh - 60px);
  }
  .home-screen.active {
    padding: 38px 18px;
    display: block;
  }
  .home-copy h1 {
    font-size: 59px;
  }
  .feature-line {
    display: none;
  }
  .entry-card {
    margin-top: 35px;
    padding: 24px;
  }
  .section-heading {
    align-items: start;
  }
  .section-heading h1 {
    font-size: 48px;
  }
  .room-code {
    display: block;
    text-align: right;
  }
  .room-code > span {
    display: block;
    margin-bottom: 5px;
  }
  .lobby-screen {
    padding: 32px 14px;
  }
  .options-grid {
    grid-template-columns: 1fr 1fr;
  }
  .lobby-footer {
    grid-template-columns: 1fr 1fr;
  }
  .lobby-footer p {
    display: none;
  }
  .launch {
    min-width: 150px;
  }
  .battle-head {
    grid-template-columns: 1fr auto 46px;
  }
  .battle-head h1 {
    font-size: 18px;
  }
  .wind-box {
    gap: 5px;
    padding-right: 10px;
  }
  .game-screen {
    padding: 5px 7px 12px;
  }
  .game-layout {
    gap: 8px;
  }
  .canvas-shell {
    border-left: 0;
    border-right: 0;
    width: calc(100% + 14px);
    margin-left: -7px;
  }
  .control-deck {
    margin-top: 7px;
    grid-template-columns: 1fr 1.25fr 1fr;
    gap: 6px;
    padding: 8px;
  }
  .weapon-control {
    grid-column: 1/3;
  }
  .fire-button {
    grid-column: 3;
    height: 57px;
  }
  .mobile-move {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    grid-column: 1/-1;
  }
  .control-group {
    grid-template-columns: 34px 1fr 34px;
  }
  .sidebar {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }
  .roster-card {
    order: 1;
  }
  .chat-card {
    order: 3;
  }
  .side-actions {
    order: 2;
  }
  .chat-card {
    display: none;
  }
  .shop-item {
    grid-template-columns: 34px 1fr 65px 105px;
  }
  .shop-description {
    display: none;
  }
  .shop-list,
  .shop-tools {
    padding-left: 13px;
    padding-right: 13px;
  }
  .modal-head,
  .modal-foot {
    padding-left: 17px;
    padding-right: 17px;
  }
  .shop-tabs button {
    padding: 7px;
  }
  .modal-foot p {
    display: none;
  }
}
@media (orientation: landscape) and (max-height: 620px) {
  .topbar {
    height: 48px;
  }
  .screen {
    min-height: calc(100vh - 48px);
  }
  .game-screen {
    padding-top: 2px;
  }
  .battle-head {
    height: 45px;
  }
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
  }
  .canvas-shell {
    height: calc(100vh - 166px);
    width: auto;
    aspect-ratio: 4/3;
    margin: auto;
  }
  .control-deck {
    height: 65px;
    min-height: 65px;
  }
  .chat-card {
    display: none;
  }
  .sidebar {
    grid-template-rows: 1fr auto;
  }
  .home-screen.active {
    padding-top: 25px;
  }
  .home-copy h1 {
    font-size: 56px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
.result-actions {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}
.canvas-message .result-actions button {
  margin-top: 0;
}
.game-active .grain {
  display: none;
}
.battle-meta {
  display: flex;
  align-items: center;
  gap: 9px;
}
.battle-meta .eyebrow {
  margin: 0;
}
.compact-code {
  display: none;
  border: 1px dashed #665e4e;
  background: #1a1814;
  color: #8e887c;
  padding: 3px 6px;
  font: 500 12px var(--mono);
  text-transform: uppercase;
}
.compact-code b {
  color: var(--amber2);
  letter-spacing: 2px;
}
.sidebar {
  grid-template-rows: auto auto minmax(150px, 1fr) auto;
}
.game-code {
  min-height: 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  text-align: left;
  padding: 8px 13px;
  border: 1px dashed #5c5444;
  background: #1b1915;
  color: var(--muted);
  font: 500 12px var(--mono);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.game-code span {
  grid-column: 1;
}
.game-code b {
  grid-row: 1/3;
  grid-column: 2;
  color: var(--amber2);
  font-size: 21px;
  letter-spacing: 4px;
}
.game-code small {
  font-size: 12px;
  color: #777166;
}
.game-code:hover,
.game-code:focus-visible {
  border-color: var(--amber);
}
.type-badge {
  margin-left: auto;
  color: #777166;
  font: 500 12px var(--mono);
  text-transform: uppercase;
}
.gamepad-help {
  position: fixed;
  z-index: 30;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 10px;
  background: #090907e8;
  border: 1px solid #4b4436;
  color: #bdb4a4;
  font: 500 12px var(--mono);
  text-transform: uppercase;
  white-space: nowrap;
}
.control-deck {
  position: relative;
}
.shot-extras {
  position: absolute;
  right: 0;
  bottom: calc(100% + 7px);
  z-index: 5;
  display: flex;
  gap: 8px;
  padding: 8px;
  background: #171611ed;
  border: 1px solid #554d3e;
  box-shadow: 0 8px 24px #0008;
}
.shot-extras label {
  display: grid;
  gap: 4px;
  color: #aaa396;
  font: 500 12px var(--mono);
  text-transform: uppercase;
}
.shot-extras select,
.shot-extras input {
  height: 36px;
  min-height: 36px;
  font-size: 12px;
}
.shot-extras select {
  width: 150px;
}
.shot-extras input {
  width: 70px;
}
@media (max-width: 650px) {
  .chat-card {
    display: flex;
    max-height: 230px;
  }
}
@media (max-width: 950px) {
  .compact-code {
    display: inline-block;
  }
}
@media (orientation: landscape) and (max-height: 620px) {
  .chat-card {
    display: flex;
    max-height: 160px;
  }
  .sidebar {
    grid-template-rows: minmax(130px, 1fr) minmax(120px, 0.7fr) auto;
  }
}
@media (pointer: coarse) {
  button,
  input,
  select {
    min-height: 44px;
  }
  .control-group button,
  .mobile-move button {
    height: 44px;
  }
  .side-actions button {
    min-height: 56px;
  }
}

/* The quartermaster deliberately keeps the original DOS/Win3 buying-screen palette. */
.shop-modal {
  background: #b9b9b9;
  color: #080808;
  border: 2px outset #ededed;
  border-radius: 0;
  box-shadow: 8px 10px 0 #0008;
  font-family: var(--mono);
}
.shop-modal .modal-head {
  padding: 13px 18px;
  background: #c6c6c6;
  border-bottom: 2px groove #f3f3f3;
}
.shop-modal .eyebrow {
  color: #000080;
  font-size: 12px;
  margin-bottom: 3px;
}
.shop-modal .modal-head h2 {
  font: 700 24px/1 var(--mono);
  letter-spacing: -2px;
  color: #080808;
}
.shop-modal .cash span,
.shop-modal .cash b {
  color: #080808;
}
.shop-modal .cash b {
  font-size: 16px;
}
.shop-modal .close-button,
.shop-modal .shop-actions button {
  background: #c8c8c8;
  color: #000;
  border: 2px outset #f5f5f5;
  border-radius: 0;
  box-shadow: 1px 1px #222;
}
.shop-modal .close-button:active,
.shop-modal .shop-actions button:active {
  border-style: inset;
}
.shop-modal .shop-tools {
  padding: 8px 18px;
  border-bottom: 1px solid #767676;
  background: #adadad;
}
.shop-modal .shop-tabs button {
  color: #111;
  border: 1px solid transparent;
}
.shop-modal .shop-tabs button.active {
  background: #000080;
  color: #fff;
  border-color: #00ffff;
}
.shop-modal .shop-tools label {
  color: #111;
}
.shop-modal select {
  background: #dedede;
  color: #000;
  border: 2px inset #eee;
}
.shop-modal .shop-list {
  padding: 5px 18px;
  background: #b9b9b9;
}
.shop-modal .shop-item {
  min-height: 52px;
  border-bottom: 1px solid #898989;
}
.shop-modal .item-icon {
  background: #c9c9c9;
  color: #000080;
  border: 1px solid #777;
  border-radius: 0;
}
.shop-modal .item-name b {
  color: #000;
}
.shop-modal .item-name small,
.shop-modal .shop-description {
  color: #343434;
}
.shop-modal .shop-price {
  color: #000080;
}
.shop-modal .shop-actions output {
  color: #000;
}
.shop-modal .shop-actions button:disabled {
  color: #777;
  opacity: 1;
}
.shop-modal .modal-foot {
  padding: 11px 18px;
  background: #c6c6c6;
  border-top: 2px groove #eee;
}
.shop-modal .modal-foot p {
  color: #262626;
}
.shop-modal .primary-button {
  background: #c8c8c8;
  color: #000;
  border: 2px outset #fff;
  border-radius: 0;
  box-shadow: 1px 1px #222;
}
.shop-modal .primary-button:focus-visible {
  outline: 2px solid #00ffff;
  outline-offset: -5px;
}
.shop-modal .primary-button:active {
  border-style: inset;
}
.shop-room-code {
  margin-left: auto;
  margin-right: 22px;
  padding: 6px 10px;
  background: #bdbdbd;
  color: #111;
  border: 2px outset #eee;
  font: 500 12px var(--mono);
  text-transform: uppercase;
}
.shop-room-code b {
  color: #000080;
  font-size: 16px;
  letter-spacing: 3px;
  margin-left: 5px;
}
.compact-code {
  min-height: 0 !important;
}
.sidebar {
  grid-template-rows: auto minmax(145px, 1fr) minmax(145px, 0.8fr) auto;
}
.roster-card {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.game-roster {
  min-height: 0;
  overflow: auto;
  flex: 1;
  scrollbar-color: #756a54 #211f1a;
}
@media (min-width: 951px) {
  .sidebar {
    height: calc(100dvh - 196px);
    overflow: hidden;
  }
}
@media (max-width: 950px) {
  .sidebar {
    height: auto;
    max-height: none;
    overflow: visible;
  }
}
.gamepad-help[hidden] {
  display: none;
}
.game-player-name b {
  min-width: 0;
}
.game-player-name .type-badge {
  flex: 0 0 auto;
}
@media (orientation: landscape) and (max-height: 620px) {
  .sidebar {
    grid-template-rows: auto minmax(105px, 1fr) minmax(95px, 0.7fr) auto;
  }
}
/* Keep the live radio form inside its grid row, even with a full tank roster. */
.chat-card {
  min-height: 0;
  overflow: hidden;
  padding: 16px;
}
.chat-card .panel-title {
  flex: 0 0 auto;
  margin-bottom: 6px;
  padding-bottom: 10px;
}
.chat-card .chat-log {
  min-height: 0;
  flex: 1 1 0;
}
.chat-card form {
  flex: 0 0 auto;
}
.chat-card .chat-empty {
  margin-top: 10px;
}
.chat-message,
.chat-card input {
  font-size: 14px;
}
.game-player {
  font-size: 14px;
}
.shop-modal .item-name b {
  font-size: 14px;
}
.shop-modal .item-name small,
.shop-modal .shop-description {
  font-size: 12px;
  line-height: 1.35;
}
.shop-modal .shop-item {
  min-height: 58px;
}
.shop-modal .shop-price {
  font-size: 13px;
}
.shop-modal .shop-actions output {
  font-size: 12px;
}
.weapon-control select {
  font-size: 13px;
}
.shot-extras select,
.shot-extras input {
  font-size: 13px;
}

/* Keep secondary labels readable without losing the compact game layout. */
.gamepad-help { max-width: calc(100vw - 24px); white-space: normal; text-align: center; }
.game-code small, .type-badge { color: #bdb4a4; }
