/* Minigames em clima de fliperama: salão 3D no fundo, degradê preto por cima, controle 3D e seletor neon. */
body[data-page='minigames'] { --neo-p: #ff3fa4; --neo-c: #39e6ff; --neo-y: #ffd36e; --neo-g: #6dff9c; --hud: ui-monospace, 'SF Mono', 'Roboto Mono', Menlo, Consolas, monospace; background: #050308; }

/* ---------- Fundo ---------- */
.arc-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: #07030c; }
.arc-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .5s ease; }
.arc-bg.pronto canvas { opacity: 1; }
/* Sem WebGL: salão em CSS (grade neon que corre e brilho no horizonte). */
.arc-bg::before { content: none; position: absolute; left: -50%; right: -50%; top: 52%; height: 80%; transform: perspective(380px) rotateX(68deg); transform-origin: top;
  background: linear-gradient(#ff3fa455 2px, transparent 2px) 0 0 / 100% 46px, linear-gradient(90deg, #ff3fa444 2px, transparent 2px) 0 0 / 46px 100%;
  animation: arc-floor 1.6s linear infinite; }
.arc-bg::after { content: none; position: absolute; left: 0; right: 0; top: 30%; height: 30%; background: radial-gradient(50% 80% at 50% 100%, #ff3fa455, #7a2cff22 45%, transparent 70%); }
.arc-bg.falhou::before, .arc-bg.falhou::after { content: ''; }
@keyframes arc-floor { to { background-position: 0 46px, 0 0; } }
/* Degradê preto por cima pra dar contraste, mais scanlines e vinheta. */
.arc-shade { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, #0000 0 2px, #0000002e 2px 3px),
    radial-gradient(120% 80% at 50% 45%, transparent 40%, #000c 100%),
    linear-gradient(to bottom, #000000e6 0%, #00000080 22%, #0000004d 42%, #000000b3 68%, #000000f2 100%); }
body[data-page='minigames'] .top { background: #050308cc; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.arc { position: relative; z-index: 1; display: grid; gap: 4px; padding-top: 4px; padding-bottom: 32px; }
@media (min-width: 900px) { .arc { grid-template-columns: 1.05fr 1fr; align-items: center; gap: 40px; padding-top: 14px; min-height: calc(100vh - 62px - var(--tabbar)); } }

/* ---------- Hero ---------- */
.arc-hero { display: grid; justify-items: center; text-align: center; }
.arc-title { position: relative; margin-top: 6px; font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: clamp(3.2rem, 17vw, 6.2rem); line-height: .9; letter-spacing: .01em; text-transform: uppercase; color: #fff4fb;
  text-shadow: 0 0 6px #fff, 0 0 18px var(--neo-p), 0 0 42px var(--neo-p), 0 0 80px #ff3fa488; animation: arc-flicker 6s infinite; }
.arc-title::before, .arc-title::after { content: attr(data-text); position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.arc-title::before { color: var(--neo-c); text-shadow: none; mix-blend-mode: screen; animation: arc-glitch 5s infinite steps(1); }
.arc-title::after { color: var(--neo-p); text-shadow: none; mix-blend-mode: screen; animation: arc-glitch 5s .08s infinite steps(1) reverse; }
@keyframes arc-flicker { 0%, 18%, 20%, 54%, 56%, 100% { opacity: 1; } 19%, 55% { opacity: .55; } }
@keyframes arc-glitch { 0%, 91%, 100% { opacity: 0; transform: none; } 92% { opacity: .8; transform: translate(-4px, 1px); clip-path: inset(10% 0 55% 0); } 94% { opacity: .8; transform: translate(4px, -1px); clip-path: inset(60% 0 8% 0); } 96% { opacity: 0; } }
.arc-blink { margin-top: 6px; font-family: var(--hud); font-size: .82rem; letter-spacing: .32em; text-transform: uppercase; color: var(--neo-y); text-shadow: 0 0 10px #ffd36e99; animation: arc-blink 1.1s steps(1) infinite; }
@keyframes arc-blink { 50% { opacity: 0; } }
.arc-pad { position: relative; width: min(100%, 460px); aspect-ratio: 1.55; min-height: 96px; margin-top: -6px; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: grab; }
.arc-pad:active { cursor: grabbing; }
.arc-pad::before { content: ''; position: absolute; left: 12%; right: 12%; bottom: 6%; height: 16%; border-radius: 50%; background: radial-gradient(closest-side, #ff3fa466, #39e6ff22 60%, transparent); filter: blur(6px); animation: arc-floorglow 4s ease-in-out infinite; }
@keyframes arc-floorglow { 50% { opacity: .55; transform: scaleX(.9); } }
.arc-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .35s ease; }
.arc-pad.pronto canvas { opacity: 1; }
.arc-pad-css { position: absolute; inset: 14% 8%; width: 84%; height: 72%; filter: drop-shadow(0 0 14px #39e6ff66); animation: arc-swing 5s ease-in-out infinite; display: none; }
.arc-pad.falhou .arc-pad-css { display: block; }
@keyframes arc-swing { 0%, 100% { transform: perspective(600px) rotateY(-24deg) rotateX(8deg) translateY(0); } 50% { transform: perspective(600px) rotateY(24deg) rotateX(4deg) translateY(-8px); } }
.arc-drag { margin-top: -18px; position: relative; font-family: var(--hud); font-size: .68rem; letter-spacing: .24em; text-transform: uppercase; color: #ffffff59; }
.arc-pad:not(.pronto, .falhou) + .arc-drag, .arc-pad.falhou + .arc-drag { visibility: hidden; }

/* ---------- Seletor ---------- */
.arc-select { position: relative; display: grid; gap: 16px; padding: 18px; border-radius: 22px; isolation: isolate;
  background: linear-gradient(160deg, #1a0f2bcc, #07040ccc); border: 1px solid #39e6ff33;
  box-shadow: 0 0 0 1px #00000080, 0 30px 80px #000c, inset 0 0 60px #39e6ff0d; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
/* cantoneiras de HUD */
.arc-select::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; padding: 2px;
  background: conic-gradient(from var(--arc-a, 0deg), transparent 0 70%, var(--neo-c) 80%, var(--neo-p) 90%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: arc-spin 6s linear infinite; }
.arc-select::after { content: ''; position: absolute; inset: 8px; border-radius: 16px; pointer-events: none; z-index: -1;
  background: linear-gradient(var(--neo-c), var(--neo-c)) 0 0 / 18px 2px, linear-gradient(var(--neo-c), var(--neo-c)) 0 0 / 2px 18px,
    linear-gradient(var(--neo-c), var(--neo-c)) 100% 100% / 18px 2px, linear-gradient(var(--neo-c), var(--neo-c)) 100% 100% / 2px 18px; background-repeat: no-repeat; opacity: .7; }
@property --arc-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes arc-spin { to { --arc-a: 360deg; } }
.arc-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--hud); font-size: .78rem; letter-spacing: .26em; text-transform: uppercase; }
.arc-head span:first-child { color: var(--neo-c); text-shadow: 0 0 10px #39e6ffaa; }
.arc-head span:first-child::before { content: '▸ '; animation: arc-blink 1s steps(1) infinite; }
.arc-count { color: #ffffff66; }
.arc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding-top: 12px; }
.arc-tile { --c: var(--neo-c); position: relative; aspect-ratio: 1; padding: 0; display: grid; place-items: center; border-radius: 20px; border: 1px solid #ffffff1f; cursor: pointer;
  background: radial-gradient(90% 90% at 50% 0%, #ffffff14, transparent 60%), #0d0914; box-shadow: inset 0 -6px 0 #00000066, 0 6px 16px #0008;
  transition: transform .18s cubic-bezier(.3, 1.5, .5, 1), box-shadow .25s, border-color .25s; }
.arc-tile .arc-icon { width: 78%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 16px; overflow: hidden; }
.arc-tile.t-pv { --c: var(--neo-p); }
.t-pv .arc-icon { background: linear-gradient(150deg, #2b2b31, #0d0d10); }
.t-pv .arc-icon svg { width: 88%; height: 88%; }
.t-cem { --c: var(--neo-y); }
.t-cem .arc-icon { background: linear-gradient(150deg, #ffd36e, #e0902f); }
.t-cem .arc-icon b { font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: clamp(1.2rem, 6vw, 1.9rem); color: #2a1530; text-shadow: 2px 2px 0 #ee5a9299; }
.arc-tile[aria-pressed='true'] { border-color: var(--c); transform: translateY(-4px); box-shadow: 0 0 0 1px var(--c), 0 0 22px color-mix(in srgb, var(--c) 55%, transparent), inset 0 0 18px color-mix(in srgb, var(--c) 25%, transparent), 0 14px 26px #000a; }
/* cursor P1 em cima do selecionado */
.arc-tile[aria-pressed='true']::after { content: 'P1'; position: absolute; top: -13px; left: 50%; translate: -50% 0; padding: 1px 6px; border-radius: 6px; background: var(--c); color: #0a0610; font: 800 .6rem/1.4 var(--hud); letter-spacing: .1em; animation: arc-bob .9s ease-in-out infinite; }
@keyframes arc-bob { 50% { transform: translateY(-3px); } }
/* varredura de luz no selecionado */
.arc-tile[aria-pressed='true'] .arc-icon { position: relative; }
.arc-tile[aria-pressed='true'] .arc-icon::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, #ffffff55 50%, transparent 65%) -200% 0 / 250% 100% no-repeat; animation: arc-sheen 2.4s ease-in-out infinite; }
@keyframes arc-sheen { 60%, 100% { background-position: 200% 0; } }
.arc-tile:active { transform: translateY(-1px) scale(.95); }
.arc-tile:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.arc-empty { cursor: default; border-style: dashed; border-color: #ffffff1a; background: repeating-linear-gradient(45deg, #ffffff05 0 6px, transparent 6px 12px), #08060c; box-shadow: none; }
.arc-empty svg { width: 30%; fill: none; stroke: #ffffff33; stroke-width: 1.6; stroke-linecap: round; }

/* tela de info (estilo monitor CRT) */
.arc-screen { position: relative; display: grid; gap: 6px; padding: 16px; border-radius: 16px; overflow: hidden; background: radial-gradient(120% 140% at 50% 0%, #102a33, #05080b 70%); border: 1px solid #39e6ff40; box-shadow: inset 0 0 40px #39e6ff1a; }
.arc-screen::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, #ffffff08 0 1px, transparent 1px 3px); animation: arc-roll 8s linear infinite; }
@keyframes arc-roll { to { background-position: 0 300px; } }
.arc-tag { font-family: var(--hud); font-size: .7rem; letter-spacing: .26em; text-transform: uppercase; color: var(--neo-c); }
.arc-name { font-family: var(--display); font-weight: 800; font-stretch: 78%; font-size: clamp(1.7rem, 7.5vw, 2.4rem); line-height: 1; text-transform: uppercase; color: #fff; text-shadow: 0 0 14px #39e6ff88; }
.arc-meta { font-family: var(--hud); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: #ffffff99; }
.arc-screen.troca .arc-name, .arc-screen.troca .arc-meta, .arc-screen.troca .arc-tag { animation: arc-swap .32s steps(4); }
@keyframes arc-swap { 0% { opacity: 0; transform: translateX(-6px); filter: blur(2px); } 50% { opacity: 1; transform: translateX(3px); } 100% { transform: none; filter: none; } }
.arc-start { justify-self: start; margin-top: 8px; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 99px; border: 0;
  background: radial-gradient(120% 120% at 50% 0%, #ff7cc3, var(--neo-p) 55%, #b8126a); color: #fff; font: 800 1rem/1 var(--hud); letter-spacing: .24em; text-transform: uppercase; text-decoration: none;
  box-shadow: 0 6px 0 #7d0b47, 0 0 26px #ff3fa488, inset 0 2px 0 #ffffff66; transition: transform .1s, box-shadow .1s; animation: arc-breathe 1.8s ease-in-out infinite; }
.arc-start:active { transform: translateY(5px); box-shadow: 0 1px 0 #7d0b47, 0 0 34px #ff3fa4cc, inset 0 2px 0 #ffffff66; }
.arc-start[aria-disabled='true'] { background: #26202c; color: #ffffff66; box-shadow: 0 6px 0 #120e16; animation: none; cursor: not-allowed; }
@keyframes arc-breathe { 50% { box-shadow: 0 6px 0 #7d0b47, 0 0 40px #ff3fa4cc, inset 0 2px 0 #ffffff66; } }

/* transição de "liga o jogo" (CRT) */
.arc-crt { position: fixed; inset: 0; z-index: 100; pointer-events: none; background: #000; display: grid; place-items: center; animation: arc-crt-bg .55s forwards; }
.arc-crt::before { content: ''; width: 100%; height: 100%; background: #fff; animation: arc-crt .55s cubic-bezier(.7, 0, .3, 1) forwards; }
@keyframes arc-crt { 0% { transform: scale(1, 1); opacity: 0; } 25% { opacity: .9; transform: scale(1, .006); } 70% { transform: scale(.002, .006); opacity: 1; } 100% { transform: scale(0, 0); opacity: 0; } }
@keyframes arc-crt-bg { from { background: transparent; } 20% { background: #000; } }

@media (prefers-reduced-motion: reduce) {
  .arc-bg::before, .arc-title, .arc-title::before, .arc-title::after, .arc-blink, .arc-pad::before, .arc-pad-css,
  .arc-select::before, .arc-head span:first-child::before, .arc-tile[aria-pressed='true']::after, .arc-tile[aria-pressed='true'] .arc-icon::after,
  .arc-screen::after, .arc-start, .arc-screen.troca * { animation: none !important; }
}

/* Telas baixas no celular: tudo mais justo pra caber até o START sem rolar. */
@media (max-width: 899px) and (max-height: 780px) {
  .arc-title { margin-top: 2px; font-size: clamp(2.6rem, 13vw, 3.6rem); }
  .arc-blink { margin-top: 4px; font-size: .74rem; }
  .arc-select { gap: 10px; padding: 12px 14px 14px; }
  .arc-grid { gap: 10px; padding-top: 10px; }
  .arc-screen { gap: 3px; padding: 10px 14px 12px; }
  .arc-name { font-size: clamp(1.45rem, 6.5vw, 1.9rem); }
  .arc-meta { font-size: .68rem; }
  .arc-start { min-height: 44px; margin-top: 6px; padding: 0 22px; }
  .arc-drag { margin-top: -14px; }
}
