/* A shelf of make-believe cartridges, labelled with real game captures. */
.shelf-invitation { margin: -2px 0 24px; color: #e4c79c; font-size: 20px; }
.shelf-invitation > span { color: #d8a662; margin-right: 6px; }
.game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 38px 28px; }
.game-grid .game-card { background: none; border: 0; border-radius: 0; padding: 0; box-shadow: none; min-width: 0; }
.game-grid .game-card:hover { transform: none; }
.pack-pick { display: flex; flex-direction: column; align-items: center; justify-content: end; width: 100%; height: 362px; padding: 8px 10px 0; border: 0; background: none; text-align: center; position: relative; isolation: isolate; }
.pack-pick::before { content: ""; position: absolute; z-index: -1; bottom: 30px; left: 0; right: 0; height: 14px; border: 1px solid #9a7249; border-radius: 3px; background: repeating-linear-gradient(0deg, #8a603c 0 2px, #986c43 2px 4px); box-shadow: 0 8px 10px #09070577, inset 0 2px #c69a6544; }
.pack-shell { --plastic: #b5b2a4; --edge: #58564c; --label: #e9dec2; position: relative; display: flex; flex: none; flex-direction: column; align-items: center; width: 268px; max-width: 100%; height: 306px; padding: 29px 23px 27px; color: #302d25; background: linear-gradient(110deg, #fff2, #0000 30%, #0002), var(--plastic); border: 3px solid var(--edge); border-radius: 13px 13px 7px 7px; box-shadow: inset 3px 3px 0 #fff3, inset -5px -3px 0 #0002, 5px 5px 0 #0f0c0980, 0 12px 17px #0c090b55; transition: transform .22s ease, box-shadow .22s ease; }
.pack-shell::before { content: ""; position: absolute; inset: 10px 7px auto; height: 14px; border: 1px solid #0003; border-radius: 3px; background: repeating-linear-gradient(0deg, #0002 0 1px, #fff1 1px 3px); }
.pack-grip { position: absolute; top: 39px; bottom: 30px; left: 6px; right: 6px; background: repeating-linear-gradient(0deg, #0002 0 2px, #fff1 2px 5px); border-radius: 2px; }
.pack-label { display: flex; flex-direction: column; width: 100%; height: 100%; z-index: 1; background: var(--label); border: 2px solid #0005; border-radius: 5px 5px 12px 5px; padding: 6px; overflow: hidden; box-shadow: 1px 2px 4px #0003; }
.pack-system { display: flex; justify-content: space-between; align-items: center; gap: 4px; color: #534839; font: 9px/1.3 ui-monospace, monospace; text-align: left; padding: 0 0 5px; white-space: nowrap; }
.pack-system > span { font-family: var(--font); font-size: 12px; color: #8e4f35; }
.pack-art { display: block; flex: 1; min-height: 0; background: #151513; border-radius: 2px; overflow: hidden; }
.pack-art img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.pack-label-title { font-size: 24px; font-weight: 700; line-height: 1.05; padding: 8px 1px 5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pack-label-bottom { display: flex; justify-content: space-between; border-top: 1px solid #59492c44; margin-top: auto; padding-top: 3px; font: 7px/1.5 ui-monospace, monospace; letter-spacing: .4px; color: #7a6d53; }
.pack-label-bottom > span { font: 10px/1 var(--font); letter-spacing: 0; }
.pack-screw { position: absolute; width: 8px; height: 8px; border-radius: 50%; border: 1px solid #0005; background: linear-gradient(135deg, #555 0 45%, #c2bead 45% 55%, #555 55%); bottom: 9px; box-shadow: 0 1px #fff4; }
.screw-left { left: 13px; }.screw-right { right: 13px; }
.pack-contacts { position: absolute; height: 10px; left: 28%; right: 28%; bottom: -5px; background: repeating-linear-gradient(90deg, #b38b39 0 4px, #383126 4px 7px); border: 2px solid #494334; border-radius: 2px; }
.pack-prompt { display: flex; gap: 14px; justify-content: center; width: 100%; padding-top: 18px; font-size: 17px; color: #ba9f7d; line-height: 1; }
.pack-prompt > span { color: #edc793; }
.pack-no-image { display: grid; place-items: center; height: 100%; color: #bca78d; font-size: 18px; padding: 16px; }
/* Handheld shells, optical-media sleeves, a PC box, and an arcade board. */
.media-advance { --plastic: #676080; --edge: #353045; width: 298px; height: 212px; padding: 27px 23px 23px; border-radius: 18px 18px 7px 7px; }
.media-advance .pack-label { border-radius: 6px; }
.media-advance .pack-label-title { font-size: 22px; padding: 5px 0 2px; }
.media-ds { --plastic: #535353; --edge: #242424; width: 224px; height: 250px; padding: 19px 15px 27px; border-radius: 4px 18px 4px 4px; }
.media-ds::before { display: none; }
.media-ds .pack-label { border-radius: 2px 10px 2px 2px; }
.media-ds .pack-contacts { left: 18%; right: 18%; }
.media-switch { --plastic: #3a3b3a; --edge: #191b1a; width: 214px; height: 270px; padding: 14px 14px 28px; border-radius: 4px 16px 5px 5px; }
.media-switch::before { display: none; }
.media-switch .pack-system { background: #ad493b; color: #fff0dc; margin: -6px -6px 6px; padding: 6px; }
.media-switch .pack-system > span { color: #fff0dc; }
.media-disc { --plastic: #999e96; --edge: #414740; width: 282px; height: 282px; padding: 13px 13px 14px 30px; border-radius: 3px; }
.media-disc::before { inset: 4px auto 4px 5px; width: 15px; height: auto; border-radius: 0; }
.media-disc .pack-label { border-radius: 1px; }
.media-disc .pack-contacts, .media-disc .pack-screw, .media-box .pack-contacts, .media-box .pack-screw { display: none; }
.media-umd { --plastic: #d7d4c9; --edge: #77786f; width: 278px; height: 224px; border-radius: 24px 24px 65px 65px; padding: 18px 28px 27px; }
.media-umd::before { display: none; }
.media-umd .pack-label { border-radius: 6px 6px 40px 40px; }
.media-umd .pack-contacts { display: none; }
.media-box { --plastic: #906546; --edge: #4f3424; width: 222px; height: 308px; padding: 11px 11px 11px 17px; border-radius: 2px; box-shadow: inset 8px 0 #0003, 7px 5px 0 #302218, 0 12px 17px #0c090b55; }
.media-box::before { display: none; }.media-box .pack-label { border-radius: 0; }
.media-arcade { --plastic: #53715e; --edge: #2e4936; width: 278px; height: 244px; padding: 20px 25px 27px; border-radius: 3px; background-image: repeating-linear-gradient(90deg, #b8c48222 0 1px, transparent 1px 20px); }
.media-arcade .pack-contacts { height: 17px; left: 12%; right: 12%; bottom: -10px; }
.media-arcade .pack-label { border-radius: 2px; }
.game-grid .card-body { padding: 20px 5px 0; color: #ead4b2; }
.game-grid .platform { color: #c4ac89; }
.game-grid .availability { color: #c2ce97; font-size: 17px; }
.game-grid .game-card h3 { color: #f0d7af; font-size: 27px; margin: 10px 0 5px; }
.game-grid .game-card .english { color: #9d896f; font-size: 10px; }
.game-grid .card-about { color: #c8b191; font-size: 19px; line-height: 1.55; }
.game-grid .card-footer { border-color: #655039; gap: 8px; flex-wrap: wrap; }
.game-grid .version { color: #a89070; font-size: 10px; }
.game-grid .card-links { gap: 14px; margin-left: auto; }
.game-grid .detail-button, .game-grid .download, .game-grid .card-links a { color: #edc58f; font-size: 18px; }
.game-grid .detail-button { text-decoration: underline; text-underline-offset: 4px; }
.game-grid .card-links > a, .game-grid .card-links > button { display: inline-flex; align-items: center; min-height: 44px; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .pack-pick:hover .pack-shell, .pack-pick:focus-visible .pack-shell { transform: translateY(-9px) rotate(-2deg); box-shadow: inset 3px 3px 0 #fff3, inset -5px -3px 0 #0002, 8px 15px 22px #0c090b77; }
}
.pack-pick:focus-visible { outline: 3px solid #edbf7f; outline-offset: 4px; border-radius: 8px; }
/* A single native dialog keeps focus contained throughout insertion and reveal. */
#details { max-width: 720px; width: calc(100% - 28px); padding: 22px 28px 28px; max-height: 90vh; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain; border: 3px solid #8c7355; border-radius: 18px; background: #eee0c4; }
#details .dialog-head { margin: -8px -10px 12px; position: sticky; top: -22px; z-index: 5; padding: 8px 10px; background: #eee0c4; border-bottom: 1px solid #cbb38f; }
#close-dialog { width: 44px; height: 44px; border: 1px solid #cbb38f; border-radius: 50%; background: #e2d0ae; font-family: system-ui, sans-serif; font-size: 20px; }
#details h2 { font-size: 33px; line-height: 1.2; }
#details .dialog-media { padding: 15px 15px 23px; border: 6px solid #6a6254; border-radius: 19px; background: #111610; box-shadow: inset 0 0 0 4px #292b23, 0 5px #b0a084; position: relative; }
#details .dialog-media::after { content: "1P + 2P"; position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; color: #928672; font: 8px/1 ui-monospace, monospace; letter-spacing: 3px; }
#details .dialog-media img { border-radius: 8px; max-height: 42vh; }
#details .dialog-actions a { font-size: 20px; min-height: 44px; }
#details[data-loading="false"] #game-introduction { animation: screen-on .3s ease-out; }
.insert-stage { text-align: center; }
.insert-scene { width: min(100%, 350px); height: 250px; position: relative; margin: 5px auto 0; isolation: isolate; overflow: hidden; }
/* Slot center: 89px console + 12px floor gap - 13px slot inset. */
.insert-pack-mask { position: absolute; inset: 0 0 88px; z-index: 2; overflow: hidden; }
.insert-pack { position: absolute; width: 142px; height: 168px; left: calc(50% - 71px); top: 0; z-index: 2; animation: insert-cartridge 1s cubic-bezier(.4,0,.2,1) both; }
.insert-pack .pack-shell { width: 142px; height: 168px; padding: 17px 12px 16px; border-width: 2px; border-radius: 7px 7px 3px 3px; box-shadow: inset 2px 2px #fff2, 3px 3px #0004; }
.insert-pack .pack-label { padding: 3px; border-width: 1px; border-radius: 2px; }
.insert-pack .pack-label-title { font-size: 15px; padding: 4px 0 2px; }
.insert-pack .pack-system { font-size: 6px; padding-bottom: 3px; }.insert-pack .pack-system > span { font-size: 8px; }
.insert-pack .pack-label-bottom { display: none; }
.insert-pack .pack-screw { width: 5px; height: 5px; bottom: 6px; }
.insert-pack .pack-contacts { height: 7px; }
.insert-pack .media-advance, .insert-pack .media-umd { height: 120px; margin-top: 48px; }
.insert-pack .media-umd { border-radius: 12px 12px 36px 36px; }
.insert-pack .media-umd .pack-label { border-radius: 3px 3px 23px 23px; }
.insert-pack .media-switch, .insert-pack .media-ds { width: 120px; margin-left: 11px; }
.insert-pack .media-switch, .insert-pack .media-ds { border-radius: 3px 12px 3px 3px; }
.insert-pack .media-disc { height: 142px; margin-top: 26px; padding-left: 18px; }
.insert-pack .media-arcade { height: 130px; margin-top: 38px; }
.insert-pack .media-switch .pack-system { margin: -3px -3px 3px; padding: 3px; }
.insert-machine { position: absolute; z-index: 3; width: 300px; max-width: 100%; height: 89px; left: 50%; transform: translateX(-50%); bottom: 12px; }
.machine-top { position: absolute; top: 0; left: 0; right: 0; height: 31px; background: linear-gradient(#c3b99d, #a79e86); border: 2px solid #5d5546; border-radius: 12px 12px 0 0; }
.machine-slot { position: absolute; top: 5px; left: 20%; right: 20%; height: 12px; background: #151812; border: 3px solid #776d5a; border-radius: 3px; box-shadow: inset 0 3px 5px #000; }
.machine-front { position: absolute; inset: 25px 0 0; z-index: 3; display: flex; align-items: center; gap: 13px; padding: 6px 20px; border: 2px solid #5d5546; border-radius: 0 0 10px 10px; background: linear-gradient(100deg, #9a5643 0 29%, #bbb095 29%); box-shadow: 0 6px #625944, 0 14px 14px #0003; }
.machine-brand { font-size: 17px; line-height: 1; text-align: left; color: #3b352a; margin-left: 26%; white-space: nowrap; }
.machine-brand small { display: block; font: 6px/1.7 ui-monospace, monospace; letter-spacing: 1px; }
.machine-light { position: absolute; left: 23px; top: 15px; width: 6px; height: 6px; border-radius: 50%; background: #7b2d25; animation: power-light 1s both; }
.machine-switch { position: absolute; left: 20px; bottom: 10px; width: 42px; height: 15px; border-radius: 3px; border: 2px solid #472a22; background: #b97b5e; box-shadow: 0 2px #472a22; }
.machine-vents { margin-left: auto; color: #716852; font-size: 14px; white-space: nowrap; }
.insertion-message { color: #674e35; font-size: 23px; line-height: 1.4; margin: 6px 0 15px; }
.insertion-message > span { display: block; font-size: 18px; color: #937857; }
.skip-insert { display: block; margin: 0 auto; padding: 10px 12px; border: 0; background: none; color: #765132; font-size: 18px; text-decoration: underline; text-underline-offset: 4px; }
@keyframes insert-cartridge { 0% { transform: translateY(-55px) rotate(-9deg); opacity: 0; } 20% { transform: translateY(-10px) rotate(0); opacity: 1; } 42% { transform: translateY(-10px); } 85%,100% { transform: translateY(180px); opacity: 1; } }
@keyframes power-light { 0%,78% { background: #7b2d25; } 85%,100% { background: #d3e68a; box-shadow: 0 0 7px #d3e68a; } }
@keyframes screen-on { from { opacity: .2; transform: translateY(5px); } to { opacity: 1; transform: none; } }
html:has(#details[open]) { overflow: hidden; }
@media (max-width: 1000px) { .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 28px; } }
@media (max-width: 600px) {
  .game-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .pack-pick { height: 350px; max-width: 350px; margin: auto; }
  .game-grid .card-body { max-width: 350px; width: 100%; margin: auto; padding: 19px 4px 0; }
  .game-grid .game-card h3 { font-size: 29px; }
  .shelf-invitation { font-size: 19px; }
  #details { padding: 18px 18px 24px; border-radius: 13px; }
  #details .dialog-head { top: -18px; }
  #details h2 { font-size: 29px; }
  #details .dialog-media { border-width: 4px; padding: 10px 10px 22px; }
  #details .dialog-actions { gap: 10px; }
  #details .dialog-actions a { font-size: 18px; padding: 10px; }
  .insert-scene { height: 242px; }
  .insert-machine { width: 270px; }
  .machine-front { gap: 8px; padding-left: 13px; padding-right: 13px; }
  .machine-brand { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .pack-shell, #game-introduction, .insert-pack, .machine-light { animation: none !important; transition: none !important; } }

.game-grid .availability.is-working { color: #e5ba77; }
.game-card .status-dot.working { background: #dca45e; }
