:root {
  --lcd-bg: #c4cfa1;
  --lcd-fg: #0f380f;
  --case: #2b2b2b;
  --case-light: #3d3d3d;
}

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

html, body {
  height: 100%;
  margin: 0;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', Courier, monospace;
  overscroll-behavior: none;
  touch-action: none;
}

#phone {
  width: min(92vw, 380px);
  background: linear-gradient(160deg, var(--case-light), var(--case));
  border-radius: 28px;
  padding: 18px 16px 26px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), inset 0 1px 1px rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#screen-bezel {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 14px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.6);
  position: relative;
}

#topbar {
  display: flex;
  justify-content: space-between;
  color: var(--lcd-bg);
  font-size: 12px;
  letter-spacing: 1px;
  padding: 0 2px 8px;
  opacity: 0.85;
}

canvas#game {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background: var(--lcd-bg);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-radius: 4px;
}

#overlay {
  position: absolute;
  inset: 14px 14px 14px 14px;
  margin-top: 28px;
  background: rgba(196, 207, 161, 0.96);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--lcd-fg);
  text-align: center;
  cursor: pointer;
}

#overlay.hidden { display: none; }

#overlay-title {
  font-size: 28px;
  font-weight: bold;
  letter-spacing: 4px;
}

#overlay-msg {
  font-size: 12px;
  padding: 0 20px;
  line-height: 1.5;
}

#controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dpad-row {
  display: flex;
  gap: 44px;
}

.dpad {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 30% 30%, #555, #222);
  color: #ccc;
  font-size: 18px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.05s ease;
}

.dpad:active {
  transform: scale(0.92);
  background: radial-gradient(circle at 30% 30%, #666, #1a1a1a);
}

@media (min-width: 700px) {
  #controls { opacity: 0.55; }
}

#disclaimer {
  margin: 4px 4px 0;
  color: #888;
  font-size: 9px;
  line-height: 1.4;
  text-align: center;
}
