/* ============================================================
   Onyx Pocket — Game Boy-style player shell
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --gb-body-1: #d9d6c8;
  --gb-body-2: #c3bfae;
  --gb-body-3: #adaa99;
  --gb-edge-dark: #8f8c7d;
  --gb-edge-light: #efece1;
  --gb-screen-1: #6c6f63;
  --gb-screen-2: #4a4d44;
  --gb-screen-3: #34372f;
  --gb-lcd-bezel: #20221c;
  --gb-accent: #8c2f66;
  --gb-accent-2: #2f3b7a;
  --gb-btn: #9a2a55;
  --gb-btn-dark: #6e1c3c;
  --gb-dpad: #2b2b30;
  --gb-dpad-light: #44444c;
  --gb-pill: #3b3b45;
  --gb-text: #4a4636;
  --ui-gold: #ffcd75;
  --font: 'Press Start 2P', 'Courier New', monospace;
}

html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: var(--font);
  background:
    radial-gradient(ellipse at 50% 0%, #20202e 0%, #0b0b13 60%, #060609 100%);
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  color: var(--gb-text);
}

html { background: black; }

#game-container {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5vmin;
}

#gb-shell {
  container-type: inline-size;
  width: min(96vw, 54vh, 470px);
}

#gb-device {
  width: 100%;
  display: flex; flex-direction: column; align-items: stretch;
  padding: 4cqw 4cqw 5cqw;
  gap: 2cqw;
  border-radius: 4cqw 4cqw 14cqw 4cqw;
  background:
    linear-gradient(150deg, var(--gb-body-1) 0%, var(--gb-body-2) 55%, var(--gb-body-3) 100%);
  box-shadow:
    inset 0 0 0 0.6cqw rgba(255,255,255,0.35),
    inset 0 -2cqw 4cqw rgba(0,0,0,0.18),
    inset 0 2cqw 3cqw rgba(255,255,255,0.4),
    0 3cqw 6cqw rgba(0,0,0,0.55),
    0 0.6cqw 0 var(--gb-edge-dark);
  position: relative;
}

.gb-toprail {
  display: flex; align-items: center; justify-content: space-between;
  height: 6cqw; padding: 0 1cqw;
}
.gb-power { display: flex; align-items: center; gap: 1.5cqw; }
.gb-power-nub {
  width: 7cqw; height: 2.6cqw; border-radius: 1.3cqw;
  background: linear-gradient(180deg, #e9e6da, #b4b1a2);
  box-shadow: inset 0 0.4cqw 0.4cqw rgba(255,255,255,0.6), inset 0 -0.4cqw 0.5cqw rgba(0,0,0,0.3), 0 0.3cqw 0.3cqw rgba(0,0,0,0.25);
}
.gb-power-label { font-size: 1.9cqw; color: rgba(74,70,54,0.7); letter-spacing: 0.05em; }
.gb-vents { display: flex; gap: 1.4cqw; }
.gb-vents span {
  width: 1cqw; height: 5cqw; border-radius: 1cqw;
  background: linear-gradient(180deg, rgba(0,0,0,0.16), rgba(255,255,255,0.25));
}

.gb-screen-housing {
  border-radius: 3cqw 3cqw 8cqw 3cqw;
  padding: 3.4cqw 4cqw 4cqw;
  background: linear-gradient(160deg, var(--gb-screen-1), var(--gb-screen-2) 60%, var(--gb-screen-3));
  box-shadow:
    inset 0 0.5cqw 1.5cqw rgba(0,0,0,0.5),
    inset 0 -0.4cqw 1cqw rgba(255,255,255,0.08),
    0 0.4cqw 0.6cqw rgba(255,255,255,0.25);
  position: relative;
}
.gb-screen-housing::before {
  content: ""; position: absolute; left: 4cqw; right: 4cqw; top: 1.4cqw; height: 1.2cqw;
  background:
    linear-gradient(90deg, var(--gb-accent) 0 50%, transparent 50%) 0 0 / 2.2cqw 0.5cqw repeat-x,
    linear-gradient(180deg, var(--gb-accent), var(--gb-accent-2));
  border-radius: 1cqw; opacity: 0.85; pointer-events: none;
}
.gb-screen-caption {
  display: flex; align-items: center; justify-content: center; gap: 2cqw;
  margin-bottom: 1.6cqw;
}
.gb-led {
  width: 2.4cqw; height: 2.4cqw; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a8a, #c11 70%);
  box-shadow: 0 0 1.6cqw rgba(220,30,30,0.8), inset 0 0 0.4cqw rgba(255,255,255,0.5);
}
.gb-caption-text { font-size: 1.9cqw; color: rgba(255,255,255,0.5); letter-spacing: 0.06em; }

#gb-screen {
  container-type: inline-size;
  position: relative;
  width: 100%;
  aspect-ratio: 10 / 9;
  background: #05060a;
  border-radius: 1.2cqw;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 0.6cqw var(--gb-lcd-bezel),
    inset 0 0 3cqw rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

#coming-soon {
  padding: 6cqw 5cqw;
  text-align: center;
}
#coming-soon h1 {
  font-size: clamp(11px, 4.6cqw, 20px);
  font-weight: normal;
  color: var(--ui-gold);
  letter-spacing: 0.04em;
  line-height: 1.85;
  text-shadow: 0 0 4cqw rgba(255,205,117,0.4), 0 0.3cqw 0 #a66b00;
}
#coming-soon h1 span {
  color: #ff4d4d;
  text-shadow: 0 0 4cqw rgba(255,77,77,0.45), 0 0.3cqw 0 #8a1a1a;
}
#coming-soon p {
  position: absolute;
  left: 4cqw;
  right: 4cqw;
  top: 82%;
  margin-top: 0;
  font-size: clamp(8px, 2.7cqw, 12px);
  color: var(--ui-gold);
  letter-spacing: 0.02em;
  line-height: 1.4;
  text-shadow: 0 0 3cqw rgba(255,205,117,0.35), 0 0.25cqw 0 #a66b00;
}

.gb-brand {
  display: flex; align-items: baseline; justify-content: center; gap: 1cqw;
  margin: 0.5cqw 0 0.2cqw;
}
.gb-brand-main {
  font-size: 5cqw; color: #3a3550; letter-spacing: 0.04em;
  text-shadow: 0 0.4cqw 0 rgba(255,255,255,0.4);
}
.gb-brand-sub {
  font-family: Georgia, 'Times New Roman', serif; font-style: italic;
  font-size: 3.7cqw; color: #5a5470; font-weight: 700;
}
.gb-brand-tm { font-size: 1.6cqw; color: #5a5470; align-self: flex-start; }

.gb-controls {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1cqw 3cqw 0; margin-top: 0.5cqw;
}

.dpad { position: relative; width: 28cqw; height: 28cqw; flex: 0 0 auto; }
.dbtn {
  position: absolute;
  background: linear-gradient(160deg, var(--gb-dpad-light), var(--gb-dpad) 60%, #18181c);
  color: rgba(255,255,255,0.85);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0.6cqw 0.8cqw rgba(0,0,0,0.45), inset 0 0.4cqw 0.4cqw rgba(255,255,255,0.12);
}
.dbtn-up    { top: 0;    left: 9.75cqw; width: 8.5cqw; height: 10cqw; border-radius: 2cqw 2cqw 0 0; }
.dbtn-down  { bottom: 0; left: 9.75cqw; width: 8.5cqw; height: 10cqw; border-radius: 0 0 2cqw 2cqw; }
.dbtn-left  { left: 0;   top: 9.75cqw;  width: 10cqw; height: 8.5cqw; border-radius: 2cqw 0 0 2cqw; }
.dbtn-right { right: 0;  top: 9.75cqw;  width: 10cqw; height: 8.5cqw; border-radius: 0 2cqw 2cqw 0; }
.dpad-hub {
  position: absolute; left: 9.75cqw; top: 9.75cqw; width: 8.5cqw; height: 8.5cqw;
  background: var(--gb-dpad);
  box-shadow: inset 0 0 1.4cqw rgba(0,0,0,0.6);
}
.dpad-hub::after {
  content: ""; position: absolute; inset: 2.2cqw; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(255,255,255,0.12), rgba(0,0,0,0.35));
}
.dbtn .dlabel { font-size: 3.6cqw; }
.dbtn .darrow { font-size: 3cqw; display: none; }
.dbtn-up .dlabel, .dbtn-down .dlabel { margin-top: -0.8cqw; }

.ab-cluster { display: flex; flex-direction: column; align-items: center; gap: 1.5cqw; flex: 0 0 auto; }
.ab-pair { display: flex; align-items: flex-end; gap: 4.5cqw; }
.round-btn {
  width: 13cqw; height: 13cqw; border-radius: 50%;
  font-size: 4cqw; color: rgba(255,255,255,0.92);
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 38% 32%, #c0426f, var(--gb-btn) 55%, var(--gb-btn-dark));
  box-shadow:
    0 0.8cqw 1.2cqw rgba(0,0,0,0.5),
    inset 0 0.5cqw 0.6cqw rgba(255,255,255,0.35),
    inset 0 -0.6cqw 0.8cqw rgba(0,0,0,0.4);
  text-shadow: 0 0.3cqw 0.3cqw rgba(0,0,0,0.4);
}
#btn-a { transform: translateY(-6cqw); }

.gb-startsel {
  display: flex; align-items: flex-start; justify-content: center; gap: 8cqw;
  margin-top: 1.2cqw;
}
.ss-item { display: flex; flex-direction: column; align-items: center; gap: 1.4cqw; }
.pill-btn {
  width: 14cqw; height: 4.4cqw; border-radius: 3cqw;
  /* The tilt draws past the box. This margin keeps the pill off the
     D-pad, A/B, and its own label. */
  margin: 3.4cqw 0 3.2cqw;
  transform: rotate(-25deg);
  background: linear-gradient(180deg, #4a4a55, var(--gb-pill) 60%, #25252c);
  box-shadow: 0 0.6cqw 0.8cqw rgba(0,0,0,0.45), inset 0 0.4cqw 0.4cqw rgba(255,255,255,0.18);
}
.ss-label { font-size: 2.1cqw; color: rgba(74,70,54,0.85); letter-spacing: 0.08em; }

