/* Game Boy Color player for /christmas-game?platform=gbc */
.gbc { margin: 24px 0; }
.gbc [hidden] { display: none !important; }
.gbc__stage { max-width: 640px; margin: 0 auto; padding: clamp(12px, 3vw, 22px); background: #2a2730; border-radius: 10px 10px 36px 10px; box-shadow: inset 0 0 0 2px #3b3742; }
.gbc__screen { position: relative; background: #000; border: 8px solid #141216; border-radius: 4px; outline: none; cursor: pointer; }
.gbc__screen:focus-visible { box-shadow: 0 0 0 3px var(--gold, #e2a43a); }
#gbc-canvas { display: block; width: 100% !important; height: auto !important; aspect-ratio: 160 / 144; image-rendering: pixelated; image-rendering: crisp-edges; }
.gbc__overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(10, 9, 12, .82); text-align: center; color: #f1f0ed; }
.gbc__msg { display: grid; gap: 12px; justify-items: center; max-width: 34ch; font: 500 15px/1.45 Inter, system-ui, sans-serif; }
.gbc__msg strong { font: 400 clamp(24px, 4vw, 34px)/1 'Bebas Neue', sans-serif; letter-spacing: .02em; }
.gbc__msg a { color: var(--gold, #e2a43a); font-weight: 600; }
.gbc__msg-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; }
.gbc__start { min-height: 52px; padding: 0 28px; background: var(--red, #b8352a); color: #fff; border: 0; font: 400 26px/1 'Bebas Neue', sans-serif; letter-spacing: .04em; cursor: pointer; }
.gbc__start:hover { background: var(--red-deep, #962a21); }
.gbc__start:focus-visible { outline: 3px solid var(--gold, #e2a43a); outline-offset: 3px; }
#gbc-loading strong::after { content: ''; display: block; width: 48px; height: 4px; margin: 14px auto 0; background: linear-gradient(90deg, #d7282f, #f2d22e, #2dab4f, #22a7d6); animation: gbcLoad 1s ease-in-out infinite alternate; }
@keyframes gbcLoad { from { transform: scaleX(.3); } to { transform: scaleX(1); } }

/* on-screen pad */
.gbc__pad { display: none; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 22px 6px 6px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.gbc.has-pad .gbc__pad { display: grid; }
.gbc__dpad { position: relative; justify-self: start; width: clamp(104px, 30vw, 132px); aspect-ratio: 1; touch-action: none; }
.gbc__dpad-x, .gbc__dpad-y { position: absolute; background: #141216; border-radius: 6px; pointer-events: none; }
.gbc__dpad-x { left: 0; right: 0; top: 33.3%; height: 33.4%; }
.gbc__dpad-y { top: 0; bottom: 0; left: 33.3%; width: 33.4%; }
.gbc__dpad-dot { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px; border-radius: 50%; background: #2a2730; pointer-events: none; }
.gbc__dpad[data-dir~="UP"] .gbc__dpad-y { box-shadow: inset 0 22px 0 -10px #4a4552; }
.gbc__dpad[data-dir~="DOWN"] .gbc__dpad-y { box-shadow: inset 0 -22px 0 -10px #4a4552; }
.gbc__dpad[data-dir~="LEFT"] .gbc__dpad-x { box-shadow: inset 22px 0 0 -10px #4a4552; }
.gbc__dpad[data-dir~="RIGHT"] .gbc__dpad-x { box-shadow: inset -22px 0 0 -10px #4a4552; }
.gbc__mid { display: flex; justify-content: center; gap: 10px; align-self: end; padding-bottom: 6px; }
.gbc__pill { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; height: 30px; padding: 0 10px; border-radius: 15px; background: #48444f; color: #d8d4dc; font: 700 11px/1 Inter, sans-serif; letter-spacing: .08em; text-transform: uppercase; transform: rotate(-20deg); }
.gbc__ab { justify-self: end; display: flex; gap: clamp(8px, 2.5vw, 14px); align-items: flex-end; }
.gbc__round { display: inline-flex; align-items: center; justify-content: center; width: clamp(50px, 14vw, 64px); height: clamp(50px, 14vw, 64px); border-radius: 50%; background: var(--red, #b8352a); color: #fff; font: 400 28px/1 'Bebas Neue', sans-serif; box-shadow: 0 4px 0 #6d1f18; }
.gbc__round--a { margin-bottom: clamp(22px, 7vw, 32px); }
.gbc__round--b { margin-bottom: 0; }
.gbc__round.is-down, .gbc__pill.is-down { transform: translateY(3px); box-shadow: 0 1px 0 #6d1f18; filter: brightness(1.15); }
.gbc__pill.is-down { transform: rotate(-20deg) translateY(2px); box-shadow: none; }

/* controls under the player */
.gbc__bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px auto 0; max-width: 640px; }
.gbc__bar button { min-height: 44px; padding: 0 16px; background: var(--ground-3, #2b2620); color: var(--light, #f1f0ed); border: 1px solid #4a4238; font: 600 15px Inter, sans-serif; cursor: pointer; }
.gbc__bar button:hover:not(:disabled) { border-color: var(--gold, #e2a43a); color: var(--gold, #e2a43a); }
.gbc__bar button:disabled { opacity: .45; cursor: not-allowed; }
.gbc__bar button[aria-pressed="true"] { background: var(--paper, #ebeae6); color: var(--ink, #15120f); border-color: var(--paper, #ebeae6); }
.gbc__bar button:focus-visible { outline: 3px solid var(--gold, #e2a43a); outline-offset: 2px; }
.gbc__keys { max-width: 640px; margin: 14px auto 0; font-size: var(--t-small, 15px); color: var(--light-soft, #b9b3a9); text-align: center; }
.gbc__keys kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; background: var(--paper, #ebeae6); color: var(--ink, #15120f); font: 700 13px Inter, sans-serif; text-align: center; }

/* fullscreen: the console fills the screen, the picture fits the height */
.gbc__stage:fullscreen { max-width: none; width: 100vw; height: 100vh; border-radius: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; background: #000; box-shadow: none; padding: 12px; box-sizing: border-box; }
.gbc__stage:fullscreen .gbc__screen { width: min(100%, calc((100vh - 40px) * 10 / 9)); }
.gbc.has-pad .gbc__stage:fullscreen .gbc__screen { width: min(100%, calc((100vh - 230px) * 10 / 9)); }
.gbc__stage:fullscreen .gbc__pad { width: min(100%, 640px); }

@media (max-width: 480px) {
  .xmas--gbc .xmas-play { padding-inline: 8px; }
  .xmas--gbc .xmas-play__head, .xmas--gbc .xmas-play__note { padding-inline: 8px; }
  .gbc__stage { padding: 10px; }
  .gbc__pad { gap: 6px; padding-top: 18px; grid-template-columns: auto minmax(0, 1fr) auto; }
  .gbc__dpad { width: 27vw; }
  .gbc__round { width: 13vw; height: 13vw; }
  .gbc__pill { min-width: 50px; height: 26px; font-size: 10px; }
  .gbc__mid { flex-direction: column; align-items: center; gap: 12px; }
  .gbc__bar button { flex: 1 1 calc(50% - 8px); }
}
@media (pointer: coarse) { .gbc__keys { display: none; } }
.xmas--gbc .xmas-map__stripes { background: linear-gradient(115deg, transparent 0 14%, #d7282f 14% 28%, #8a3fb8 28% 42%, #2dab4f 42% 56%, #f2d22e 56% 70%, #2f5fd0 70% 84%, transparent 84%); }
