:root {
  --bezel: #2b2b2b;
  --shell: #1c1c1e;
  --lcd-bg: #9ead86;
  --lcd-bg-dark: #8a9974;
  --lcd-fg: #29331f;
  --accent: #3b4a2a;
}

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

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: radial-gradient(circle at 50% 0%, #3a3a3d, #0e0e10 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: "Courier New", Courier, monospace;
  user-select: none;
  overscroll-behavior: none;
  padding: 12px;
}

.phone {
  width: min(360px, 92vw);
  background: linear-gradient(160deg, #3d3d40, var(--shell) 40%);
  border-radius: 32px;
  padding: 18px 16px 22px;
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.08);
  border: 1px solid #111;
}

.phone-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #bbb;
  font-size: 11px;
  letter-spacing: 2px;
  padding: 0 4px 10px;
}

.screen-bezel {
  background: var(--bezel);
  border-radius: 14px;
  padding: 12px;
  box-shadow: inset 0 0 0 2px #000, inset 0 0 10px rgba(0,0,0,0.6);
}

.screen {
  position: relative;
  background: var(--lcd-bg);
  border-radius: 6px;
  padding: 8px;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.35);
  overflow: hidden;
}

.hud {
  display: flex;
  justify-content: space-between;
  color: var(--lcd-fg);
  font-weight: bold;
  font-size: 12px;
  padding: 2px 4px 6px;
  letter-spacing: 0.5px;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  background: var(--lcd-bg);
  image-rendering: pixelated;
  border-top: 1px solid var(--lcd-bg-dark);
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(154, 169, 130, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--lcd-fg);
  text-align: center;
  padding: 20px;
}

.overlay.hidden {
  display: none;
}

.bonus-badge {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--lcd-fg);
  color: var(--lcd-bg);
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 3px;
  animation: bonus-pulse 0.6s ease-in-out infinite;
  z-index: 2;
}

.bonus-badge.hidden {
  display: none;
}

@keyframes bonus-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

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

.overlay-sub {
  font-size: 12px;
  max-width: 200px;
  line-height: 1.5;
}

.controls {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pad-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pad {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(160deg, #4a4a4d, #262628);
  color: #ddd;
  font-size: 18px;
  box-shadow:
    0 3px 0 #0c0c0d,
    inset 0 1px 1px rgba(255,255,255,0.15);
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}

.pad:active {
  transform: translateY(2px);
  box-shadow:
    0 1px 0 #0c0c0d,
    inset 0 1px 1px rgba(255,255,255,0.15);
}

.pad.center {
  background: linear-gradient(160deg, #5a5a5e, #2c2c2e);
  font-size: 16px;
}

.soft-keys {
  display: flex;
  justify-content: space-between;
  padding: 14px 10px 0;
  color: #999;
  font-size: 11px;
  letter-spacing: 1px;
}

@media (max-width: 380px) {
  .pad { width: 48px; height: 48px; font-size: 15px; }
}
