/* Arcade games (/games/arcade, /games/arcade/{game}). Builds on play.css tokens (--pl-*). */
.ar-hub, .ar-game, .ar-more { --pl-ink: #0b1533; --pl-blue: #1463ff; --pl-mint: #6ff0bc; --pl-green: #0e9f6e; --pl-amber: #c77a00; --pl-violet: #7048e8; --pl-line: #dbe2ee; --pl-soft: #f3f6fb; --pl-muted: #5d6880; }
.ar-hero .pl-crumbs { margin-bottom: 12px; }
.ar-hero--game .pl-hero-ico { background: color-mix(in srgb, var(--ar-accent, #6ff0bc) 22%, transparent); color: #fff; }

/* Game cards (hub and "more games") */
.ar-cards { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.ar-cards a { position: relative; display: grid; grid-template-rows: auto 1fr; height: 100%; border-radius: 18px; overflow: hidden; text-decoration: none; color: var(--pl-ink); background: #fff; border: 1px solid var(--pl-line); transition: transform .14s ease, box-shadow .16s ease, border-color .16s; }
.ar-cards a:hover, .ar-cards a:focus-visible { transform: translateY(-2px); border-color: var(--ar-accent); box-shadow: 0 12px 28px rgba(11, 21, 51, .14); }
.ar-card-art { position: relative; display: grid; place-items: center; height: 112px; color: #fff; overflow: hidden;
  background: radial-gradient(160px 90px at 80% 0%, color-mix(in srgb, var(--ar-accent) 70%, transparent), transparent 70%),
              radial-gradient(180px 120px at 0% 120%, rgba(111, 240, 188, .28), transparent 70%), #0b1533; }
.ar-card-art::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px); background-size: 18px 18px; }
.ar-card-art svg { position: relative; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); }
.ar-card-body { display: grid; align-content: start; gap: 4px; padding: 14px 16px 16px; }
.ar-card-body small { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ar-accent); }
.ar-card-body b { font-family: var(--display); font-size: 19px; line-height: 1.15; }
.ar-card-body > span { font-size: 13.5px; line-height: 1.45; color: #3a465c; }
.ar-card-best { justify-self: start; margin-top: 6px; padding: 3px 9px; border-radius: 99px; background: #eafaf3; color: #075e43; font-style: normal; font-size: 12px; font-weight: 700; }
.ar-card-best[hidden] { display: none; }
.ar-about { margin: 6px 0 4px; padding: 18px 20px; border-radius: 18px; background: #fff; border: 1px solid var(--pl-line); }
.ar-about h2, .ar-more h2 { margin: 0 0 10px; font-family: var(--display); font-weight: 800; font-size: 21px; color: var(--pl-ink); }
.ar-about ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14.5px; line-height: 1.5; color: #3a465c; }
.ar-about b { color: var(--pl-ink); }
.ar-more { margin-top: 8px; }

/* Game page layout */
.ar-game { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; margin-bottom: 22px; }
.ar-main { min-width: 0; display: grid; gap: 10px; justify-items: center; padding: 16px; border-radius: 22px; background: #0b1533;
  background-image: radial-gradient(600px 240px at 50% -10%, rgba(20, 99, 255, .35), transparent 70%); }
.ar-stage-wrap { width: 100%; display: grid; justify-items: center; }
.ar-stage { position: relative; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px rgba(111, 240, 188, .25), 0 18px 40px rgba(0, 0, 0, .45); background: #0b1533; max-width: 100%; }
.ar-stage canvas { display: block; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; outline: none; }
.ar-stage canvas:focus-visible { box-shadow: inset 0 0 0 3px #6ff0bc; }
.ar-stage:fullscreen { display: grid; place-items: center; width: 100vw !important; height: 100vh !important; border-radius: 0; background: #0b1533; }
.ar-ov { position: absolute; inset: 0; display: grid; place-items: center; padding: 14px; overflow: auto; }
.ar-ov[hidden] { display: none; }
.ar-card { width: min(100%, 340px); padding: 20px 20px 18px; border-radius: 18px; text-align: center; color: #fff; background: rgba(11, 21, 51, .92); border: 1px solid rgba(111, 240, 188, .3); box-shadow: 0 20px 50px rgba(0, 0, 0, .45); backdrop-filter: blur(4px); animation: ar-pop .22s ease both; }
.ar-card--sm { width: min(100%, 280px); }
.ar-card h2 { margin: 2px 0 8px; font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.05; letter-spacing: -.01em; color: #fff; }
.ar-kicker { margin: 0; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #6ff0bc; }
.ar-tag { margin: 0 0 10px; font-size: 14px; line-height: 1.45; color: rgba(255, 255, 255, .82); }
.ar-keys { margin: 0 0 12px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, .07); font-size: 12.5px; line-height: 1.4; color: rgba(255, 255, 255, .75); }
.ar-theme { display: inline-flex; gap: 6px; align-items: center; margin: 0 0 8px; padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .1); font-size: 12.5px; font-weight: 700; }
.ar-theme img { width: 18px; height: 18px; border-radius: 4px; background: #fff; }
.ar-best { margin: 0 0 12px; font-size: 13.5px; color: rgba(255, 255, 255, .8); }
.ar-best b { color: #ffc94d; }
.ar-score { margin: 4px 0 4px; font-family: var(--display); font-weight: 800; font-size: 46px; line-height: 1; color: #6ff0bc; font-variant-numeric: tabular-nums; }
.ar-score small { display: block; margin-top: 4px; font-family: inherit; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.ar-lesson { margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; text-align: left; background: rgba(111, 240, 188, .1); border: 1px solid rgba(111, 240, 188, .28); }
.ar-lesson b { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #6ff0bc; }
.ar-lesson p { margin: 4px 0 6px; font-size: 13.5px; line-height: 1.45; color: #fff; }
.ar-lesson a { font-size: 13px; font-weight: 700; color: #9fc0ff; }
.ar-go, .ar-ghost { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; margin-top: 2px; border-radius: 12px; border: 0; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; transition: transform .1s, background .15s; }
.ar-go { background: #6ff0bc; color: #0b1533; }
.ar-go:hover { background: #8ff5cd; }
.ar-go:active, .ar-ghost:active { transform: translateY(1px) scale(.99); }
.ar-ghost { margin-top: 8px; min-height: 44px; background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, .3); font-size: 14.5px; }
.ar-go:focus-visible, .ar-ghost:focus-visible, .ar-tb:focus-visible, .ar-pad-btn:focus-visible { outline: 3px solid #ffc94d; outline-offset: 2px; }

/* Toolbar and touch pad */
.ar-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ar-tb { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .07); color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.ar-tb:hover { background: rgba(255, 255, 255, .14); }
.ar-tb .ar-i-pause, .ar-tb.is-play .ar-i-play { display: inline; }
.ar-tb .ar-i-play, .ar-tb.is-play .ar-i-pause { display: none; }
.ar-tb .ar-i-off, .ar-tb.is-off .ar-i-on { display: none; }
.ar-tb.is-off .ar-i-off { display: inline; }
.ar-tb[data-act="pause"].is-play { background: #6ff0bc; color: #0b1533; border-color: #6ff0bc; }
.ar-pad { display: none; width: 100%; max-width: 420px; gap: 8px; }
.ar-pad-btn { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 58px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .09); color: #fff; font: inherit; font-weight: 800; font-size: 15px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.ar-pad-btn.is-on { background: rgba(111, 240, 188, .3); border-color: #6ff0bc; }
.ar-pad-action { flex-grow: 1.4; background: rgba(111, 240, 188, .16); border-color: rgba(111, 240, 188, .5); color: #6ff0bc; }
@media (pointer: coarse), (max-width: 760px) { .ar-pad { display: flex; } }

/* Side panels */
.ar-side { display: grid; gap: 14px; }
.ar-panel { padding: 16px 18px; border-radius: 18px; background: #fff; border: 1px solid var(--pl-line); }
.ar-panel h2 { margin: 0 0 10px; font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--pl-ink); }
.ar-how { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; line-height: 1.45; color: #3a465c; }
.ar-controls { margin: 0; display: grid; gap: 8px; }
.ar-controls div { padding: 8px 10px; border-radius: 10px; background: var(--pl-soft); }
.ar-controls dt { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--pl-muted); }
.ar-controls dd { margin: 2px 0 0; font-size: 13.5px; color: var(--pl-ink); }
.ar-note { margin: 0 0 10px; font-size: 12.5px; line-height: 1.45; color: var(--pl-muted); }
.ar-note a { color: var(--pl-blue); font-weight: 600; }
.ar-plats { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 4px; }
.ar-plats li { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--pl-line); }
.ar-plats li:last-child { border-bottom: 0; }
.ar-plats img { flex: none; width: 20px; height: 20px; border-radius: 5px; background: #fff; }
.ar-plats span { flex: 1; min-width: 0; display: grid; }
.ar-plats span a { font-weight: 700; font-size: 14px; color: var(--pl-ink); text-decoration: none; }
.ar-plats span a:hover { color: var(--pl-blue); text-decoration: underline; }
.ar-plats small { font-size: 12px; line-height: 1.35; color: var(--pl-muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ar-run { flex: none; padding: 5px 9px; border-radius: 8px; border: 1px solid var(--pl-line); font-size: 12px; font-weight: 700; color: var(--pl-blue); text-decoration: none; white-space: nowrap; min-height: 32px; display: inline-flex; align-items: center; }
.ar-run:hover { border-color: var(--pl-blue); background: #f6f9ff; }

@keyframes ar-pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 980px) {
  .ar-game { grid-template-columns: minmax(0, 1fr); }
  .ar-side { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 560px) {
  .ar-main { padding: 10px 6px 12px; border-radius: 16px; margin: 0 -4px; }
  .ar-tb { padding: 8px 10px; font-size: 13px; }
  .ar-tb[data-act="full"] span, .ar-tb[data-act="restart"] span { display: none; }
  .ar-card { padding: 16px 14px 14px; }
  .ar-card h2 { font-size: 24px; }
  .ar-score { font-size: 40px; }
  .ar-cards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .ar-card { animation: none; }
  .ar-cards a, .ar-go { transition: none; }
}
