* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background: #07111e;
  color: #e2e8f0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 12px;
}

.game-wrapper {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.top-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.back-btn {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
  padding: 6px 10px;
  border: 1px solid #1e293b;
  border-radius: 8px;
  background: #0f172a;
}

.stats {
  display: flex;
  gap: 12px;
  background: #0f172a;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #1e293b;
}

h1 {
  font-size: 1.2rem;
  color: #7dd3fc;
  text-align: center;
}

.canvas-box {
  position: relative;
  width: 360px;
  max-width: 100%;
  border: 2px solid #38bdf8;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.25);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  background: linear-gradient(180deg, #040d1a 0%, #0b2545 100%);
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 13, 26, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
  gap: 14px;
}

.overlay h2 {
  color: #f8fafc;
  font-size: 1.35rem;
}

.overlay p {
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.4;
}

.action-btn {
  background: #22c55e;
  color: #052e16;
  border: none;
  padding: 12px 24px;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.1s;
}

.action-btn:active {
  transform: scale(0.96);
}

.touch-controls {
  width: 360px;
  max-width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

.ctrl-btn {
  background: #1e293b;
  color: #f8fafc;
  border: 2px solid #38bdf8;
  border-radius: 12px;
  padding: 16px 0;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.ctrl-btn:active {
  background: #38bdf8;
  color: #0f172a;
}
