/*
 * PiXiEED arcade — the shared look for the play tools (jigsaw, spot-the-difference, hidden object, sound, game maker).
 * Chunky pressable buttons, a title band with a moving picture, big choice tiles, difficulty cards with stars,
 * a heads-up bar while playing and a celebration when you finish. Components only; each tool places them.
 */
:root {
  --arc-night: #15202b; --arc-night-2: #1d2b38; --arc-ink: #17232d; --arc-paper: #fffdf7;
  --arc-red: #e75445; --arc-yellow: #ffd35a; --arc-green: #5fb36b; --arc-sky: #8ecdf0; --arc-blue: #315fd0; --arc-pink: #f3a6c0;
  --arc-line: rgba(255, 255, 255, .14); --arc-muted: rgba(255, 255, 255, .66);
  --arc-ease: cubic-bezier(.2, 1.3, .4, 1);
}

/* ---- a dark, lively panel with a faint pixel grid ---- */
.arc-panel { color: #fff; background-color: var(--arc-night); background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 12px 12px; border: 0; border-radius: 22px; box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 18px 40px rgba(21, 32, 43, .28); }

/* ---- title band: a picture that keeps assembling itself ---- */
.arc-title { position: relative; display: grid; justify-items: center; gap: 2px; padding: 10px 8px 4px; text-align: center; }
.arc-title canvas { width: 100%; max-width: 360px; height: 128px; image-rendering: pixelated; }
.arc-title-name { margin: 0; font-size: clamp(1.35rem, 6.2vw, 1.9rem); font-weight: 900; letter-spacing: .04em; line-height: 1.1; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.45), 0 0 18px rgba(255, 211, 90, .25); }
.arc-title-name b { color: var(--arc-yellow); }
.arc-title-sub { margin: 0; color: var(--arc-muted); font-size: .76rem; font-weight: 700; letter-spacing: .08em; }

