/* ======================= Arcade hub ======================= */
.ar-body { display: flex; flex-direction: column; }
.ar-hub { display: flex; flex-direction: column; gap: 16px; }
.ar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.ar-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; transition: transform .15s, border-color .15s, box-shadow .15s; }
.ar-card:hover { transform: translateY(-2px); border-color: var(--ar-c); box-shadow: 0 0 0 1px var(--ar-c), var(--shadow-sm); }
.ar-art { height: 112px; border-radius: 11px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); cursor: pointer; }
.ar-art svg { width: 100%; height: 100%; display: block; }
.ar-title { display: flex; align-items: center; gap: 8px; }
.ar-title h3 { font-size: 16.5px; flex: 1; }
.ar-best { display: inline-flex; align-items: center; gap: 4px; color: var(--amber); }
.ar-best svg { width: 14px; height: 14px; }
.ar-tag { color: var(--text-2); font-size: 13px; margin: 0; min-height: 38px; }
.ar-chips .chip svg { width: 13px; height: 13px; }
.ar-actions { margin-top: auto; }

.ar-view { display: flex; flex-direction: column; gap: 14px; flex: 1; min-height: 0; }
.ar-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ar-bar-title { display: flex; align-items: center; gap: 10px; }
.ar-bar-title .chip svg { width: 13px; height: 13px; }
.ar-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 10px currentColor; }
.ar-bestchip svg { width: 13px; height: 13px; }
.ar-host { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* shared game layout */
.ar-play { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; flex: 1; min-height: 0; }
.ar-stagewrap { position: relative; min-height: 0; display: flex; align-items: center; justify-content: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.ar-stagewrap canvas { display: block; }
.ar-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; }
.ar-side .panel-body { display: flex; flex-direction: column; gap: 10px; }
.ar-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ar-stats .stat { padding: 9px 11px; border-radius: 12px; }
.ar-stats .stat .v { font-size: 20px; }
.ar-stats .stat .k { font-size: 11px; }
.ar-banner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(3,7,14,.62); backdrop-filter: blur(3px); color: #fff; text-align: center; z-index: 5; padding: 20px; }
.ar-banner h2 { font-size: 30px; }
.ar-banner p { color: #cbd5e1; max-width: 380px; }
.ar-camera { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 16/10; border: 1px solid var(--line); }
.ar-camera video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.ar-camera canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ar-camera .ar-camnote { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px; color: #94a3b8; font-size: 12px; }
.ar-log { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; line-height: 1.55; max-height: 220px; overflow: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--text-2); }
.ar-log div { padding: 2px 0; border-bottom: 1px dashed var(--line); }
.ar-log div:last-child { border-bottom: 0; }
.ar-log .safe { color: var(--green); } .ar-log .mine { color: var(--red); } .ar-log .guess { color: var(--amber); }
.ar-kbd-hint { font-size: 12px; color: var(--text-3); }
.ar-meter { height: 12px; border-radius: 12px; background: var(--surface-3); overflow: hidden; position: relative; }
.ar-meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 12px; background: linear-gradient(90deg, var(--accent), var(--green)); transition: width .1s; }
.ar-meter b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); left: 55%; }

/* Mine sweeper */
.g-minesweeper .ar-stagewrap { padding: 12px; }
/* Mirror */
.g-mirror .g-mirror-face { width: 100%; height: 100%; max-width: 520px; max-height: 100%; padding: 10px; }
.g-mirror-target { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px 6px 8px; box-shadow: var(--shadow-sm); font-family: 'Space Grotesk'; font-weight: 700; font-size: 18px; }
.g-mirror-target .em { font-size: 26px; }
.g-mirror-count { position: absolute; top: 14px; right: 16px; z-index: 3; font-family: 'Space Grotesk'; font-size: 40px; font-weight: 700; color: var(--accent); }
.g-mirror-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.g-mirror-pick button { height: 40px; font-size: 18px; padding: 0; }
/* Simon */
.g-simon-seq { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; min-height: 64px; align-items: center; }
.g-simon-tile { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 28px; background: var(--surface-2); border: 1px solid var(--line); transition: transform .15s, box-shadow .15s, border-color .15s; }
.g-simon-tile.lit { transform: scale(1.12); border-color: var(--accent); box-shadow: var(--glow); background: var(--accent-soft); }
.g-simon-tile.ok { border-color: var(--green); background: rgba(52,211,153,.14); }
.g-simon-tile.bad { border-color: var(--red); background: rgba(248,113,113,.14); }
.g-simon-tile.hid { color: transparent; }
.g-simon-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.g-simon-pad button { height: 64px; flex-direction: column; gap: 2px; font-size: 24px; }
.g-simon-pad button small { font-size: 10.5px; color: var(--text-2); }
.g-simon-stage { flex-direction: column; gap: 14px; padding: 16px; }
.g-simon-face { width: 300px; height: 260px; }
.g-simon-big { font-size: 64px; height: 80px; line-height: 80px; }
/* Gem rush */
.g-gemrush-prog { display: flex; flex-wrap: wrap; gap: 6px; min-height: 46px; padding: 8px; border: 1px dashed var(--line-2); border-radius: 12px; background: var(--bg-2); align-content: flex-start; }
.g-gemrush-chip { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 9px; border-radius: 8px; color: #fff; font-weight: 600; font-size: 12.5px; cursor: pointer; border: 0; }
.g-gemrush-chip svg { width: 15px; height: 15px; }
.g-gemrush-chip.fwd { background: #0ea5c6; } .g-gemrush-chip.left { background: #7c3aed; } .g-gemrush-chip.right { background: #db2777; } .g-gemrush-chip.rep { background: #d97706; }
.g-gemrush-chip.active { outline: 3px solid var(--text); outline-offset: 1px; }
.g-gemrush-chip .x { opacity: .6; margin-left: 2px; }
.g-gemrush-palette { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.g-gemrush-palette .g-gemrush-chip { height: 38px; justify-content: center; }
.g-gemrush-levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.g-gemrush-levels button { height: 40px; flex-direction: column; gap: 0; font-size: 12px; padding: 0; }
.g-gemrush-levels button small { font-size: 10px; color: var(--amber); letter-spacing: 1px; }
.g-gemrush-rep { display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 10px; background: rgba(217,119,6,.12); border: 1px solid rgba(217,119,6,.5); }
.g-gemrush-rep.sel { box-shadow: 0 0 0 2px var(--amber); }
.g-gemrush-rep .head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--amber); }
.g-gemrush-rep .inner { display: flex; flex-wrap: wrap; gap: 4px; min-height: 30px; }
.g-gemrush-rep .head input { width: 44px; height: 24px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface-2); padding: 0 4px; }
@media (max-width: 1200px) { .ar-play { grid-template-columns: minmax(0, 1fr) 270px; } }
.g-gemrush-rep .head { flex-wrap: nowrap; gap: 4px; }
.g-gemrush-rep .head input { width: 38px; }
.g-gemrush-rep .head .btn.xs { height: 22px; padding: 0 6px; font-size: 11px; }
.g-gemrush-rep .inner { min-width: 0; }
.g-gemrush-rep .g-gemrush-rep { padding: 4px; }
.ar-side .seg button { padding: 0 8px; }
