:root {
  --red: #e0574a;
  --red-dim: #8a2f27;
  --blue: #5aa2e6;
  --blue-dim: #2b5f92;
  --brass: #d8a94a;
  --brass-dark: #8a6a22;
  --parchment: #f2e3c2;
  --ink: #1a1510;
  --panel: rgba(24, 20, 16, 0.82);
  --panel-line: rgba(216, 169, 74, 0.32);
  --good: #7bc96f;
  --warn: #e8b34a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  --ui-font: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --num-font: 'SF Mono', 'JetBrains Mono', 'Fira Mono', ui-monospace, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0d0b09;
  color: var(--parchment);
  font-family: var(--ui-font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  touch-action: none;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.hidden {
  display: none !important;
}

button {
  font-family: var(--ui-font);
  font-size: 14px;
  color: var(--parchment);
  background: linear-gradient(180deg, rgba(90, 74, 52, 0.95), rgba(48, 39, 28, 0.95));
  border: 1px solid var(--panel-line);
  border-radius: 7px;
  padding: 8px 12px;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.15s ease;
  box-shadow: inset 0 1px 0 rgba(255, 232, 190, 0.14), 0 2px 6px rgba(0, 0, 0, 0.4);
}
button:hover:not(:disabled) {
  filter: brightness(1.18);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
button.primary {
  background: linear-gradient(180deg, #c8973f, #7d5a1c);
  border-color: rgba(255, 224, 160, 0.5);
  color: #241a08;
  font-weight: 700;
  letter-spacing: 0.02em;
}
button.ghost {
  background: rgba(40, 33, 25, 0.7);
}
button.small {
  padding: 3px 8px;
  font-size: 12px;
}

input[type='text'],
input:not([type]),
input[type='range'] {
  font-family: var(--ui-font);
}
input:not([type='range']) {
  background: rgba(12, 10, 8, 0.8);
  border: 1px solid var(--panel-line);
  border-radius: 6px;
  color: var(--parchment);
  padding: 9px 11px;
  font-size: 15px;
  width: 100%;
}
input:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 2px rgba(216, 169, 74, 0.18);
}

/* ------------------------------------------------------------------ HUD */

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#hud > * {
  pointer-events: auto;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(10, 8, 6, 0.78), rgba(10, 8, 6, 0));
}

.team {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.team-1 {
  align-items: flex-end;
  text-align: right;
}
.team-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}
.team .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
  background: currentColor;
}
.team-0 {
  color: var(--red);
}
.team-1 {
  color: var(--blue);
}
.team-meta {
  font-size: 12px;
  color: rgba(242, 227, 194, 0.68);
  font-family: var(--num-font);
}
.king-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--num-font);
  font-size: 12px;
  color: rgba(242, 227, 194, 0.9);
}
.king-bar i {
  display: block;
  width: 148px;
  max-width: 32vw;
  height: 9px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(216, 169, 74, 0.35);
  position: relative;
  overflow: hidden;
}
.king-bar i::after {
  content: '';
  position: absolute;
  inset: 1px;
  width: var(--pct, 100%);
  background: linear-gradient(90deg, currentColor, rgba(255, 255, 255, 0.85));
  border-radius: 4px;
  transition: width 0.45s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.team-1 .king-bar i::after {
  right: 1px;
  left: auto;
}
.king-bar.hurt i::after {
  animation: flash 0.45s ease 2;
}
@keyframes flash {
  50% {
    filter: brightness(2.4);
  }
}

.centre {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 220px;
}
.turn-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  padding: 5px 16px;
  box-shadow: var(--shadow);
}
#turn-label {
  font-size: 15px;
  font-weight: 600;
}
#turn-clock {
  font-family: var(--num-font);
  font-size: 13px;
  color: rgba(242, 227, 194, 0.7);
}
#turn-clock.urgent {
  color: var(--red);
  animation: pulse 1s infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

.wind {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(242, 227, 194, 0.6);
}
.wind-gauge {
  position: relative;
  width: 92px;
  height: 6px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--panel-line);
  border-radius: 3px;
}
.wind-gauge::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -3px;
  bottom: -3px;
  width: 1px;
  background: rgba(242, 227, 194, 0.45);
}
#wind-needle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  background: var(--brass);
  border-radius: 3px;
  transition: all 0.5s ease;
}
#wind-value {
  font-family: var(--num-font);
  min-width: 52px;
}
.shots {
  display: flex;
  gap: 5px;
}
.shots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--brass-dark);
  background: rgba(0, 0, 0, 0.4);
}
.shots span.live {
  background: var(--brass);
  box-shadow: 0 0 8px rgba(216, 169, 74, 0.8);
}