/* ---- step labels ---- */
.arc-step { display: flex; align-items: center; gap: 8px; margin: 6px 2px 0; color: #fff; font-size: .86rem; font-weight: 900; letter-spacing: .06em; }
.arc-step-no { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--arc-yellow); color: var(--arc-ink); font-size: .8rem; box-shadow: 0 3px 0 #b88f1d; }

/* ---- pressable button base ---- */
.arc-press { position: relative; box-sizing: border-box; border: 2px solid transparent; border-radius: 16px; background: var(--arc-night-2); color: #fff; font: inherit; font-weight: 900; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.45); transition: transform .12s var(--arc-ease), box-shadow .12s, border-color .15s, background .15s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.arc-press:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(0,0,0,.45); }
.arc-press:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.45); }
.arc-press:focus-visible { outline: 3px solid var(--arc-yellow); outline-offset: 2px; }
.arc-press[aria-pressed="true"], .arc-press[aria-checked="true"] { border-color: var(--arc-yellow); background: #263a4b; box-shadow: 0 4px 0 #b88f1d, 0 0 0 4px rgba(255, 211, 90, .18); }
.arc-press:disabled { opacity: .38; cursor: default; transform: none; box-shadow: 0 2px 0 rgba(0,0,0,.35); }

/* ---- big choice tiles ---- */
.arc-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.arc-tile { display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 84px; padding: 8px 4px; font-size: .78rem; line-height: 1.2; text-align: center; }
.arc-tile svg { width: 34px; height: 34px; shape-rendering: crispEdges; }

/* ---- picture picker: a row of thumbnails ---- */
.arc-picks { display: flex; gap: 8px; min-height: 76px; padding: 4px 2px 8px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: thin; }
.arc-pick { flex: 0 0 72px; display: grid; place-items: center; width: 72px; height: 72px; padding: 4px; scroll-snap-align: start; overflow: hidden; }
.arc-pick img, .arc-pick canvas { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; pointer-events: none; }
.arc-pick--add { color: var(--arc-yellow); font-size: 1.6rem; }
.arc-picks-empty { align-self: center; margin: 0; color: var(--arc-muted); font-size: .8rem; font-weight: 700; }

/* ---- difficulty cards ---- */
.arc-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.arc-card { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 72px; padding: 8px; text-align: left; }
.arc-card canvas { width: 52px; height: 52px; border-radius: 8px; background: #0e161e; image-rendering: pixelated; }
.arc-card-name { display: block; font-size: .95rem; line-height: 1.15; }
.arc-card-stars { display: block; margin: 2px 0; color: var(--arc-yellow); font-size: .72rem; letter-spacing: 1px; }
.arc-card-stars i { color: rgba(255,255,255,.18); font-style: normal; }
.arc-card-count { display: block; color: var(--arc-muted); font-size: .72rem; font-weight: 700; }
.arc-card--1 .arc-card-name { color: #9be3a5; } .arc-card--2 .arc-card-name { color: var(--arc-sky); } .arc-card--3 .arc-card-name { color: #ffb38a; } .arc-card--4 .arc-card-name { color: #ff8fa3; }

/* ---- the start button ---- */
.arc-start { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 60px; padding: 10px 18px; border: 0; border-radius: 18px; background: var(--arc-yellow); color: var(--arc-ink); font: inherit; font-size: 1.2rem; font-weight: 900; letter-spacing: .08em; cursor: pointer; box-shadow: 0 6px 0 #b88f1d, 0 14px 30px rgba(255, 211, 90, .25); transition: transform .12s var(--arc-ease), box-shadow .12s; touch-action: manipulation; }
.arc-start::before { content: ""; width: 0; height: 0; border-style: solid; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent currentColor; }
.arc-start:not(:disabled) { animation: arc-glow 1.8s ease-in-out infinite; }
.arc-start:hover { transform: translateY(-2px); }
.arc-start:active { transform: translateY(4px); box-shadow: 0 2px 0 #b88f1d; }
.arc-start:disabled { background: #50606d; color: rgba(255,255,255,.7); box-shadow: 0 4px 0 #34414c; cursor: default; animation: none; }
.arc-start:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@keyframes arc-glow { 50% { box-shadow: 0 6px 0 #b88f1d, 0 14px 40px rgba(255, 211, 90, .55); } }
.arc-sub-button { width: 100%; min-height: 48px; padding: 8px 14px; font-size: .92rem; }

/* ---- heads-up bar while playing ---- */
.arc-hud { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 8px; min-height: 44px; padding: 5px 10px; border-radius: 14px; background: var(--arc-night); color: #fff; font-weight: 900; box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.arc-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: .76rem; white-space: nowrap; }
.arc-badge b { color: var(--arc-yellow); letter-spacing: 1px; }
.arc-timer { font: 900 1rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.arc-progress { display: grid; gap: 3px; min-width: 0; }
.arc-progress-label { display: flex; justify-content: flex-end; gap: 4px; color: var(--arc-muted); font-size: .68rem; white-space: nowrap; }
.arc-progress-label b { color: #fff; font-variant-numeric: tabular-nums; }
.arc-bar { position: relative; height: 10px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.12); }
.arc-bar span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--arc-green), var(--arc-yellow)); box-shadow: 0 0 10px rgba(255, 211, 90, .5); transition: width .45s var(--arc-ease); }
.arc-bar span::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.22) 0 4px, transparent 4px 8px); }
.arc-hud.is-bump .arc-bar { animation: arc-bump .35s var(--arc-ease); }
@keyframes arc-bump { 40% { transform: scaleY(1.6); } }

/* ---- floating "+1" ---- */
.arc-float { position: absolute; z-index: 5; pointer-events: none; color: var(--arc-yellow); font-weight: 900; font-size: 1.1rem; text-shadow: 0 2px 0 rgba(0,0,0,.4); animation: arc-float .9s ease-out forwards; }
@keyframes arc-float { from { opacity: 1; transform: translate(-50%, 0) scale(.8); } 30% { transform: translate(-50%, -12px) scale(1.2); } to { opacity: 0; transform: translate(-50%, -40px) scale(1); } }

/* ---- the celebration ---- */
.arc-win { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(12, 19, 26, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: arc-fade .3s ease-out; }
.arc-win[hidden] { display: none !important; }
.arc-win canvas.arc-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.arc-win-card { position: relative; display: grid; justify-items: center; gap: 10px; width: min(100%, 340px); padding: 20px 16px 16px; text-align: center; animation: arc-pop .5s var(--arc-ease); }
.arc-win-title { margin: 0; font-size: 2rem; font-weight: 900; letter-spacing: .1em; color: var(--arc-yellow); text-shadow: 0 4px 0 rgba(0,0,0,.4); }
.arc-win-stars { display: flex; gap: 6px; font-size: 1.7rem; color: var(--arc-yellow); }
.arc-win-stars i { font-style: normal; animation: arc-star .5s var(--arc-ease) both; }
.arc-win-stars i.is-off { color: rgba(255,255,255,.18); }
.arc-win-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; margin: 0; }
.arc-win-stats div { padding: 8px; border-radius: 12px; background: rgba(255,255,255,.08); }
.arc-win-stats dt { color: var(--arc-muted); font-size: .7rem; font-weight: 700; }
.arc-win-stats dd { margin: 2px 0 0; font: 900 1.15rem/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.arc-win-actions { display: grid; gap: 8px; width: 100%; }
@keyframes arc-fade { from { opacity: 0; } }
@keyframes arc-pop { from { transform: scale(.7); opacity: 0; } }
@keyframes arc-star { from { transform: scale(0) rotate(-40deg); } }

@media (prefers-reduced-motion: reduce) {
  .arc-start:not(:disabled), .arc-win, .arc-win-card, .arc-win-stars i, .arc-float, .arc-hud.is-bump .arc-bar { animation: none !important; }
  .arc-press, .arc-start, .arc-bar span { transition: none !important; }
}
.arc-burst { position: fixed; inset: 0; z-index: 60; width: 100vw; height: 100vh; pointer-events: none; }
.arc-win-title:focus { outline: none; }
