/* Live15 skill arcade chrome — cleaned from working reference patterns */

.g-root {
  --g-mgap: 10px;
  --g-accent: var(--accent, #7c5cff);
  --g-accent-2: color-mix(in srgb, var(--accent, #7c5cff) 55%, #fff);
  --g-text: var(--ink, #eef0ff);
  --g-panel: var(--panel, #1e2130);
  --g-tile: color-mix(in srgb, var(--panel, #1e2130) 82%, var(--ink, #fff));
  --g-muted: var(--mute, #8a8fa8);
  --g-bg: var(--bg, #14161f);
  --g-danger: #ff4d6d;
  --g-font: var(--fb, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  --g-radius: 16px;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px;
  overflow: hidden;
  border-radius: var(--g-radius);
  background: var(--g-bg);
  color: var(--g-text);
  font-family: var(--g-font);
  line-height: 1.3;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.g-root *, .g-root *::before, .g-root *::after { box-sizing: border-box; }
.g-root [hidden] { display: none !important; }
.g-root:focus-visible { box-shadow: 0 0 0 3px var(--g-accent); }

.g-hud { display: flex; align-items: stretch; gap: 8px; margin-bottom: 10px; }
.g-stat {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 10px;
  border-radius: calc(var(--g-radius) * 0.6);
  background: var(--g-panel);
}
.g-stat-l {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--g-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-stat-v { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
.g-lives { display: flex; gap: 5px; height: 23px; align-items: center; }
.g-life {
  width: 14px;
  height: 14px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg) scale(0.85);
  background: var(--g-danger);
  transition: opacity 0.2s, transform 0.2s;
}
.g-life.is-off { opacity: 0.18; transform: rotate(-45deg) scale(0.6); }

.g-bar {
  height: 6px;
  margin: -2px 0 10px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--g-panel);
}
.g-bar-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--g-accent), var(--g-accent-2));
  transition: transform 0.1s linear;
}
.g-bar-fill.is-low { background: var(--g-danger); }

.g-cap {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  color: var(--g-muted);
}
.g-cap.g-cap-cta { color: var(--g-text); font-weight: 700; animation: g-pulse 1.6s ease-in-out infinite; }

.g-btn {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  padding: 12px 24px;
  border-radius: 999px;
  color: #111;
  background: linear-gradient(135deg, var(--g-accent), var(--g-accent-2));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
.g-btn:hover { filter: brightness(1.08); }
.g-btn:active { transform: translateY(1px) scale(0.98); }

.g-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-radius: inherit;
  background: color-mix(in srgb, var(--g-bg) 70%, transparent);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  animation: g-fade 0.2s ease both;
}
.g-ov-card {
  width: 100%;
  max-width: 300px;
  padding: 22px 20px;
  text-align: center;
  border-radius: var(--g-radius);
  background: color-mix(in srgb, var(--g-panel) 70%, var(--g-text) 12%);
  border: 1px solid color-mix(in srgb, var(--g-text) 28%, transparent);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  animation: g-rise 0.28s cubic-bezier(0.2, 0.8, 0.3, 1.2) both;
}
.g-ov-title { font-size: 22px; font-weight: 900; }
.g-ov-sub { margin: 8px 0 18px; font-size: 14px; color: var(--g-muted); }
.g-ov-score {
  margin: 6px 0 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--g-muted);
}
.g-ov-score b {
  display: block;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--g-text);
}

/* Fixed aspect stage — NEVER percentage-of-self feedback */
.g-stage {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 360 / 450;
  height: auto;
  max-height: 70vh;
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
  border-radius: calc(var(--g-radius) * 0.75);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--g-accent) 16%, var(--g-panel)),
    var(--g-panel) 75%
  );
}
.g-stage canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.g-root .pl-stage {
  border: 2px solid color-mix(in srgb, var(--g-text) 35%, transparent);
  background: var(--g-panel);
}
.pl-cg .g-stat, .pl-rt .g-stat, .pl-ot .g-stat, .pl-pw .g-stat, .pl-gd .g-stat {
  border: 1px solid color-mix(in srgb, var(--g-text) 18%, transparent);
}

/* Odd tile board */
.pl-ot-board {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 12px;
  aspect-ratio: 1;
  border: 2px solid color-mix(in srgb, var(--g-text) 30%, transparent);
  border-radius: calc(var(--g-radius) * 0.75);
  background: var(--g-panel);
  touch-action: manipulation;
}
.pl-ot-grid {
  position: absolute;
  inset: 12px;
  display: grid;
  gap: 8px;
}
.pl-ot-n5 { gap: 6px; }
.pl-ot-n6, .pl-ot-n7 { gap: 5px; }
.pl-ot-tile {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
}
.pl-ot-n5 .pl-ot-tile { border-radius: 10px; }
.pl-ot-n6 .pl-ot-tile, .pl-ot-n7 .pl-ot-tile { border-radius: 8px; }
.pl-ot-tile:active { transform: scale(0.94); }
.pl-ot-tile:focus-visible, .pl-ot-tile.is-cur { outline: 3px solid var(--g-text); outline-offset: 2px; }
.pl-ot-tile.is-wrong { animation: pl-ot-no 0.3s ease; }
.pl-ot-tile.is-reveal { outline: 4px solid var(--g-text); outline-offset: -4px; }
.pl-ot-board.is-ok { animation: pl-pop 0.22s ease; }
.pl-ot-board.is-bad { animation: pl-shake 0.3s ease; }

.pl-gd-pad { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; }
.pl-gd-key {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: var(--g-panel);
  color: var(--g-text);
}
.pl-gd-key:active { filter: brightness(1.1); }

.game-stage { max-width: 560px; margin: 0 auto; }
.credit-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  font-weight: 600;
}

@keyframes g-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes g-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes g-rise {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes pl-ot-no {
  0%, 100% { transform: none; }
  30% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
}
@keyframes pl-shake {
  0%, 100% { transform: none; }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
@keyframes pl-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .g-cap.g-cap-cta, .g-overlay, .g-ov-card, .pl-ot-tile.is-wrong, .pl-ot-board.is-ok, .pl-ot-board.is-bad {
    animation: none !important;
  }
}

/* Echo Flash pads — skillgamebench only */
.pl-ef-board {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  aspect-ratio: 1;
  padding: 14px;
  border: 2px solid color-mix(in srgb, var(--g-text) 28%, transparent);
  border-radius: calc(var(--g-radius) * 0.75);
  background: var(--g-panel);
}
.pl-ef-grid {
  position: absolute;
  inset: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
}
.pl-ef-pad {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  background: color-mix(in srgb, var(--g-tile) 80%, var(--g-text));
  transition: background 0.12s, transform 0.12s, box-shadow 0.12s;
}
.pl-ef-pad:active { transform: scale(0.96); }
.pl-ef-pad.is-lit {
  background: var(--g-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--g-accent) 45%, transparent);
}
