/* Polycube web: same look as the Android game (dark navy background, cyan accent, neon pieces). Dark-only by design. */
:root {
  --bg: #0d0d1a; --panel: #15152b; --line: #2a2a4a; --text: #eceeef; --muted: #8a8aa8; --accent: #00d4ff; --accent-dark: #00aacc;
  --lime: #a8ff3d; --danger: #ff5a4a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); height: 100%; overflow: hidden; touch-action: manipulation; }
body { font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#app { height: 100%; }
#ui { height: 100%; overflow-y: auto; }
#game { height: 100%; display: flex; justify-content: center; }
#canvas { display: block; height: 100dvh; width: min(100vw, 56.25dvh); touch-action: none; user-select: none; -webkit-tap-highlight-color: transparent; }

.content { max-width: 520px; margin: 0 auto; padding: 24px 18px 40px; display: flex; flex-direction: column; gap: 14px; }
.brand { margin: 12px 0 0; font-size: 44px; letter-spacing: 4px; text-align: center; color: var(--accent); text-shadow: 0 0 18px rgba(0, 212, 255, .45); }
.brand.small { font-size: 28px; letter-spacing: 2px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .grow { flex: 1; min-width: 0; }
p { margin: 0; text-align: center; }
h2 { margin: 12px 0 0; font-size: 14px; letter-spacing: 2px; color: var(--muted); }
.best { font-size: 18px; } .score { font-size: 64px; font-weight: 800; color: var(--text); }
.record { color: var(--lime); font-weight: 800; font-size: 22px; }
.link { color: var(--accent); text-align: center; text-decoration: underline; background: none; border: none; font: inherit; cursor: pointer; padding: 8px; }

.btn { font: inherit; font-weight: 700; letter-spacing: 1px; color: var(--bg); background: var(--accent); border: none; border-radius: 12px; padding: 12px 18px; min-height: 48px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; transition: transform .12s, filter .12s; }
.btn:active { transform: scale(.96); filter: brightness(.85); }
.btn.outline { background: transparent; color: var(--accent); border: 2px solid var(--accent-dark); }
.btn.wide { width: 100%; } .btn.big { font-size: 20px; min-height: 58px; }
.btn.round { width: 44px; min-height: 44px; padding: 0; border-radius: 50%; font-size: 22px; }
.btn.link { background: none; color: var(--accent); text-decoration: underline; }
.btn:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; } .row > * { flex: 1 1 0; min-width: 0; }
.line { display: flex; align-items: center; gap: 10px; }
select, input[type=text] { font: inherit; width: 100%; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--line); background: var(--panel); color: var(--text); min-height: 44px; }
.toggle input { width: 24px; height: 24px; accent-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 4px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.stepper { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: 1px; }
.stepper .value { min-width: 34px; text-align: center; font-size: 22px; color: var(--accent); }
.rules .rule { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.rules .rule input { width: 24px; height: 24px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.rules .rule span { display: flex; flex-direction: column; gap: 2px; } .rules .rule small { color: var(--muted); font-size: 13px; }
.notice { background: rgba(0, 212, 255, .08); border: 1px solid var(--accent-dark); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
ol.board { margin: 8px 0 0; padding-left: 24px; } ol.board li { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); }

/* install banner + dialog */
.install-banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--accent-dark); border-radius: 14px; background: rgba(0, 212, 255, .08); }
.install-banner p { text-align: start; font-size: 13px; color: var(--muted); }
.install-banner .btn { min-height: 40px; padding: 6px 14px; }
.install-banner-icon { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.install-banner-close { flex: none; width: 32px; height: 32px; border: none; background: none; color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; }
.modal { position: fixed; inset: 0; background: rgb(0 0 0 / .6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.dialog { max-width: 420px; width: 100%; align-items: stretch; text-align: center; }
.dialog h2 { margin: 0; font-size: 20px; color: var(--text); letter-spacing: 0; }
.install-icon { width: 72px; height: 72px; border-radius: 16px; align-self: center; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