/* ------------------------------------------------------- bottom panels */

.controls {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(280px, 1.35fr) minmax(180px, 1fr);
  gap: 10px;
  align-items: end;
  padding: 10px 12px 12px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  padding: 9px 11px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(7px);
}
.panel h4 {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(242, 227, 194, 0.5);
  font-weight: 600;
}

#gun-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 25vh;
  overflow-y: auto;
}
.gun {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(60, 48, 34, 0.5);
  cursor: pointer;
  font-size: 13px;
}
.gun:hover {
  background: rgba(84, 68, 46, 0.6);
}
.gun.active {
  border-color: var(--brass);
  background: rgba(112, 88, 44, 0.55);
}
.gun.spent {
  opacity: 0.42;
}
.gun .hp {
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.gun .hp i {
  display: block;
  height: 100%;
  background: var(--good);
}
.gun .tag {
  font-family: var(--num-font);
  font-size: 10px;
  color: rgba(242, 227, 194, 0.55);
}

.aiming {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}
.dials {
  display: grid;
  gap: 8px;
}
.dial label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(242, 227, 194, 0.5);
}
.dial-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--num-font);
  font-size: 17px;
}
.dial-value span {
  min-width: 66px;
  text-align: center;
  color: #ffe6ad;
  text-shadow: 0 0 12px rgba(216, 169, 74, 0.35);
}
.dial-value button {
  width: 26px;
  height: 24px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
}
input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 16px;
  background: transparent;
  cursor: pointer;
}
input[type='range']::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brass-dark), rgba(216, 169, 74, 0.25));
  border: 1px solid rgba(0, 0, 0, 0.5);
}
input[type='range']::-moz-range-track {
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brass-dark), rgba(216, 169, 74, 0.25));
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe6ad, #b58a34);
  border: 1px solid #5c440f;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
input[type='range']::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe6ad, #b58a34);
  border: 1px solid #5c440f;
}
.power-meter {
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.5);
  overflow: hidden;
  margin-top: 2px;
}
#power-fill {
  display: block;
  height: 100%;
  width: 60%;
  background: linear-gradient(90deg, #6fbf6f, #d8a94a 55%, #e0574a);
  transition: width 0.1s linear;
}

button.fire {
  height: 74px;
  width: 96px;
  border-radius: 14px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(180deg, #d8503f, #7a2018);
  border-color: rgba(255, 180, 150, 0.45);
  color: #fff2e0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
button.fire small {
  font-size: 9px;
  letter-spacing: 0.2em;
  opacity: 0.65;
  font-weight: 400;
}
button.fire:disabled {
  background: linear-gradient(180deg, #4a423a, #2a251f);
}

#ammo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 7px;
}
.ammo-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(60, 48, 34, 0.55);
  font-size: 12px;
  cursor: pointer;
}
.ammo-chip.active {
  border-color: var(--brass);
  background: rgba(112, 88, 44, 0.6);
}
.ammo-chip.empty {
  opacity: 0.38;
}
.ammo-chip b {
  font-family: var(--num-font);
  font-size: 11px;
  color: rgba(242, 227, 194, 0.7);
}
.row {
  display: flex;
  gap: 6px;
}
.row button {
  flex: 1;
}
.centre-row {
  justify-content: center;
}

/* ------------------------------------------------------------- tools */

.side-tools {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tool {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  padding: 0;
  font-size: 16px;
}
.tool.off {
  opacity: 0.4;
}

#toasts {
  position: absolute;
  top: 92px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.toast {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-left: 3px solid var(--brass);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: toast-in 0.25s ease;
}
.toast.good {
  border-left-color: var(--good);
}
.toast.warn {
  border-left-color: var(--warn);
}
.toast.leaving {
  animation: toast-out 0.4s ease forwards;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

#banner {
  position: absolute;
  top: 34%;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
}
#banner span {
  display: inline-block;
  font-size: clamp(28px, 6vw, 62px);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffe6ad;
  text-shadow: 0 4px 26px rgba(0, 0, 0, 0.9), 0 0 40px rgba(216, 169, 74, 0.5);
  animation: banner 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes banner {
  from {
    opacity: 0;
    transform: scale(0.7) translateY(20px);
  }
}

#emote-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.emote-pop {
  position: absolute;
  font-size: 44px;
  animation: emote 1.9s ease-out forwards;
}
@keyframes emote {
  0% {
    opacity: 0;
    transform: scale(0.4) translateY(0);
  }
  18% {
    opacity: 1;
    transform: scale(1.15) translateY(-10px);
  }
  100% {
    opacity: 0;
    transform: scale(1) translateY(-70px);
  }
}
#emote-picker {
  position: absolute;
  right: 58px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-wrap: wrap;
  width: 168px;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  padding: 6px;
}
#emote-picker button {
  width: 36px;
  height: 34px;
  padding: 0;
  font-size: 18px;
}

