
:root {
  --red: #B4070E; --red-dark: #9B060C; --ink: #111; --paper: #fff; --grey: #cfcfcf; --mut: #666;
  --blue: #1a55a3; --ok: #2e9d4a;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #222; font-family: system-ui, 'Segoe UI', Roboto, sans-serif; /* Benton */ font-family: system-ui, system-ui, sans-serif; color: var(--ink); }
#app { position: relative; max-width: 520px; height: 100%; margin: 0 auto; background: var(--paper); overflow: hidden; box-shadow: 0 0 40px #000a; }

.screen { position: absolute; inset: 0; display: none; flex-direction: column; background: var(--paper); }
.screen.active { display: flex; animation: slide .22s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* header: red gradient with spider-web art, as in the app's submenu header */
.top { flex: none; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 26px;
  color: #fff; background: url(../artwork/v4_submenu_header.svg) center bottom / 100% 100% no-repeat, var(--red-dark); }
.top h2 { flex: 1; margin: 0; text-align: center; font-weight: 900; font-size: 22px; letter-spacing: .04em; text-transform: uppercase; text-shadow: 0 2px 0 #0006; }
.top .spacer { width: 44px; }
.icon-btn { width: 44px; height: 44px; border: 0; background: transparent; padding: 6px; cursor: pointer; border-radius: 50%; }
.icon-btn img { width: 100%; height: 100%; object-fit: contain; }
.icon-btn:active { background: #fff3; }

.body { flex: 1; overflow-y: auto; padding: 14px 16px 28px; }
.top + .body { padding-top: 24px; }
.hex { background: url(../artwork/v4_hexagons.svg) top center / 100% auto repeat-y, #fff; }

/* splash */
#splash { background: #000; color: #fff; }
.intro-art { position: absolute; inset: 0; background: url(../artwork/v3_intro_bg.svg) center top / cover no-repeat; opacity: .55; }
.splash-content { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 14px; padding: 24px 22px calc(24px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, #000c 38%); text-align: center; }
.splash-content h1 { margin: 0; font-size: 30px; font-weight: 900; line-height: 1.05; text-transform: uppercase; text-shadow: 0 3px 0 #000; }
.splash-content h1 span { font-size: 17px; letter-spacing: .15em; color: #ffd0d0; }
.logo { height: 44px; }
.logo.sphero { height: 22px; opacity: .85; margin-top: 4px; }

/* bubbles */
.bubble { background: #fff; color: var(--ink); border-radius: var(--radius); padding: 12px 16px; position: relative; max-width: 360px; }
.bubble p { margin: 0 0 4px; font-weight: 700; } .bubble small { color: var(--mut); }
.bubble.black { background: #000; color: #fff; margin: 4px 4px 16px; border: 1px solid #555; }
.bubble.black::after { content: ''; position: absolute; left: 26px; bottom: -10px; border: 10px solid transparent; border-top-color: #000; border-bottom: 0; }
.bubble.black p { margin: 0; text-align: center; font-weight: 500; }

/* buttons */
.btn { appearance: none; border: 2px solid var(--red); background: var(--red); color: #fff; font: 700 15px system-ui, 'Segoe UI', Roboto, sans-serif; /* Benton */ font-family: system-ui, sans-serif; text-transform: uppercase;
  letter-spacing: .05em; padding: 11px 16px; border-radius: 999px; cursor: pointer; transition: transform .08s; }
.btn:active { transform: scale(.97); background: var(--red-dark); }
.btn.alt { background: #fff; color: var(--red); }
.btn.big { font-size: 18px; padding: 15px 28px; box-shadow: 0 4px 0 var(--red-dark), 0 8px 18px #0008; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.link { background: none; border: 0; color: #fff9; text-decoration: underline; font: 500 14px system-ui, 'Segoe UI', Roboto, sans-serif; /* Benton */ font-family: system-ui, sans-serif; cursor: pointer; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.err { color: #ff9f9f; margin: 0; font-weight: 700; max-width: 340px; white-space: pre-wrap; word-break: break-all; }

/* home */
.hero { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.hero img { height: 150px; filter: drop-shadow(0 6px 6px #0003); }
.status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #aaa; } .dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.battery { background: #eee; border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.modes { display: grid; gap: 12px; margin-bottom: 16px; }
.mode { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; cursor: pointer; border: 3px solid var(--red); border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #f1f1f1); padding: 10px 14px; font-family: system-ui, 'Segoe UI', Roboto, sans-serif; /* Benton */ font-family: system-ui, sans-serif; box-shadow: 0 4px 0 var(--red-dark); }
.mode:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--red-dark); }
.mode img { height: 62px; width: 50px; object-fit: contain; }
.mode b { display: block; font-size: 20px; font-weight: 900; text-transform: uppercase; color: var(--red); }
.mode small { color: var(--mut); font-size: 13px; }
.panel { background: #fffe; border: 2px solid var(--grey); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.panel strong { display: block; font-weight: 900; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }
.panel small { display: block; color: var(--mut); margin-top: 2px; }
.panel.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel.vol { display: flex; align-items: center; gap: 12px; } .panel.vol img { width: 30px; }
.panel label { display: block; margin-top: 10px; font-weight: 700; font-size: 13px; }
.panel label.inline { display: inline-flex; gap: 8px; align-items: center; margin: 10px 12px 0 0; }
.panel input:not([type]), .panel input[type=password], .panel input#opDt, .panel select { width: 100%; padding: 9px 10px; margin-top: 4px; border: 2px solid var(--grey); border-radius: 10px; font: 500 15px system-ui, 'Segoe UI', Roboto, sans-serif; /* Benton */ font-family: system-ui, sans-serif; }
.btnrow select, .btnrow input { flex: 1 1 140px; width: auto !important; margin: 0 !important; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 6px 0; font-size: 14px; } .kv dt { color: var(--mut); } .kv dd { margin: 0; font-weight: 700; word-break: break-all; }
input[type=range] { flex: 1; accent-color: var(--red); height: 28px; }

/* toggle switch (the app used KSwitch) */
.switch { position: relative; width: 56px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #bbb; border-radius: 999px; transition: .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px #0005; }
.switch input:checked + span { background: var(--red); } .switch input:checked + span::after { transform: translateX(24px); }

/* activity grid */
.hint { text-align: center; color: var(--mut); margin: 2px 0 12px; }
.activities { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; background: #fff; border: 3px solid var(--grey); border-radius: var(--radius);
  font: 700 13px system-ui, 'Segoe UI', Roboto, sans-serif; /* Benton */ font-family: system-ui, sans-serif; text-align: center; cursor: pointer; min-height: 112px; }
.act img { width: 56px; height: 56px; object-fit: contain; opacity: .9; }
.act.playing { border-color: var(--red); box-shadow: 0 0 0 3px #b4070e44; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px #b4070e22; } }

.version { text-align: center; color: var(--mut); font-size: 12px; user-select: none; margin-top: 18px; }
pre#log { background: #111; color: #9ef09e; padding: 10px; border-radius: 10px; height: 240px; overflow: auto; font: 11.5px/1.4 ui-monospace, Consolas, monospace; white-space: pre-wrap; margin: 10px 0; }
pre#log .tx { color: #79c0ff; } pre#log .err { color: #ff7b72; } pre#log .inf { color: #aaa; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #000e; color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; z-index: 9; max-width: 90vw; text-align: center; }
@media (prefers-reduced-motion: reduce) { .screen.active, .act.playing { animation: none; } }
