/* Arcade.now - Game machine shell (canvas frame, HUD, overlay, touch bar). */

.machine {
  background:
    radial-gradient(900px 320px at 50% -10%, rgba(104, 66, 255, 0.22), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 18px 0 26px;
}
.machine:fullscreen {
  border-radius: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--bg-deep);
}

.machine-hud {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 2px 6px 12px;
}
.hud-stat { display: flex; align-items: baseline; gap: 7px; }
.hud-stat .lbl {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 700;
}
.hud-stat .val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  min-width: 2ch;
}
.hud-stat .val.gold { color: var(--yellow); }
.machine-btns { margin-left: auto; display: flex; gap: 8px; }
.m-btn {
  background: var(--surface-3);
  color: var(--text);
  border: none;
  cursor: pointer;
  border-radius: 10px;
  padding: 8px 14px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.88rem;
  transition: background 0.12s;
}
.m-btn:hover { background: #313659; }
.m-btn-primary { background: var(--purple); color: #fff; }
.m-btn-primary:hover { background: var(--purple-hover); }
.m-btn { display: inline-flex; align-items: center; gap: 6px; }
#btn-sound .ico-sound-off { display: none; }
#btn-sound.muted .ico-sound-on { display: none; }
#btn-sound.muted .ico-sound-off { display: inline-block; }

.machine-screen {
  position: relative;
  display: flex;
  justify-content: center;
  background: #0b0d18;
  border-radius: var(--radius);
  border: 1px solid #1c1f36;
  overflow: hidden;
  min-height: 300px;
}
#board-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 10px 0;
}
.arcade-canvas {
  display: block;
  image-rendering: auto;
  border-radius: 6px;
  max-width: 100%;
}

/* Overlay */
.game-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 10, 20, 0.86);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.game-overlay[hidden] { display: none; }
.overlay-card {
  text-align: center;
  max-width: 400px;
  padding: 28px 26px;
}
.overlay-card .overlay-title {
  font-weight: 800;
  line-height: 1.25;
  font-size: 1.7rem;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #a78bfa, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.overlay-card .overlay-sub { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 16px; }
.overlay-final .of-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.overlay-final .of-row .k { color: var(--text-faint); }
.overlay-final .of-row .v { font-weight: 800; color: #fff; }
#overlay-rank { color: var(--green); font-weight: 700; margin-top: 10px; display: block; min-height: 1.3em; }
.overlay-name-row { margin: 14px 0 4px; }
.overlay-name-row input {
  width: 100%;
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  color: var(--text);
  padding: 9px 16px;
  font-family: var(--font);
  outline: none;
}
.overlay-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* Touch bar */
.touch-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 12px 6px 4px;
  width: 100%;
}
.touch-btn {
  flex: 1;
  max-width: 110px;
  padding: 14px 6px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: var(--surface-2);
  color: #fff;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 800;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.touch-btn:active { background: var(--purple); border-color: var(--purple); }

/* Controls legend under the machine */
.controls-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--text-faint);
  font-size: 0.85rem;
  padding: 10px 6px 0;
}
.controls-line .kbd {
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 8px;
  font-weight: 700;
  color: var(--text);
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .machine { padding: 10px; }
  .machine-btns { margin-left: 0; width: 100%; justify-content: flex-start; }
  .hud-stat .val { font-size: 1.05rem; }
}

/* Leaderboard identity tags: registered members vs generated guest names */
.lb-tag { display: inline-block; margin-left: .4rem; padding: .05rem .45rem; border-radius: 999px; font-size: .68rem; letter-spacing: .03em; vertical-align: middle; }
.lb-reg { background: rgba(255, 200, 60, .14); color: #ffc83c; border: 1px solid rgba(255, 200, 60, .35); }
.lb-guest { background: rgba(255, 255, 255, .06); color: #9aa0b4; border: 1px solid rgba(255, 255, 255, .12); }
.guest-id-line { font-size: .85rem; color: #9aa0b4; margin: .35rem 0 0; }
.guest-id-line a { color: inherit; text-decoration: underline; }