#chat {
  position: absolute;
  left: 12px;
  bottom: 150px;
  width: min(320px, 42vw);
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  padding: 8px;
  box-shadow: var(--shadow);
}
#chat-log {
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 6px;
  font-size: 13px;
}
#chat-log .who {
  font-weight: 700;
}
#chat-log .s0 .who {
  color: var(--red);
}
#chat-log .s1 .who {
  color: var(--blue);
}

#placing {
  position: absolute;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--brass);
  border-radius: 999px;
  padding: 7px 10px 7px 16px;
  box-shadow: var(--shadow);
  z-index: 40;
}

#connection {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 5px;
  background: rgba(140, 40, 30, 0.92);
  font-size: 13px;
  z-index: 100;
}

/* ------------------------------------------------------------ modals */

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(ellipse at center, rgba(10, 8, 6, 0.75), rgba(6, 5, 4, 0.94));
  z-index: 50;
  overflow-y: auto;
}
.modal-card {
  position: relative;
  width: min(440px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(170deg, rgba(38, 31, 23, 0.98), rgba(20, 16, 12, 0.99));
  border: 1px solid var(--panel-line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 226, 180, 0.1);
  text-align: center;
}
.modal-card.wide {
  width: min(720px, 100%);
  text-align: left;
}
.modal-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.modal-card h1 {
  margin: 4px 0 2px;
  font-size: 44px;
  letter-spacing: 0.14em;
  color: var(--brass);
  text-shadow: 0 3px 20px rgba(216, 169, 74, 0.3);
}
.modal-card h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.05em;
}
.crest {
  font-size: 40px;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.6));
}
.tagline {
  margin: 0 0 16px;
  color: rgba(242, 227, 194, 0.62);
  font-size: 14px;
  font-style: italic;
}
.close {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
}
.field {
  display: block;
  text-align: left;
  margin-bottom: 14px;
}
.field span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(242, 227, 194, 0.5);
  margin-bottom: 5px;
}
.menu-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.menu-grid button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 11px 14px;
  font-size: 16px;
}
.menu-grid small {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.72;
  letter-spacing: 0.02em;
}
.difficulty {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 12px;
  color: rgba(242, 227, 194, 0.55);
}
.difficulty button {
  padding: 5px 10px;
  font-size: 12px;
}
.difficulty button.active {
  border-color: var(--brass);
  background: rgba(112, 88, 44, 0.6);
}
.join {
  display: flex;
  gap: 6px;
}
.join input {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  text-align: center;
  font-family: var(--num-font);
}
.fineprint {
  margin: 14px 0 0;
  font-size: 12px;
  color: rgba(242, 227, 194, 0.42);
}
.code-line {
  font-size: 15px;
}
.code-line b {
  font-family: var(--num-font);
  font-size: 26px;
  letter-spacing: 0.3em;
  color: var(--brass);
  margin: 0 8px;
}
#lobby-seats {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}
.seat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(60, 48, 34, 0.45);
  border: 1px solid transparent;
}
.seat.ready {
  border-color: var(--good);
}
.seat.s0 {
  border-left: 3px solid var(--red);
}
.seat.s1 {
  border-left: 3px solid var(--blue);
}
.seat .status {
  font-size: 12px;
  color: rgba(242, 227, 194, 0.55);
}

/* -------------------------------------------------------------- shop */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--panel-line);
  margin-bottom: 12px;
}
.tab {
  border: none;
  border-radius: 8px 8px 0 0;
  background: transparent;
  box-shadow: none;
  color: rgba(242, 227, 194, 0.55);
  padding: 8px 12px;
}
.tab.active {
  color: var(--brass);
  background: rgba(112, 88, 44, 0.28);
  border-bottom: 2px solid var(--brass);
}
.tab-body {
  display: grid;
  gap: 8px;
  max-height: 54vh;
  overflow-y: auto;
  padding-right: 4px;
}
.shop-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(60, 48, 34, 0.4);
  border: 1px solid rgba(216, 169, 74, 0.12);
}
.shop-item .icon {
  font-size: 22px;
  text-align: center;
}
.shop-item h5 {
  margin: 0 0 2px;
  font-size: 15px;
}
.shop-item p {
  margin: 0;
  font-size: 12px;
  color: rgba(242, 227, 194, 0.55);
  line-height: 1.35;
}
.shop-item .stat {
  font-family: var(--num-font);
  font-size: 11px;
  color: rgba(216, 169, 74, 0.75);
  margin-top: 3px;
}
.shop-item button {
  min-width: 92px;
}
.purse {
  font-family: var(--num-font);
  color: var(--brass);
  font-size: 16px;
}
.hint {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(242, 227, 194, 0.45);
}

