/* Gry / games cluster */
.vpm-arena,
.afs-list,
.bn-poster-wrap {
  margin-top: 0.4rem;
}

.vpm-shell {
  display: grid;
  gap: 1rem;
}

.vpm-stage {
  position: relative;
  min-height: 320px;
  border-radius: var(--radius, 14px);
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, color-mix(in srgb, #1d4ed8 14%, transparent), transparent 40%),
    linear-gradient(180deg, var(--bg-card), color-mix(in srgb, #ea580c 10%, var(--bg-card)));
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.vpm-rail {
  position: absolute;
  left: 50%;
  top: 1.2rem;
  bottom: 1.2rem;
  width: 42px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  overflow: hidden;
}

.vpm-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  background: linear-gradient(180deg, #38bdf8, #fb923c);
  transition: height 80ms linear;
}

.vpm-target {
  position: absolute;
  left: 50%;
  width: 92px;
  height: 92px;
  margin-left: -46px;
  bottom: 8%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff 0 8%, transparent 9%),
    repeating-radial-gradient(circle, #ef4444 0 10px, #f8fafc 10px 20px);
  box-shadow: 0 10px 24px color-mix(in srgb, #ea580c 35%, transparent);
  transition: bottom 80ms linear;
}

.vpm-live {
  position: absolute;
  right: 1rem;
  top: 1rem;
  font: 800 2rem/1 var(--font-mono, ui-monospace, monospace);
  color: var(--text);
}

.vpm-timer {
  position: absolute;
  left: 1rem;
  top: 1rem;
  font-weight: 700;
}

.vpm-status {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.vpm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.afs-list {
  display: grid;
  gap: 0.85rem;
}

.afs-card {
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius, 14px);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

.afs-card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
}

.afs-card-top h3 {
  margin: 0;
  font-size: 1.05rem;
}

.afs-card-top strong {
  font-family: var(--font-mono, ui-monospace, monospace);
}

.afs-bar {
  height: 10px;
  margin: 0.55rem 0 0.7rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  overflow: hidden;
}

.afs-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #fb923c);
}

.afs-card.is-win { box-shadow: 0 0 0 1px color-mix(in srgb, #38bdf8 35%, transparent); }
.afs-card.is-lose { box-shadow: 0 0 0 1px color-mix(in srgb, #fb7185 30%, transparent); }

.afs-verdict,
.afs-roast {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
}

.afs-verdict { font-weight: 600; color: var(--text); }

.bn-poster-wrap {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
}

.bn-poster-wrap canvas {
  width: min(100%, 420px);
  height: auto;
  border-radius: 12px;
  box-shadow: 0 16px 40px color-mix(in srgb, #111827 35%, transparent);
}

@media (min-width: 860px) {
  .afs-list {
    grid-template-columns: 1fr 1fr;
  }
  .vpm-stage { min-height: 380px; }
}

.cb-arcade {
  display: grid;
  gap: 0.85rem;
}

.cb-calc-body {
  padding: 0.9rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #1e293b, #0f172a);
  box-shadow: inset 0 1px 0 rgba(248, 250, 252, 0.08), 0 16px 32px color-mix(in srgb, #0f172a 28%, transparent);
}

.cb-lcd {
  margin: 0 0 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: #052e16;
  border: 2px solid #22c55e;
  color: #86efac;
  font: 700 1rem/1.3 ui-monospace, Consolas, monospace;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-board-wrap {
  display: grid;
  justify-items: center;
}

.cb-board-wrap canvas {
  width: min(100%, 420px);
  height: auto;
  border-radius: 10px;
  background: #052e16;
  touch-action: none;
}

#te-board {
  width: min(100%, 280px);
}

.cb-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.cb-pad button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: #334155;
  color: #f8fafc;
  font: 700 0.95rem/1 ui-monospace, Consolas, monospace;
}

.cb-pad button[data-te-act="DROP"],
.cb-pad button.is-eq {
  background: #1d4ed8;
}

.cb-pad button[data-sn-dir="0,-1"] {
  grid-column: 2;
}

.te-pad {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "l rot r"
    "d drop drop";
}

.te-pad button {
  min-height: 52px;
  user-select: none;
  touch-action: manipulation;
}

.te-pad [data-te-act="L"] { grid-area: l; }
.te-pad [data-te-act="ROT"] { grid-area: rot; }
.te-pad [data-te-act="R"] { grid-area: r; }
.te-pad [data-te-act="D"] { grid-area: d; }
.te-pad [data-te-act="DROP"] { grid-area: drop; }

.ms-setup {
  align-items: flex-end;
}

.ms-setup label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.85rem;
}

.ms-setup select {
  min-height: 40px;
  min-width: 8.5rem;
}

.ms-grid {
  display: grid;
  gap: 4px;
  width: min(100%, 420px);
}

.ms-grid[data-ms-cols="8"] {
  width: min(100%, 360px);
}

.ms-grid[data-ms-cols="12"] {
  width: min(100%, 460px);
}

.ms-grid[data-ms-cols="16"] {
  width: min(100%, 520px);
}

.ms-grid[data-ms-cols="24"] {
  width: min(100%, 640px);
  gap: 3px;
}

.ms-grid[data-ms-cols="30"] {
  width: min(100%, 720px);
  gap: 2px;
}

.ms-grid[data-ms-cols="24"] .ms-key,
.ms-grid[data-ms-cols="30"] .ms-key {
  border-radius: 4px;
  font-size: 0.7rem;
}

.ms-key {
  aspect-ratio: 1;
  border: 0;
  border-radius: 7px;
  background: #334155;
  color: #e2e8f0;
  font: 700 0.85rem/1 ui-monospace, Consolas, monospace;
  padding: 0;
}

.ms-key.is-open {
  background: #0f172a;
}

.ms-key.is-mine {
  background: #dc2626;
  color: #fef3c7;
}

.ms-key.is-flag {
  background: #1d4ed8;
  color: #fde68a;
}

.ms-key.is-n1 { color: #93c5fd; }
.ms-key.is-n2 { color: #86efac; }
.ms-key.is-n3 { color: #fca5a5; }
.ms-key.is-n4 { color: #c4b5fd; }
.ms-key.is-n5 { color: #fdba74; }
.ms-key.is-n6 { color: #67e8f9; }
.ms-key.is-n7 { color: #f8fafc; }
.ms-key.is-n8 { color: #94a3b8; }

#ms-flag.is-on {
  background: #1d4ed8;
  color: #fff;
}
