:root {
  color-scheme: light;
  --ink: #32252a;
  font-family: system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
html { background: #050506; }
body {
  height: 100dvh; display: grid; place-items: center;
  grid-template: minmax(0,1fr)/minmax(0,1fr);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: radial-gradient(ellipse at 50% 43%, #303033 0%, #1b1b1e 44%, #0d0d0f 72%, #050506 100%);
}
.handheld {
  position: relative;
  width: 560px; height: 700px;
  transform: scale(var(--console-scale, 1)); transform-origin: center;
  display: grid;
  grid-template-areas: "screen screen" "left right" "mapping mapping";
  grid-template-rows: auto minmax(0,1fr) auto;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 16px 24px;
  padding: 20px 14px;
  border-radius: 32px 32px 48px 48px;
  background: linear-gradient(155deg,#f8e1bc 0%,#ebc99d 55%,#d6ac7e 100%);
  box-shadow: inset 0 2px #ffefd1, inset 0 -3px #ae8461,
    0 5px 8px #0009, 0 18px 38px #000b, 0 32px 72px #0008;
}
.grip { display: grid; grid-template-rows: 36px 1fr 36px; place-items: center; }
.grip.left { grid-area: left; }
.grip.right { grid-area: right; }
.bezel {
  grid-area: screen; min-width: 0; padding: 8px;
  border: 2px solid #2d2428; border-radius: 16px;
  background: #302b2d; box-shadow: inset 0 2px #584c4c, 0 2px #fff1d6;
}
.screen {
  position: relative;
  width: 100%; aspect-ratio: 16/9;
  overflow: hidden; background: #181519; border-radius: 5px;
}
canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; outline: 0; touch-action: none; }
#status { position: absolute; inset: 0; margin: 0; display: grid; place-content: center; color: #fff4df; background: #211b23; }
#status[hidden] { display: none; }
button {
  appearance: none; border: 1px solid #362a2b; color: inherit; font: inherit;
  cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none;
}
button:focus-visible, canvas:focus-visible { outline: 3px solid #4bb3b6; outline-offset: 2px; }
.shoulder, .system, #key-labels { border-radius: 20px; background: #7c6657; color: #fff4de; box-shadow: inset 0 1px #ffffff45, 0 2px #46362e; }
.shoulder { width: 92px; height: 36px; font-size: 16px; font-weight: 800; }
.system { width: 80px; height: 36px; font-size: 12px; letter-spacing: .07em; font-weight: 800; }
.left .system { justify-self: end; }
.right .system { justify-self: start; }
#key-labels {
  grid-area: mapping; justify-self: center; padding: 7px 14px;
  background: #292326df; color: #fff0d6; border-color: #86766a;
  font-size: 14px; line-height: 20px;
}
#key-labels[aria-pressed="true"] { color: #352a22; background: #f2d8a9; }
.pad, .face {
  display: grid; width: 156px; aspect-ratio: 1;
  grid-template: repeat(3,minmax(0,1fr))/repeat(3,minmax(0,1fr));
}
.pad { background: radial-gradient(circle,#39333b 20%,transparent 21%); }
.pad button, .face button {
  display: grid; place-items: center; padding: 0; min-width: 0; min-height: 0;
  box-shadow: inset 0 2px #ffffff48, 0 2px #33292d; font-weight: 800; line-height: 1;
  font-size: 21px;
}
.pad button { border-radius: 6px; background: #49434a; color: #f4dbaf; }
.face button { border-radius: 50%; color: #321e25; }
[data-button="up"], [data-button="x"] { grid-area: 1/2; }
[data-button="left"], [data-button="y"] { grid-area: 2/1; }
[data-button="right"], [data-button="a"] { grid-area: 2/3; }
[data-button="down"], [data-button="b"] { grid-area: 3/2; }
[data-button="x"] { background: #efc75f; }
[data-button="y"] { background: #83c0bc; }
[data-button="a"] { background: #e97469; }
[data-button="b"] { background: #e5a36c; }
button[data-button].pressed, button[data-button]:active { transform: translateY(2px); box-shadow: inset 0 2px 4px #2118205c; }
[data-button] kbd { display: none; font: 750 12px/1 ui-monospace,monospace; letter-spacing: 0; }
.show-keys [data-button] { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1px; }
.show-keys [data-button] kbd { display: block; }

/* Inside the gizlet.io player: only the screen, filling the frame; the player's case has the buttons. */
.hosted body { padding: 0; background: #000; }
.hosted .handheld { width: 100vw; height: 100vh; transform: none; display: block; padding: 0; border-radius: 0; background: #000; box-shadow: none; }
.hosted .bezel { height: 100%; padding: 0; border: 0; border-radius: 0; background: #000; box-shadow: none; }
.hosted .screen { height: 100%; aspect-ratio: auto; border-radius: 0; }
.hosted .grip, .hosted #key-labels { display: none; }
