/* GAMES page: the arcade. The clock's own housing, scaled up, with the knob and switches beside it. */
.gm-body { background: #000; }
.gm { display: grid; grid-template-columns: minmax(180px, 240px) auto; gap: clamp(20px, 3vw, 48px); justify-content: center; align-items: start; padding: 4px var(--margin) 8px; }
.gm h1 { margin: 0 0 8px; color: var(--amber); font-size: clamp(34px, 3.4vw, 48px); letter-spacing: .04em; line-height: 1; }
.gm-sub { margin: 0 0 22px; color: var(--muted); font-size: 17px; line-height: 1.4; }
.gm-tiles { display: grid; gap: 8px; }
.gm-tiles button { font: inherit; font-weight: 700; font-size: 18px; letter-spacing: .05em; text-align: left; color: var(--muted); background: #0c0c0c; border: 0; border-left: 4px solid #333; padding: 13px 14px; cursor: pointer; }
.gm-tiles button:hover { color: var(--ink); border-left-color: #666; }
.gm-tiles button[aria-selected="true"] { color: var(--amber); border-left-color: var(--amber); background: #141414; }
.gm-more { margin: 10px 0 0 18px; color: #777; font-size: 14px; letter-spacing: .03em; }
.gm-how { margin: 20px 0 0; color: var(--ink); font-size: 17px; line-height: 1.45; min-height: 5em; }
.gm-how b { color: var(--amber); }

.gm-mid { display: flex; flex-direction: column; align-items: stretch; }
.gm-house { align-self: center; padding: 14px clamp(22px, 3vw, 44px); background: linear-gradient(#1d1d1d, #0e0e0e); border-radius: 26px; box-shadow: inset 0 2px 0 #343434, inset 0 -8px 16px #000, 0 30px 60px rgba(0,0,0,.8); cursor: ns-resize; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; }
.gm-glass { background: #000; border: 2px solid #232323; border-radius: 6px; line-height: 0; overflow: hidden; position: relative; }
/* the cue on the glass until the first scroll or click: how you play this thing */
.gm-cue { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 12px 20px 12px 16px; background: rgba(0,0,0,.86); border: 2px solid var(--amber); border-radius: 12px; line-height: 1.3; color: var(--ink); font-size: 17px; white-space: nowrap; pointer-events: none; transition: opacity .35s; }
.gm-cue.off { opacity: 0; }
.gm-cue b { display: block; color: var(--amber); font-size: 21px; letter-spacing: .03em; }
.gm-cue-touch { display: none; }
.gm-cue-mouse rect { fill: none; stroke: var(--amber); stroke-width: 3; }
.gm-cue-mouse .w { fill: var(--amber); stroke: none; animation: gm-roll 1.6s ease-in-out infinite; }
@keyframes gm-roll { 0%, 100% { transform: translateY(-3px); } 50% { transform: translateY(7px); } }
@media (prefers-reduced-motion: reduce) { .gm-cue-mouse .w { animation: none; } }
.gm-noknob { margin-left: auto; color: #777; font-size: 13px; line-height: 1.35; text-align: right; }
#gm-scr { display: block; image-rendering: pixelated; image-rendering: crisp-edges; background: #000; }

/* the controls, directly under the machine: a line of labels on the left, the knob on the right */
.gm-ctl { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 8px clamp(22px, 3vw, 44px) 0; }
.gm-set { display: flex; flex-wrap: wrap; gap: 4px 26px; }
.gm-sw { display: inline-flex; align-items: baseline; }
.gm-sw button { font: inherit; font-weight: 700; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: #777; background: none; border: 0; padding: 4px 0; cursor: pointer; }
.gm-sw button + button::before { content: "/"; color: #444; margin: 0 8px; font-weight: 400; }
.gm-sw button:hover { color: var(--ink); }
.gm-sw button[aria-pressed="true"] { color: var(--amber); }
.gm-status { margin: 6px 0 0; color: var(--muted); font-size: 15px; min-height: 1.4em; }
.gm-knob { width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(circle at 50% 38%, #343434, #0c0c0c 72%); border: 2px solid #333; outline: 6px solid #121212; position: relative; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; flex: 0 0 auto; margin: 6px; --k: 58px; }
.gm-knob:active { cursor: grabbing; }
.gm-knob i { position: absolute; left: 50%; top: 5px; width: 4px; height: 14px; margin-left: -2px; border-radius: 2px; background: var(--amber); transform-origin: 2px calc(var(--k) / 2 - 7px); }
.gm-knob b { position: absolute; inset: 34%; border-radius: 50%; background: #161616; box-shadow: inset 0 2px 5px #000; }
.gm-knob.push b { background: #2a2a2a; }
.gm-stamp { margin: 6px var(--margin) 36px; color: #666; font-size: 13px; text-align: center; }

/* full screen: just the machine, centred */
.gm:fullscreen { background: #000; align-content: center; padding: 20px; width: 100vw; height: 100vh; overflow: auto; }

/* phones and narrow windows: a handheld. Screen on top, games, then one big knob for your thumb. */
@media (max-width: 900px) {
  .gm { grid-template-columns: 1fr; gap: 10px; padding: 6px 12px 8px; }
  .gm-left { display: contents; }
  .gm h1, .gm-sub { display: none; }
  .gm-mid { order: 1; display: contents; }
  .gm-house { order: 1; justify-self: center; padding: 12px 14px 14px; border-radius: 20px; cursor: default; }
  .gm-tiles { order: 2; grid-template-columns: 1fr 1fr; gap: 6px; }
  .gm-tiles button { font-size: 14px; padding: 8px 10px; }
  .gm-ctl { order: 3; flex-direction: column-reverse; gap: 8px; padding: 2px 0 0; }
  .gm-ctl-l { display: flex; flex-direction: column-reverse; align-items: center; gap: 2px; }
  .gm-knob { --k: min(42vw, 180px, 20vh); width: var(--k); height: var(--k); outline-width: 10px; margin: 10px; }
  .gm-knob i { top: 9px; width: 5px; height: 22px; margin-left: -2.5px; transform-origin: 2.5px calc(var(--k) / 2 - 11px); }
  .gm-set { justify-content: center; gap: 2px 18px; }
  .gm-sw button { font-size: 13px; }
  .gm-status { margin: 0; font-size: 14px; text-align: center; }
  .gm-noknob, .gm-cue-desk, .gm-cue-mouse { display: none; }
  .gm-cue-touch { display: block; }
  .gm-cue { font-size: 14px; padding: 8px 14px; bottom: 5%; }
  .gm-cue b { font-size: 16px; }
  .gm-more { order: 2; margin: -4px 0 0; text-align: center; font-size: 13px; }
  .gm-how { order: 4; margin: 2px 0 0; min-height: 0; font-size: 15px; text-align: center; }
  #gm-full { display: none; }
}