/* ------------------------------------------------------- after action */

.scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}
.score-card {
  background: rgba(60, 48, 34, 0.35);
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  padding: 12px;
}
.score-card.win {
  border-color: var(--brass);
  box-shadow: 0 0 24px rgba(216, 169, 74, 0.2);
}
.score-card h3 {
  margin: 0 0 2px;
  font-size: 17px;
}
.score-card .total {
  font-family: var(--num-font);
  font-size: 30px;
  color: var(--brass);
  margin-bottom: 8px;
}
.score-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  padding: 2px 0;
  border-bottom: 1px dashed rgba(216, 169, 74, 0.12);
}
.score-line span:last-child {
  font-family: var(--num-font);
  color: var(--brass);
}
.score-line em {
  display: block;
  font-size: 10px;
  color: rgba(242, 227, 194, 0.4);
  font-style: normal;
}
.stats {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.stats th,
.stats td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(216, 169, 74, 0.1);
  text-align: center;
}
.stats th:first-child,
.stats td:first-child {
  text-align: left;
  color: rgba(242, 227, 194, 0.55);
}
.stats td {
  font-family: var(--num-font);
}
.stats tr.best td.win {
  color: var(--brass);
  font-weight: 700;
}
.help-list {
  text-align: left;
  padding-left: 18px;
  line-height: 1.55;
  font-size: 14px;
}
.help-list li {
  margin-bottom: 7px;
}
.help-list b {
  color: var(--brass);
}

/* ------------------------------------------------------------ compact */

@media (max-width: 900px) {
  .controls {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 5px 7px 7px;
  }
  .panel {
    padding: 6px 8px;
    border-radius: 10px;
  }
  .panel h4 {
    display: none;
  }
  .panel.guns #gun-list {
    flex-direction: row;
    overflow-x: auto;
    max-height: none;
    gap: 4px;
  }
  .gun {
    min-width: 118px;
    font-size: 12px;
    padding: 3px 7px;
    gap: 6px;
  }
  .gun .tag {
    font-size: 9px;
  }
  .aiming {
    gap: 8px;
  }
  .dials {
    gap: 4px;
  }
  .dial label {
    font-size: 9px;
    letter-spacing: 0.1em;
  }
  .dial-value {
    font-size: 15px;
    gap: 4px;
  }
  .dial-value span {
    min-width: 54px;
  }
  input[type='range'] {
    height: 22px;
  }
  button.fire {
    height: 62px;
    width: 82px;
    font-size: 17px;
  }
  .ammo-chip {
    font-size: 11px;
    padding: 3px 7px;
    gap: 4px;
  }
  #ammo-list {
    margin-bottom: 5px;
  }
  .side-tools {
    position: absolute;
    flex-direction: row;
    top: auto;
    bottom: calc(100% - 100px);
    right: 7px;
    transform: none;
    gap: 4px;
  }
  .tool {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-radius: 8px;
  }
  #toasts {
    top: 108px;
    font-size: 13px;
  }
  .toast {
    padding: 5px 11px;
    font-size: 13px;
  }
  #chat {
    bottom: 210px;
    width: min(300px, 70vw);
  }
  #emote-picker {
    right: 7px;
    top: 104px;
    transform: none;
  }
  .scores {
    grid-template-columns: 1fr;
  }
  .topbar {
    padding: 6px 8px;
    gap: 6px;
  }
  .team-name {
    font-size: 13px;
  }
  .team-meta {
    display: none;
  }
  .king-bar i {
    width: 84px;
  }
  .centre {
    min-width: 0;
  }
  .turn-line {
    padding: 3px 12px;
  }
  #turn-label {
    font-size: 13px;
  }
  .wind-gauge {
    width: 64px;
  }
  .modal-card h1 {
    font-size: 34px;
  }
  .modal-card {
    padding: 16px;
  }
  .stats th,
  .stats td {
    padding: 4px 5px;
    font-size: 12px;
  }
}

@media (max-height: 620px) {
  .panel h4 {
    display: none;
  }
  button.fire {
    height: 52px;
  }
  .controls {
    padding: 4px 6px 6px;
  }
  .panel {
    padding: 5px 8px;
  }
}
