/* ===== Global page styles ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(1200px 700px at 50% -10%, #24365e, #101828 70%);
  color: #fff;
  user-select: none;
}

.stage { width: min(96vw, 1000px); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
}
.topbar h1 { font-size: 22px; letter-spacing: 1px; }
.topbar .sub {
  font-size: 13px;
  background: #ffd23f;
  color: #5b3a00;
  border-radius: 20px;
  padding: 2px 10px;
  vertical-align: middle;
}
.topbar-right { display: flex; gap: 10px; align-items: center; }

.chip {
  display: none;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
}
.mini-btn {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 15px;
}
.mini-btn:hover { background: rgba(255,255,255,.22); }

.frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.08);
}
#gameCanvas { display: block; width: 100%; height: auto; background: #6ec0ff; }

/* ---- Camera preview ---- */
.cam-wrap {
  display: none;
  position: absolute;
  right: 12px;
  bottom: 12px;
  border: 2px solid rgba(255,255,255,.5);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.45);
  line-height: 0;
}
#camPreview { width: 176px; height: auto; display: block; }

/* ---- Overlay / panel ---- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 14, 30, .62);
  backdrop-filter: blur(3px);
}
.overlay.hidden { display: none; }

.panel {
  text-align: center;
  background: linear-gradient(180deg, rgba(28,40,72,.96), rgba(16,24,48,.96));
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 16px;
  padding: 26px 34px;
  max-width: 560px;
  box-shadow: 0 16px 50px rgba(0,0,0,.5);
}
.panel.small { max-width: 380px; }
.panel h2 { margin-bottom: 12px; }

.logo {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffd23f;
  text-shadow: 3px 3px 0 #b3541e, 6px 6px 0 rgba(0,0,0,.35);
  margin-bottom: 8px;
}
.tagline { opacity: .85; margin-bottom: 18px; }

.ctrl-grid { display: flex; gap: 12px; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
.ctrl-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 200px;
  text-align: left;
}
.ctrl-card h3 { font-size: 15px; margin-bottom: 6px; color: #9fe0ff; }
.ctrl-card p { font-size: 13px; line-height: 1.7; opacity: .85; }

.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-col { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

.btn {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 26px;
  cursor: pointer;
  transition: transform .08s, filter .15s;
  box-shadow: 0 5px 0 rgba(0,0,0,.35);
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.btn-green { background: #37b24d; }
.btn-blue  { background: #2b6cd7; }
.btn-gray  { background: #5c6672; }

.tip { margin-top: 14px; font-size: 12px; opacity: .6; }

.calib-num {
  font-size: 44px;
  font-weight: 900;
  color: #7bed9f;
  margin: 16px 0;
  min-height: 56px;
}

.end-info { font-size: 17px; line-height: 1.9; margin: 10px 0 4px; }
.end-info b { color: #ffd23f; }

.foot {
  text-align: center;
  padding: 12px;
  font-size: 13px;
  opacity: .55;
}
