/* RPA Town — habillage rétro (hommage Game Boy, assets 100% originaux).
   Palette DMG : 4 verts.  Écran interne 160x144 mis à l'échelle entière, pixel-perfect. */
@font-face {
  font-family: "PixelGB";
  src: url("/static/game/fonts/press-start-2p.woff2") format("woff2");
  font-display: swap;
}

:root {
  --c0: #0f380f;  /* encre (le + foncé) */
  --c1: #306230;
  --c2: #8bac0f;
  --c3: #9bbc0f;  /* fond écran (le + clair) */
  --shell: #c9ccce; --shell2:#b4b8bb; --shell-line:#8d9194;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: radial-gradient(1200px 700px at 50% -10%, #1a2030, #0b0e13 70%);
  display: flex; align-items: center; justify-content: center;
  font-family: "PixelGB", monospace; color: var(--c0);
  -webkit-font-smoothing: none;
}

/* ---- Console ---- */
.console {
  background: linear-gradient(160deg, var(--shell), var(--shell2));
  border-radius: 14px 14px 48px 14px;
  padding: 16px 18px 22px;
  box-shadow: 0 24px 60px -20px #000, inset 0 2px 0 #ffffffaa, inset 0 -3px 0 #00000022;
  width: 540px; max-width: 96vw;
}
.console-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 8px; color: #5a5f63; }
.led { width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff8b8b, #c0392b); box-shadow: 0 0 6px #e74c3c88; }
.brand { letter-spacing: 1px; }
.snd { margin-left: auto; border: none; background: #00000010; cursor: pointer; font-size: 12px; line-height: 1; padding: 3px 6px; border-radius: 6px; }
.snd:hover { background: #00000022; }
.quit { color: #5a5f63; text-decoration: none; font-size: 8px; padding: 4px 8px; border-radius: 6px; }
.quit:hover { background: #00000010; color: var(--c1); }

.screen-bezel {
  background: #2b2f33; border-radius: 10px 10px 26px 10px;
  padding: 18px 26px; box-shadow: inset 0 2px 8px #000a;
}
.screen {
  position: relative; width: 480px; height: 432px; margin: 0 auto;
  background: var(--c3); overflow: hidden; box-shadow: 0 0 0 2px #1c1f22;
}
#game {
  width: 480px; height: 432px; display: block;
  image-rendering: pixelated; image-rendering: crisp-edges;
}

/* ---- Overlay (dialogues / menus / data) ---- */
.overlay { position: absolute; inset: 0; pointer-events: none; }
.boot {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: var(--c3); color: var(--c0); font-size: 18px; letter-spacing: 2px;
}
.boot small { font-size: 8px; color: var(--c1); animation: blink 1s steps(2) infinite; }

.dialog {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  background: var(--c3); color: var(--c0);
  border: 3px solid var(--c0); border-radius: 6px;
  padding: 12px 12px 14px; min-height: 92px;
  box-shadow: 0 0 0 3px var(--c3), 0 0 0 5px var(--c0);
  font-size: 10px; line-height: 1.7;
}
.dialog.tall { top: 12px; bottom: 12px; min-height: 0; overflow: auto; }
.dialog .title { color: var(--c1); font-size: 8px; margin-bottom: 8px; letter-spacing: 1px; }
.dialog .line { white-space: pre-wrap; word-break: break-word; }
.dialog .cursor { position: absolute; right: 12px; bottom: 10px; animation: blink 0.9s steps(2) infinite; }

.place {
  position: absolute; left: 10px; right: 10px; top: 8px;
  background: var(--c0); color: var(--c3);
  border: 2px solid var(--c3); border-radius: 5px;
  padding: 5px 8px; display: flex; align-items: baseline; gap: 8px;
  box-shadow: 0 0 0 2px var(--c0);
}
.place b { font-size: 9px; letter-spacing: 1px; }
.place span { font-size: 7px; color: var(--c2); margin-left: auto; }

.menu { list-style: none; margin: 4px 0 0; padding: 0; }
.menu li { padding: 2px 0 2px 16px; position: relative; }
.menu li.sel::before { content: "▶"; position: absolute; left: 0; }
.menu li.sel { color: var(--c1); }

.qtoast {
  position: absolute; left: 10px; right: 10px; top: 8px;
  background: var(--c0); color: var(--c3);
  border: 2px solid var(--c3); border-radius: 5px;
  padding: 6px 8px; font-size: 8px; letter-spacing: 1px; text-align: center;
  box-shadow: 0 0 0 2px var(--c0); animation: qpop 0.25s ease;
}
.hud {
  position: absolute; left: 8px; top: 8px;
  background: var(--c0); color: var(--c3);
  border: 2px solid var(--c3); border-radius: 5px;
  padding: 3px 6px; font-size: 7px; letter-spacing: 1px;
  box-shadow: 0 0 0 2px var(--c0); pointer-events: none;
}
@keyframes qpop { from { transform: translateY(-6px); opacity: 0; } }
@keyframes blink { 50% { opacity: 0; } }

/* ---- Commandes ---- */
.pad { display: flex; align-items: center; justify-content: space-between; margin: 18px 8px 4px; }
.dpad { position: relative; width: 96px; height: 96px; }
.dpad .d {
  position: absolute; width: 32px; height: 32px; border: none; cursor: pointer;
  background: #3a3f44; color: #cfd3d6; font-size: 12px; border-radius: 4px;
}
.dpad .d:active { background: var(--c1); color: #fff; }
.dpad .up { left: 32px; top: 0; border-radius: 6px 6px 0 0; }
.dpad .down { left: 32px; top: 64px; border-radius: 0 0 6px 6px; }
.dpad .left { left: 0; top: 32px; border-radius: 6px 0 0 6px; }
.dpad .right { left: 64px; top: 32px; border-radius: 0 6px 6px 0; }
.ab { display: flex; gap: 16px; align-items: center; transform: rotate(-18deg); }
.btn-a, .btn-b {
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #a23b6b, #7d2350); color: #ffd; font-size: 12px;
  box-shadow: 0 3px 0 #00000040;
}
.btn-a:active, .btn-b:active { transform: translateY(2px); box-shadow: none; }

.hint { text-align: center; font-size: 7px; color: #5a5f63; line-height: 1.8; margin: 10px 4px 0; }
.hint b { color: var(--c1); }

@media (max-width: 560px) {
  .console { width: 96vw; }
  .screen, #game { width: 320px; height: 288px; }
  .screen { height: 288px; }
}
