/* Hématome - univers Game Boy (1989). Coque DMG-01, LCD 4 nuances de vert. */

:root {
  --gb-shell: #c5c0bd;
  --gb-shell-dark: #9c9793;
  --gb-slate: #4f4d6b;
  --gb-magenta: #a53a68;
  /* Palette LCD DMG (contraste renforcé pour lisibilité) */
  --lcd-darkest: #0f2e0f;
  --lcd-dark: #2c5a30;
  --lcd-light: #8bac0f;
  --lcd-lightest: #9bbc0f;
  color-scheme: light;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  min-height: 100dvh;
  background: #34343c;
  background-image:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.05) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.04) 0 2px, transparent 3px);
  background-size: 90px 90px, 130px 130px;
  font-family: "Press Start 2P", "Courier New", monospace;
  display: flex;
  justify-content: center;
  padding: 32px 16px 96px;
}

.gb-shell { width: min(560px, 100%); }

/* -- Coque ------------------------------ */
.gb-body {
  background: linear-gradient(160deg, #d2cdca 0%, var(--gb-shell) 45%, #b3aeab 100%);
  border: 3px solid #7c7873;
  border-radius: 14px 14px 56px 14px;
  padding: 22px 22px 30px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    0 14px 34px rgba(0, 0, 0, 0.5);
}

.gb-model {
  font-size: 11px;
  color: var(--gb-slate);
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.gb-model span { font-style: italic; }
.gb-model i { font-size: 7px; vertical-align: super; }

/* -- Cadre écran ------------------------ */
.gb-screen-frame {
  background: #54525c;
  border-radius: 10px 10px 34px 10px;
  padding: 26px 20px 20px;
  position: relative;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.5);
}

.gb-screen-label {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 6px;
  letter-spacing: 0.28em;
  color: #b9b6c0;
}

.gb-screen-label::before, .gb-screen-label::after {
  content: "";
  position: absolute;
  top: 3px;
  height: 2px;
  width: 18%;
  background: repeating-linear-gradient(to bottom, #8a4a6a 0 2px, #4a5a8a 2px 4px);
}

.gb-screen-label::before { left: 20px; }
.gb-screen-label::after { right: 20px; }

.gb-battery {
  position: absolute;
  left: 6px;
  top: 45%;
  font-size: 5px;
  color: #b9b6c0;
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
  display: none;
}

/* -- LCD -------------------------------- */
.gb-lcd {
  background: var(--lcd-lightest);
  background-image: repeating-linear-gradient(to bottom, rgba(15, 46, 15, 0.06) 0 1px, transparent 1px 3px);
  color: var(--lcd-darkest);
  border: 3px solid #1c1c22;
  height: min(64vh, 620px);
  overflow-y: auto;
  padding: 18px 16px 24px;
  font-size: 10px;
  line-height: 1.9;
  scrollbar-width: thin;
  scrollbar-color: var(--lcd-darkest) var(--lcd-light);
}

.gb-lcd:focus-visible { outline: 4px solid var(--gb-magenta); outline-offset: 2px; }

/* Boot */
.gb-boot { text-align: center; padding: 18px 0 8px; }

.gb-boot-logo {
  font-size: clamp(15px, 4.2vw, 24px);
  letter-spacing: 0.05em;
  animation: gb-drop 900ms ease-out both;
}

.gb-boot-logo i { font-size: 0.4em; vertical-align: super; }

@keyframes gb-drop {
  from { transform: translateY(-60px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.gb-boot-sub { font-size: 8px; margin-top: 12px; color: var(--lcd-dark); letter-spacing: 0.1em; }

.gb-hr {
  margin: 18px auto 0;
  width: 70%;
  height: 4px;
  background: repeating-linear-gradient(to right, var(--lcd-darkest) 0 8px, transparent 8px 12px);
}

/* Sections */
.gb-section { padding: 18px 0; border-bottom: 2px dashed var(--lcd-dark); }
.gb-section:last-child { border-bottom: none; }

.gb-title {
  font-size: 11px;
  background: var(--lcd-darkest);
  color: var(--lcd-lightest);
  display: inline-block;
  padding: 6px 10px;
  margin-bottom: 14px;
  letter-spacing: 0.06em;
}

.gb-section p { margin-bottom: 10px; }

.gb-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.gb-stats div {
  border: 2px solid var(--lcd-darkest);
  padding: 8px 10px;
  flex: 1 1 90px;
  text-align: center;
}

.gb-stats dt { font-size: 6px; letter-spacing: 0.12em; margin-bottom: 8px; color: var(--lcd-dark); }
.gb-stats dd { font-size: 13px; }

/* Items */
.gb-items { list-style: none; }
.gb-items li + li { margin-top: 8px; }

.gb-items a {
  display: block;
  color: var(--lcd-darkest);
  text-decoration: none;
  border: 2px solid var(--lcd-darkest);
  padding: 10px;
  min-height: 44px;
  cursor: pointer;
  transition: background-color 120ms steps(2), color 120ms steps(2);
}

.gb-items a:hover,
.gb-items a:focus-visible {
  background: var(--lcd-darkest);
  color: var(--lcd-lightest);
}

.gb-items a:focus-visible { outline: 3px solid var(--gb-magenta); outline-offset: 2px; }

.gb-item-head { display: flex; align-items: center; gap: 8px; font-size: 10px; }
.gb-cursor { font-style: normal; font-size: 8px; }
.gb-items a:hover .gb-cursor { animation: gb-nudge 500ms steps(2) infinite; }

@keyframes gb-nudge { 50% { transform: translateX(3px); } }

.gb-item-desc {
  display: block;
  margin-top: 6px;
  font-family: "Courier New", monospace;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.4;
}

/* Fin */
.gb-end { text-align: center; }

.gb-links { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 6px; }

.gb-links a {
  color: var(--lcd-darkest);
  text-decoration: none;
  border: 2px solid transparent;
  padding: 10px 8px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.gb-links a:hover, .gb-links a:focus-visible { background: var(--lcd-darkest); color: var(--lcd-lightest); }
.gb-links a:focus-visible { outline: 3px solid var(--gb-magenta); outline-offset: 2px; }

.gb-copy { margin-top: 16px; font-size: 7px; color: var(--lcd-dark); letter-spacing: 0.12em; }

/* -- Commandes -------------------------- */
.gb-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  padding: 0 8px;
}

.gb-dpad { position: relative; width: 110px; height: 110px; }

.gb-dpad-btn, .gb-dpad-h {
  position: absolute;
  background: #2a2a30;
  border: none;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.12);
}

.gb-dpad-btn { width: 38px; height: 38px; left: 36px; cursor: pointer; }
.gb-up { top: 0; border-radius: 6px 6px 0 0; }
.gb-down { bottom: 0; border-radius: 0 0 6px 6px; }
.gb-up:active, .gb-down:active { transform: translateY(1px); }

.gb-dpad-h {
  top: 36px;
  left: 0;
  width: 110px;
  height: 38px;
  border-radius: 6px;
}

.gb-dpad-center {
  position: absolute;
  left: 41px;
  top: 41px;
  width: 28px;
  height: 28px;
  background: radial-gradient(circle, #35353c 30%, #2a2a30 70%);
  border-radius: 50%;
  z-index: 1;
}

.gb-ab { display: flex; gap: 18px; transform: rotate(-22deg); }

.gb-round {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c0567f 0%, var(--gb-magenta) 60%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.35), 0 3px 4px rgba(0, 0, 0, 0.35);
}

.gb-startselect {
  display: flex;
  justify-content: center;
  gap: 34px;
  margin-top: 26px;
}

.gb-startselect span {
  font-size: 8px;
  color: var(--gb-slate);
  letter-spacing: 0.12em;
  padding-top: 22px;
  position: relative;
}

.gb-startselect span::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) rotate(-22deg);
  width: 44px;
  height: 12px;
  border-radius: 8px;
  background: #8d8985;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.gb-speaker {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  margin-top: 26px;
  padding-right: 12px;
  transform: rotate(-22deg);
  transform-origin: right center;
}

.gb-speaker i {
  width: 7px;
  height: 52px;
  border-radius: 4px;
  background: var(--gb-shell-dark);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.4);
}

@media (max-width: 520px) {
  body { padding: 12px 8px 96px; }
  .gb-body { padding: 16px 12px 22px; border-radius: 10px 10px 40px 10px; }
  .gb-screen-frame { padding: 24px 10px 14px; }
  .gb-lcd { height: 62vh; font-size: 9px; }
  .gb-item-desc { font-size: 12px; }
  .gb-dpad { transform: scale(0.85); transform-origin: left center; }
  .gb-round { width: 46px; height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .gb-boot-logo { animation: none; }
  .gb-items a:hover .gb-cursor { animation: none; }
}
