:root{
  --bg:#000000;
  --text:#e8e8e8;
  --muted:#bdbdbd;
  --accent:#0FB938;
  --btn-min-width:100px;
  --btn-height:48px;
  --btn-radius:8px;
  --key-width:100px;
  --key-height:34px;
  --key-font-size:13px;
}
*{box-sizing:border-box}

html,body{height:100%;margin:0;font-family:Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;}
body{background:var(--bg);color:var(--text);display:flex;align-items:center;justify-content:center;padding:24px;user-select:none}

canvas{display:block;user-select:none}

.page{width:100%;overflow-x:auto;text-align:center}
.card{display:inline-flex;flex-direction:column;align-items:center;position:relative;width:auto;}

.game-stage{
  /* Responsive stage wrapper */
  display:flex;
  justify-content:center;
  align-items:flex-start;
  margin:0 auto;
  width:auto;
  height:auto;
  overflow:hidden;
}

.card::before{
  content:"";
  position:absolute;
  top:0;
  bottom:0;
  left:-6px;
  right:-6px;
  border:6px solid rgba(255,255,255,0.18);
  border-radius:12px;
  box-shadow: 0 0 14px rgba(255,255,255,0.06);
  pointer-events:none;
  z-index:30;
}

/* Canvas wrapper */
.canvas-wrapper{
  position:relative;
  display:inline-block;
  padding:6px 0 6px 0;
  border-radius:12px;
}

.canvas-wrapper::before{
  content:"";
  position:absolute;
  inset:0;
  border:0;
  background:transparent;
  pointer-events:none;
  z-index:0;
}

/* Canvas holder */
.canvas-holder{
  width:560px;height:560px;
  box-shadow:0 10px 26px rgba(0,0,0,0.5), inset 0 0 16px rgba(255,255,255,0.02);
  position:relative;
  border-radius:0;
  overflow:hidden;
}

/* HUD bar */
.hud-bar{
  width:560px;
  min-height:56px;
  box-sizing:border-box;
  border-radius:0 0 12px 12px;
  margin:0 auto;
  margin-top:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding-top:3px;
  padding-bottom:9px;
  padding-left:2px;
  padding-right:2px;
  position:relative;
}

.hud-bar::before{
  content:"";
  position:absolute;
  left:0px;
  right:-0.5px;
  top:-6px;
  height:6px;
  background:rgba(255,255,255,0.18);
  box-shadow: 0 6px 14px rgba(255,255,255,0.06);
  pointer-events:none;
  z-index:31;
  box-sizing:border-box;
}
.hud-metrics { display:flex; align-items:center; gap:16px; }
.hud-controls { display:flex; align-items:center; gap:10px; }

/* HUD metrics group */
.hud-metrics-group{
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:calc(var(--btn-min-width) * 2 + 18px);
  height:44px;
  margin:0;
  padding:0 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius:8px;
  box-shadow:
    inset 0 0 6px rgba(255,255,255,0.05),
    0 0 8px rgba(34,197,94,0.15);
  color:#e5e7eb;
  box-sizing:border-box;
}

.hud-metric-block{
  display:flex;
  align-items:center;
  gap:8px;
  height:100%;
}

.hud-label{
  font-size:11px;
  font-weight:600;
  opacity:0.85;
  color:#9ca3af;
  letter-spacing:0.5px;
}

.hud-value{
  font-size:13px;
  font-weight:600;
  color:#22c55e;
}

.hud-label,
.hud-value{
  line-height:1;
  margin:0;
  padding:0;
}

.hud-controls .btn{
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:100px;
  height:44px;
  padding:0 12px;
  font-size:13px;
  box-shadow:0 4px 12px rgba(15,185,56,0.08);
  margin:0;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.005));
  color: var(--muted);
}
.btn:disabled:hover { transform: none; box-shadow: none }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:var(--btn-min-width);
  height:var(--btn-height);
  padding:0 14px;
  border-radius:var(--btn-radius);
  border:0;
  background:linear-gradient(180deg, var(--accent), #0AA92F);
  color:#04260b;
  font-weight:700;
  cursor:pointer;
  transition:transform 160ms ease, box-shadow 160ms ease, opacity 120ms ease;
  font-size:14px;
  box-shadow: 0 6px 18px rgba(15,185,56,0.10);
}
.btn:hover{transform:translateY(-2px)}
.btn:active{transform:translateY(-1px)}
.btn:focus-visible{outline:3px solid rgba(15,185,56,0.18);outline-offset:2px}


/* Overlays */
.overlay{
  position:absolute;top:0;left:0;width:100%;height:100%;
  background:rgba(0,0,0,0.45);
  display:flex;align-items:center;justify-content:center;
  z-index:20;
}
.overlay.hidden{display:none}
.overlay-content{
  text-align:center;color:var(--text);
  background:rgba(15,15,15,0.75);
  padding:18px 20px;
  border-radius:12px;
  box-shadow:0 8px 30px rgba(0,0,0,0.6);
  min-width:240px;
  max-width:90%;
}
.overlay-title{margin:0 0 10px 0;font-size:36px;font-weight:800;letter-spacing:0.8px}


.overlay-controls{list-style:none;padding:0;margin:0 0 12px 0;display:grid;grid-template-columns:var(--key-width) 1fr;gap:6px 12px;align-items:center}
.overlay-controls li{display:contents}
.overlay-controls .action{color:var(--muted);font-size:14px;padding-left:6px;text-align:left}

/* Key badge */
.key{display:inline-flex;align-items:center;justify-content:center;width:var(--key-width);height:var(--key-height);border-radius:8px;background:rgba(255,255,255,0.04);color:var(--text);font-weight:700;border:1px solid rgba(255,255,255,0.06);font-size:var(--key-font-size);text-transform:uppercase;letter-spacing:0.6px}

.overlay-actions{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:6px}
.overlay-actions .key{margin:0}

.overlay-stats{display:grid;grid-template-columns:1fr;gap:8px;justify-items:center;margin:6px 0}
.overlay-stat{color:var(--muted);font-size:15px}
.overlay-footer{margin-top:14px;display:grid;justify-items:center;gap:6px}
