@font-face {
  font-family: "PressStart2P";
  src: url("../font/PressStart2P.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #060817;
  --panel: #10162a;
  --panel-strong: #151f3a;
  --line: rgba(130, 168, 255, 0.32);
  --text: #f8fbff;
  --muted: #a9b6d9;
  --yellow: #ffe45e;
  --cyan: #32d4ff;
  --pink: #ff5c8a;
  --green: #69e58f;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #07091a 0%, #0b1024 52%, #060817 100%);
  background-size: 32px 32px, 32px 32px, auto;
}

button {
  font: inherit;
}

.wrapper {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.arcade-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 0 22px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-family: "PressStart2P", monospace;
  font-size: 12px;
  line-height: 1.7;
}

.arcade-hero h1 {
  margin: 0;
  color: var(--yellow);
  font-size: 64px;
  line-height: 1.08;
  letter-spacing: 0;
  text-shadow:
    0 4px 0 #b45c00,
    0 0 28px rgba(255, 228, 94, 0.35);
}

.arcade-hero .subtitle {
  max-width: 600px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.action-button,
.key-button,
.dpad-button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 14px 32px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  white-space: nowrap;
}

.action-button.primary {
  border-color: rgba(255, 228, 94, 0.58);
  color: #1c1600;
  background: linear-gradient(180deg, #fff087, var(--yellow));
  font-weight: 700;
}

.action-button:hover,
.key-button:hover,
.dpad-button:hover {
  transform: translateY(-2px);
  border-color: rgba(50, 212, 255, 0.72);
}

.action-button:active,
.key-button:active,
.dpad-button:active {
  transform: translateY(0);
}

.pause-toggle .icon {
  width: 1em;
  height: 1em;
  display: block;
  fill: currentColor;
  animation: keyframes-fill 0.35s ease;
}

.pause-toggle .icon-play {
  display: none;
}

.pause-toggle .icon-pause {
  display: block;
}

.pause-toggle.is-paused .icon-play {
  display: block;
}

.pause-toggle.is-paused .icon-pause {
  display: none;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: stretch;
}

.mod-panel,
.side-panel {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(21, 31, 58, 0.96), rgba(10, 15, 31, 0.98));
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

.mod-panel {
  overflow: hidden;
  border-radius: 8px;
}

.mod-panel .inner {
  padding: 12px;
}

.screen-top {
  display: flex;
  gap: 8px;
  padding: 4px 4px 12px;
}

.screen-top span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 12px rgba(255, 92, 138, 0.8);
}

.screen-top span:nth-child(2) {
  background: var(--yellow);
  box-shadow: 0 0 12px rgba(255, 228, 94, 0.8);
}

.screen-top span:nth-child(3) {
  background: var(--green);
  box-shadow: 0 0 12px rgba(105, 229, 143, 0.8);
}

.mod-panel .bd {
  overflow: hidden;
  border: 1px solid rgba(255, 228, 94, 0.26);
  border-radius: 8px;
  background: #000;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.04),
    0 0 34px rgba(50, 212, 255, 0.12);
}

.mod-panel canvas {
  display: block;
  width: 100%;
  max-width: 960px;
  height: auto;
  aspect-ratio: 3 / 2;
  margin: 0 auto;
  background: #000;
  outline: none;
  touch-action: none;
}

.mod-panel .info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  padding: 12px 4px 2px;
  color: var(--muted);
  text-align: center;
}

.mod-panel .info p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100%;
  padding: 20px;
  border-radius: 8px;
}

.panel-section h2 {
  margin: 0 0 10px;
  color: var(--yellow);
  font-size: 18px;
  line-height: 1.35;
}

.panel-section p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.key-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    ". up ."
    "left . right"
    ". down ."
    "space space space"
    "enter enter enter";
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
}

.key-button {
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  color: var(--yellow);
  font-family: "PressStart2P", monospace;
  font-size: 11px;
  line-height: 1;
}

.key-button.up {
  grid-area: up;
}

.key-button.left {
  grid-area: left;
}

.key-button.right {
  grid-area: right;
}

.key-button.down {
  grid-area: down;
}

.key-button.wide {
  min-height: 42px;
  color: var(--text);
}

.key-button.space {
  grid-area: space;
}

.key-button.enter {
  grid-area: enter;
}

.mobile-controls {
  display: none;
  width: min(280px, 100%);
  grid-template-columns: repeat(3, 72px);
  grid-template-rows: repeat(3, 58px);
  justify-content: center;
  gap: 8px;
  margin: 0 auto;
  touch-action: none;
}

.dpad-button {
  width: 72px;
  height: 58px;
  border-radius: 8px;
  color: var(--yellow);
  font-family: "PressStart2P", monospace;
  font-size: 17px;
}

.dpad-button.up {
  grid-column: 2;
  grid-row: 1;
}

.dpad-button.left {
  grid-column: 1;
  grid-row: 2;
}

.dpad-button.center {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  place-items: center;
  color: var(--cyan);
  font-size: 20px;
}

.dpad-button.right {
  grid-column: 3;
  grid-row: 2;
}

.dpad-button.down {
  grid-column: 2;
  grid-row: 3;
}

@media (max-width: 980px) {
  .arcade-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .side-panel {
    min-height: 0;
  }

  .key-grid {
    margin-top: 0;
  }
}

@media (max-width: 720px) {
  .wrapper {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .arcade-hero h1 {
    font-size: 34px;
  }

  .arcade-hero .subtitle {
    font-size: 15px;
  }

  .hero-actions {
    width: 100%;
  }

  .action-button {
    flex: 1 1 150px;
    padding: 0 12px;
  }

  .mod-panel .inner {
    padding: 8px;
  }

  .mod-panel .info {
    align-items: center;
    flex-direction: column;
    gap: 4px;
  }

  .mod-panel .ft {
    display: none;
  }

  .mod-panel .info p {
    font-size: 13px;
  }

  .side-panel {
    padding: 16px;
  }

  .mobile-controls {
    display: grid;
    order: 2;
    margin: 2px auto 0;
  }

  .key-grid {
    display: none;
  }

  .side-panel {
    order: 3;
  }
}

@media (max-width: 420px) {
  .arcade-hero h1 {
    font-size: 30px;
  }

  .action-button {
    width: 100%;
    flex-basis: 100%;
  }

  .mobile-controls {
    grid-template-columns: repeat(3, 64px);
    grid-template-rows: repeat(3, 54px);
  }

  .dpad-button {
    width: 64px;
    height: 54px;
  }
}

@keyframes keyframes-fill {
  0% {
    opacity: 0;
    transform: rotate(-180deg) scale(0);
  }

  50% {
    transform: rotate(-10deg) scale(1.18);
  }
}
