:root {
  --bg: #0a0a1a;
  --panel: #101032;
  --neon: #28d7ff;
  --neon-soft: rgba(40, 215, 255, 0.35);
  --ok: #59ff9a;
  --bad: #ff4c8a;
  --text: #e7f7ff;
  --warn: #ffd166;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(rgba(6, 6, 18, 0.82), rgba(10, 10, 26, 0.88)),
    url('bg.png') center/cover no-repeat fixed;
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  overflow: hidden;
}

.app {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 12px;
}

.frame {
  width: min(96vw, 980px);
  position: relative;
}

#game {
  width: 100%;
  max-height: 92vh;
  aspect-ratio: 4 / 3;
  display: block;
  border: 2px solid var(--neon-soft);
  border-radius: 12px;
  background: transparent;
  touch-action: none;
  box-shadow: 0 0 22px rgba(40, 215, 255, 0.18);
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.panel {
  width: min(90%, 560px);
  background: linear-gradient(160deg, rgba(16, 16, 50, 0.92), rgba(8, 8, 30, 0.92));
  border: 1px solid var(--neon-soft);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 0 20px rgba(40, 215, 255, 0.15);
  pointer-events: auto;
}

.panel h1,
.panel h2 {
  margin: 0 0 8px;
  letter-spacing: 1px;
  color: var(--neon);
}

.panel p {
  margin: 8px 0;
  line-height: 1.35;
}

.panel button {
  margin-top: 10px;
  border: 1px solid var(--neon);
  border-radius: 8px;
  background: #08172f;
  color: var(--text);
  font-size: 16px;
  padding: 10px 16px;
  cursor: pointer;
}

.panel button:hover {
  filter: brightness(1.15);
}

.controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 3;
}

.controls button {
  border: 1px solid var(--neon-soft);
  border-radius: 8px;
  background: rgba(8, 20, 36, 0.86);
  color: var(--text);
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.hidden {
  display: none;
}

.mobile-buttons {
  position: absolute;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 8px;
  z-index: 3;
  flex-wrap: nowrap;
  justify-content: center;
  width: 100%;
}

.mobile-btn {
  border: 2px solid var(--neon);
  border-radius: 8px;
  background: rgba(8, 20, 36, 0.92);
  color: var(--neon);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: all 0.15s ease;
  box-shadow: 0 0 12px rgba(40, 215, 255, 0.4);
}

.mobile-btn:active {
  transform: scale(0.95);
  box-shadow: 0 0 20px rgba(40, 215, 255, 0.8);
  background: rgba(40, 215, 255, 0.2);
}

@media (max-width: 700px) {
  .panel {
    padding: 16px;
  }

  .panel p {
    font-size: 14px;
  }

  .controls {
    top: 8px;
    right: 8px;
  }

  .mobile-buttons {
    display: flex;
  }
}
