:root {
  color-scheme: dark;
  --bg: #080a12;
  --panel: #111525;
  --panel-2: #191f34;
  --text: #f5f3e7;
  --muted: #adb8cf;
  --teal: #19e1d0;
  --amber: #ffbf3f;
  --red: #ff4466;
  --line: rgba(255, 255, 255, 0.16);
  --ad-height: 72px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(25, 225, 208, 0.18), transparent 28%),
    radial-gradient(circle at 78% 8%, rgba(255, 191, 63, 0.14), transparent 28%),
    linear-gradient(135deg, #070812 0%, #11182c 55%, #080a12 100%);
  color: var(--text);
  font-family: "Arial Black", Impact, system-ui, sans-serif;
}

body.ads-banner-reserved {
  padding-bottom: calc(var(--ad-height) + env(safe-area-inset-bottom));
}

.shell {
  width: min(1500px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 18px;
  align-items: center;
}

.ad-banner-slot {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: calc(var(--ad-height) + env(safe-area-inset-bottom));
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(10, 13, 22, 0.96), rgba(5, 7, 12, 0.98));
  display: none;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-items: stretch;
  gap: 12px;
  color: var(--muted);
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.36);
}

.ad-label {
  min-width: 42px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 4px;
  color: #d5d9e7;
  font: 800 11px/1 system-ui, sans-serif;
}

.ad-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.ad-copy strong {
  overflow: hidden;
  color: var(--teal);
  font: 900 15px/1 system-ui, sans-serif;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-copy small {
  overflow: hidden;
  color: rgba(245, 243, 231, 0.72);
  font: 700 12px/1.2 system-ui, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-cta {
  width: auto;
  min-width: 92px;
  min-height: 36px;
  margin: 0;
  padding: 0 12px;
  border-color: rgba(255, 191, 63, 0.72);
  background: linear-gradient(180deg, #ffcf56, #d8791b);
  box-shadow: 0 5px 0 #71320f;
  font-size: 12px;
}

body.ads-web-placeholder .ad-banner-slot {
  display: grid;
}

body.ads-native-banner .ad-banner-slot {
  display: grid;
  opacity: 0;
  pointer-events: none;
}

.cabinet {
  position: relative;
  aspect-ratio: 16 / 9;
  min-width: 0;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: #05070c;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.46),
    0 0 0 8px rgba(255, 255, 255, 0.04),
    inset 0 0 46px rgba(25, 225, 208, 0.12);
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.scanlines {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.035) 0,
    rgba(255, 255, 255, 0.035) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: screen;
}

.touch-controls {
  pointer-events: none;
  position: absolute;
  inset: auto 12px 12px 12px;
  display: none;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
}

.touch-pad,
.touch-actions {
  pointer-events: auto;
  display: grid;
  gap: 7px;
}

.touch-pad {
  grid-template-columns: repeat(3, 46px);
  grid-template-rows: repeat(2, 46px);
}

.touch-pad button:nth-child(1) {
  grid-column: 1;
  grid-row: 2;
}

.touch-pad button:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}

.touch-pad button:nth-child(3) {
  grid-column: 3;
  grid-row: 2;
}

.touch-pad button:nth-child(4) {
  grid-column: 2;
  grid-row: 2;
}

.touch-actions {
  grid-template-columns: repeat(2, minmax(54px, 1fr));
}

.touch-controls button {
  width: 100%;
  min-width: 46px;
  min-height: 46px;
  margin: 0;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(255, 207, 86, 0.86);
  box-shadow: 0 5px 0 rgba(113, 50, 15, 0.86);
  touch-action: none;
  user-select: none;
}

.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 18px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(26px, 2.5vw, 40px);
  line-height: 0.92;
  letter-spacing: 0;
  color: var(--teal);
  text-shadow: 3px 3px 0 #142238, 0 0 18px rgba(25, 225, 208, 0.42);
}

h2 {
  margin-top: 12px;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--amber);
}

p {
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

kbd {
  min-width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  margin: 0 4px;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom-color: rgba(0, 0, 0, 0.65);
  border-radius: 4px;
  background: #222b44;
  color: #fff;
  font: 700 12px/1 system-ui, sans-serif;
}

button {
  width: 100%;
  min-height: 42px;
  margin-top: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: linear-gradient(180deg, #ffcf56, #d8791b);
  color: #1d1010;
  font: 900 14px/1 system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 0 #71320f;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.action-grid button {
  margin-top: 0;
  min-height: 38px;
  padding: 0 8px;
  font-size: 12px;
}

button:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #71320f;
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .panel {
    grid-template-columns: 1fr;
  }

  .action-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (hover: none), (pointer: coarse) {
  .touch-controls {
    display: flex;
  }
}

@media (max-width: 560px) {
  .shell {
    padding: 10px;
    gap: 12px;
  }

  .panel {
    padding: 14px;
  }

  p {
    font-size: 13px;
  }

  .action-grid {
    grid-template-columns: 1fr;
  }

  .touch-pad {
    grid-template-columns: repeat(3, 40px);
    grid-template-rows: repeat(2, 40px);
  }

  .touch-controls button {
    min-width: 40px;
    min-height: 40px;
    font-size: 11px;
  }

  .ad-banner-slot {
    gap: 8px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .ad-copy strong {
    font-size: 13px;
  }

  .ad-copy small {
    font-size: 11px;
  }

  .ad-cta {
    min-width: 76px;
    padding: 0 8px;
  }
}
