/* Felix' games — shared look: big, friendly, text-free buttons and dialogs. */
:root {
  --b: min(11vh, 6.4vw, 96px);          /* main button size */
  --ink: #28283c;
  --gold: #ffcd28;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  background: linear-gradient(#ffecc8, #ffcdaa);
  color: var(--ink);
}
img, canvas, svg { -webkit-user-drag: none; -webkit-touch-callout: none; }
.hidden { display: none !important; }
main {
  position: fixed; inset: 0;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
           max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}

/* --- buttons --------------------------------------------------------------- */
.btn {
  border: none; background: none; padding: 0; margin: 0; cursor: pointer; color: inherit;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  transition: transform .08s;
}
.btn:active { transform: scale(.92); }
.btn svg { width: 72%; height: 72%; pointer-events: none; }
.round {
  width: var(--b); height: var(--b); border-radius: 50%;
  border: max(4px, calc(var(--b) * .06)) solid #fff; background: #fff;
  box-shadow: 0 5px 0 rgba(60, 40, 90, .22);
}
.round.big { --b: min(24vmin, 170px); }
.sky { background: #78c8fa; } .yellow { background: #ffe678; } .green { background: #46be5a; }
.pink { background: #faaac8; } .red { background: #e65046; } .blue { background: #3c8cdc; } .grey { background: #9aa3b5; }
.selected { box-shadow: 0 0 0 max(6px, calc(var(--b) * .09)) var(--gold), 0 5px 0 rgba(60, 40, 90, .22); }
.bounce { animation: bounce .35s; }
@keyframes bounce { 40% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* --- parent settings gear (hold 1.5 s) ---------------------------------------- */
.gear { position: absolute; right: 4px; top: 4px; width: 46px; height: 46px; opacity: .55; }
.gear svg { width: 100%; height: 100%; }
.gear.holding { animation: spin 1.5s linear; opacity: 1; }
@keyframes spin { to { transform: rotate(180deg); } }
.gear .dot { position: absolute; right: 2px; bottom: 2px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; }
.dot.ok { background: #46be5a; } .dot.wait { background: #ffb43c; } .dot.bad { background: #e65046; } .dot.off { background: #c8c8d2; }

/* --- dialogs ----------------------------------------------------------------------- */
.dialog {
  position: fixed; inset: 0; z-index: 10; background: rgba(20, 20, 40, .62);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vh;
}
.dialog .box {
  background: #fff8eb; border: 9px solid var(--gold); border-radius: 44px; padding: 4vmin 5vmin;
  display: flex; flex-direction: column; align-items: center; gap: 3vmin;
}
.dialog .pic svg { width: 24vmin; height: 24vmin; }
.dialog .row { display: flex; gap: 8vmin; }
.viewer img { max-width: 88vw; max-height: 70vh; border-radius: 14px; border: 8px solid #fff; background: #fff; }
.viewer .row { gap: 6vmin; }
.settings .box.text { max-width: min(92vw, 560px); text-align: center; font-size: 18px; gap: 12px; }
.settings h2 { margin: 0; }
.settings p { margin: 0; }
.settings input { font-size: 22px; padding: 10px 14px; border-radius: 12px; border: 3px solid #c8cddc; width: 100%; text-align: center; -webkit-user-select: text; user-select: text; }
.settings .msg { min-height: 1.4em; color: #555; }
.pill { padding: 12px 26px; border-radius: 999px; color: #fff; font-size: 18px; font-weight: 700; }
.settings .row { gap: 14px; }
