/* Bubble Pop: game styles. Colors and fonts come from ../shared/eg-theme.css */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 20px; line-height: 1.45;
}
[hidden] { display: none !important; }
.noscript { margin: 16px; padding: 16px; border: 2px solid var(--ink); border-radius: 12px; background: #FBF6EA; color: #1F3246; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 4px solid var(--mid); outline-offset: 2px; }
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }

#eg-root { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

/* ---------- header and settings ---------- */
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; padding: 8px 16px 4px; }
.name-block { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.name { margin: 0; font-family: var(--font-head); font-weight: 800; font-size: 28px; line-height: 1.15; white-space: nowrap; }
.kind { margin: 0; white-space: nowrap; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.kind::before { content: ""; width: 14px; height: 14px; border-radius: 2px; background: var(--dot); border: 2px solid var(--ink); flex: none; } /* square = Challenge */
.textlink { color: var(--ink); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; min-height: 44px; display: inline-flex; align-items: center; padding: 0 4px; white-space: nowrap; }
.linkbtn { background: none; border: 0; cursor: pointer; }
.settings { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 16px 10px; border-bottom: 2px solid var(--rule); }
.settings.inline { padding: 12px 0 8px; border-bottom: 0; }
.settings-label { font-size: 18px; margin-right: 2px; }

/* ---------- buttons ---------- */
.btn {
  min-height: 52px; padding: 8px 16px;
  font: inherit; font-weight: 700; font-size: 20px; line-height: 1.2;
  color: var(--ink); background: var(--card);
  border: 2px solid var(--ink); border-radius: 12px; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.btn.small { min-height: 46px; font-size: 18px; padding: 6px 14px; }
.btn.big { min-height: 64px; font-size: 26px; font-family: var(--font-head); font-weight: 800; padding: 8px 36px; }
.btn.primary { background: var(--ink); color: var(--card); }
.btn[aria-disabled="true"], .btn:disabled { opacity: 0.5; border-style: dashed; cursor: default; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--card); }
.controls { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.controls.col { flex-direction: column; align-items: stretch; }

/* ---------- title screen ---------- */
.titlescreen { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.titlemain { padding: 12px 12px 40px; max-width: 760px; margin: 0 auto; }
.h2 { margin: 8px 0 12px; font-family: var(--font-head); font-weight: 800; font-size: 30px; line-height: 1.15; }
.panel { background: var(--card); border: 2px solid var(--rule); border-radius: 20px; padding: 4px 18px; margin: 0 0 16px; }
.howto { margin: 14px 0; font-size: 20px; }
.note { margin: 12px 0 0; font-size: 18px; }
.stats { padding: 10px 18px; }
.stat { margin: 4px 0; font-size: 20px; }
.stat-label { display: inline-block; min-width: 11em; }
.msg { margin: 0 0 8px; padding: 8px 12px; font-size: 19px; line-height: 1.35; background: var(--card); border: 2px solid var(--rule); border-radius: 12px; }
.msg:empty { display: none; }

/* ---------- playing ---------- */
.playscreen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hud { padding: 4px 10px 6px; background: var(--card); border-bottom: 2px solid var(--rule); }
.hud-row { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; font-size: 17px; line-height: 1.35; }
.hud-row.top { margin-bottom: 2px; }
.hud-item { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.hud-label { opacity: 0.85; }
.hud-row b { font-size: 19px; }
.pausebtn { margin-left: auto; min-width: 84px; }
.pips { display: inline-flex; gap: 4px; align-items: center; }
.pip { width: 15px; height: 15px; border-radius: 50%; border: 2px dashed var(--ink); background: transparent; display: inline-block; }
.pip.on { border-style: solid; background: repeating-linear-gradient(45deg, var(--ink) 0 2px, transparent 2px 5px); }

.stage {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--iconbg); touch-action: none; user-select: none; -webkit-user-select: none;
}
#cv { display: block; touch-action: none; background: var(--card); }
.topstack {
  position: absolute; top: 8px; left: 8px; right: 8px; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none;
}
.toast {
  margin: 0; max-width: 520px;
  text-align: center; padding: 8px 12px; font-size: 19px; line-height: 1.3; font-weight: 700;
  background: var(--card); border: 2px solid var(--ink); border-radius: 12px;
}
.toast:empty { display: none; }

.overlay {
  position: absolute; inset: 0; z-index: 5; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; justify-content: center; align-items: flex-start; padding: 12px;
  background: rgba(31, 50, 70, 0.78); touch-action: pan-y;
}
:root[data-contrast="high"] .overlay { background: rgba(0, 0, 0, 0.85); }
.sheet { width: 100%; max-width: 560px; margin: auto 0; background: var(--card); border: 3px solid var(--ink); border-radius: 20px; padding: 10px 18px 18px; }
.summary { margin: 0 0 8px; padding: 8px 16px; }
.summary p { margin: 6px 0; font-size: 20px; }
.summary .big { font-weight: 700; }

/* phones held sideways: the HUD moves to the side so the play area gets the full height */
@media (orientation: landscape) and (max-height: 560px) {
  .playscreen { flex-direction: row; }
  .hud { width: 210px; flex: none; border-bottom: 0; border-right: 2px solid var(--rule); overflow-y: auto; }
  .hud-row { gap: 0 10px; }
  .hud-item { white-space: normal; flex-wrap: wrap; }
  .hud-row.top { flex-direction: column; align-items: flex-start; }
  .pausebtn { margin-left: 0; margin-top: 4px; width: 100%; }
  .bar { padding-top: 4px; }
  .name { font-size: 24px; }
}
