/* The felt arcade cabinets standing on the quilt, and the windows their games open in (see arcade.js) */
.arcade {
  position: absolute; left: 0; top: 0; z-index: 2;
  --tilt: 2deg;                                                          /* stood down a touch squiffy */
  width: min(var(--aw, 200px), calc((100vh - 150px) * .5)); aspect-ratio: 606 / 1013;
  touch-action: none; user-select: none; -webkit-user-select: none; outline: none; cursor: grab;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)) drop-shadow(3px 9px 8px rgba(0,0,0,.3)) drop-shadow(8px 22px 24px rgba(0,0,0,.22));
}
@media (max-width: 600px) { .arcade { --aw: 140px; } }
.arcade.drag { cursor: grabbing; }
.arcade-tilt { position: absolute; inset: 0; transform: rotate(var(--tilt)); }
.arcade:focus-visible .arcade-tilt { outline: 2px dashed #fff; outline-offset: 4px; border-radius: 12px; }
.arcade-body { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }   /* the felt, with a window for the screen */

/* the screen, behind the felt's window */
.arcade-screen { position: absolute; left: 18.48%; top: 22.8%; width: 62.87%; height: 23.99%; overflow: hidden; background: #000; z-index: 1; }
.arcade-attract {                                                        /* attract mode: the logo and a blinking INSERT COIN */
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 4% 4% 6%; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4%;
  background: radial-gradient(ellipse at 50% 40%, #241046, #08040f 75%); color: #ffd23a;
  font: bold 9px/1 "Courier New", ui-monospace, monospace; letter-spacing: 1px; text-shadow: 0 0 4px rgba(255,190,40,.8);
}
.arcade-attract img { height: 58%; image-rendering: pixelated; filter: drop-shadow(0 0 6px rgba(255,90,200,.35)); }
.arcade-attract b { font-size: 1.15em; animation: arcade-blink 1.1s steps(2, start) infinite; }
.arcade-attract small { font-size: .8em; color: #9fd6ff; text-shadow: none; opacity: .85; }
@keyframes arcade-blink { to { visibility: hidden; } }
.arcade-glass {                                                          /* an old CRT behind scuffed glass */
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background:
    url(/ipod/scratches.webp?v=2) center / cover no-repeat,
    radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 60%, rgba(0,0,0,.45) 100%),
    linear-gradient(152deg, rgba(255,255,255,.12) 0%, rgba(255,255,255,.04) 38%, rgba(255,255,255,0) 39%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, rgba(0,0,0,0) 1px 3px);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.8), inset 0 5px 12px rgba(0,0,0,.6);
  opacity: .85;
}

/* picked up: it lifts off the quilt, a touch bigger, its shadow spreading out below; let go and it settles back down */
.arcade-tilt { transition: transform .22s cubic-bezier(.2,.8,.3,1), filter .22s cubic-bezier(.2,.8,.3,1); }
.arcade.drag .arcade-tilt { transform: rotate(var(--tilt)) translateY(-10px) scale(1.04); filter: drop-shadow(10px 30px 22px rgba(0,0,0,.3)); }

/* White Ferrari: a pixel-art poster on the attract screen */
.arcade-attract img.arcade-poster { height: 62%; max-width: 92%; object-fit: cover; border-radius: 2px; }

/* MP3 MAYHEM: its wide logo over a dark neon screen */
.arcade-attract img.arcade-logo-wide { height: auto; width: 88%; image-rendering: auto; filter: drop-shadow(0 0 6px rgba(255,63,180,.45)) drop-shadow(0 0 4px rgba(73,214,255,.35)); }
.arcade-mayhem .arcade-attract { background: radial-gradient(ellipse at 50% 40%, #10203a, #04060e 75%); }

/* coin in: a little hop as the game opens in its tab */
.arcade.coin .arcade-tilt { animation: arcade-coin .45s ease-out; }
@keyframes arcade-coin { 0% { transform: rotate(var(--tilt)); } 35% { transform: rotate(var(--tilt)) translateY(-10px) scale(1.03); } 100% { transform: rotate(var(--tilt)); } }

/* the game's own window: dead straight, the cabinet's stitched marquee for a title bar (drag it by that), a big felt
   close button on the marquee, and the game on a black CRT screen underneath */
body .window.arc-win { padding: 0 3px 3px; rotate: none !important; min-width: 0; }
body .window.arc-win > .titlebar { position: relative; height: auto; aspect-ratio: var(--mqar); padding: 0; margin: 0 0 6px; border: 0; border-radius: 12px;
  border-image: none !important; background: var(--mq) center / 100% 100% no-repeat; cursor: grab; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
body .window.arc-win.inactive > .titlebar { border-image: none !important; background: var(--mq) center / 100% 100% no-repeat; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)) saturate(.75) brightness(.92); }
body .window.arc-win.dragging > .titlebar { cursor: grabbing; }
.arc-win > .titlebar > svg, .arc-win > .titlebar > .t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.arc-win > .titlebar > .tbtn { position: absolute; z-index: 2; top: -14px; width: 36px; height: 34px; font-size: 17px !important; box-shadow: 0 2px 3px rgba(0,0,0,.35), 0 5px 9px rgba(0,0,0,.2) !important; }
.arc-win > .titlebar > .tbtn[id$="-min"] { right: 36px; }
.arc-win > .titlebar > .arc-close { right: -14px; width: 42px; height: 38px; top: -16px; font-size: 19px !important; color: #fff !important; text-shadow: 0 1px 1px rgba(0,0,0,.5) !important;
  border-image: url(/icons/quilt/navy.webp) 28 fill / 8px round !important; filter: hue-rotate(140deg) saturate(2.4) brightness(1.25); }   /* a red felt patch with white stitching */
.arc-win > .titlebar > .arc-close:hover { filter: hue-rotate(140deg) saturate(2.8) brightness(1.45); }
.arc-screen { position: relative; aspect-ratio: var(--ar); background: #000; border-radius: 9px; overflow: hidden;
  box-shadow: 0 0 0 2px rgba(0,0,0,.75), inset 0 4px 12px rgba(0,0,0,.6); }
.arc-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.arc-glass { position: absolute; inset: 0; pointer-events: none; opacity: .4;                  /* the old CRT glass, lightly scuffed */
  background: url(/ipod/scratches.webp?v=2) center / cover no-repeat, radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 62%, rgba(0,0,0,.5) 100%),
    linear-gradient(152deg, rgba(255,255,255,.1) 0%, rgba(255,255,255,.03) 38%, rgba(255,255,255,0) 39%); }