.gb-speaker {
  display: flex; gap: 2cqw; justify-content: flex-end; align-items: center;
  transform: rotate(-25deg); transform-origin: right center;
  margin: 1.5cqw 4cqw 0 auto; width: max-content;
}
.gb-speaker span {
  width: 1.4cqw; height: 11cqw; border-radius: 1cqw;
  background: linear-gradient(90deg, rgba(0,0,0,0.18), rgba(255,255,255,0.18));
  box-shadow: inset 0 0 0.5cqw rgba(0,0,0,0.3);
}

@media (hover: none) and (pointer: coarse) {
  .dbtn .dlabel { display: none; }
  .dbtn .darrow { display: inline; }

  #game-container { padding: 0; align-items: stretch; }
  #gb-shell { width: 100vw; }

  #gb-device {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 4cqw 4cqw 6cqw;
    gap: 2cqw;
    border-radius: 0;
    box-shadow: inset 0 0 0 0.6cqw rgba(255,255,255,0.3);
  }
  .gb-toprail,
  .gb-speaker,
  .gb-screen-housing::before { display: none; }

  .gb-screen-housing { padding: 3cqw 3.5cqw 3.5cqw; }

  .gb-brand { margin: 2cqw 0 1cqw; }
  .gb-brand-main { font-size: 6cqw; }
  .gb-brand-sub { font-size: 4.4cqw; }
  .gb-brand-tm { font-size: 1.9cqw; }

  .gb-controls { padding: 4cqw 6cqw 0; margin-top: 0; }
  .gb-startsel { margin-top: 2cqw; }
}
