/* Audio Lab demo — the phone app's two looks: "village" (8-bit windows over paintings) and "plain". */
:root {
  --navy: #14184a; --glass: rgba(20, 24, 74, .87); --text: #f0f0f0; --lilac: #7882c8;
  --gold: #ffec8c; --mint: #8cffa0; --dim: #b4bcf0; --red: #ff8a8a; --page: #0b0d22;
  --shadow: 2px 2px 0 #000; --title: "Pixelify Sans", "Roboto", sans-serif;
}
body.plain {
  --navy: #ffffff; --glass: #ffffff; --text: #1d2127; --lilac: #d3d7df; --gold: #1f5bd8;
  --mint: #15803d; --dim: #5f6772; --red: #b42318; --page: #f2f3f5; --shadow: none; --title: "Roboto", sans-serif;
}
@media (prefers-color-scheme: dark) {
  body.plain {
    --navy: #1f2228; --glass: #1f2228; --text: #e8eaed; --lilac: #3a3f48; --gold: #8ab4ff;
    --mint: #5fd08a; --dim: #a0a7b1; --red: #ff8a80; --page: #121316;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: #05060f; font-family: "Roboto", system-ui, sans-serif; color: var(--text); }
body.plain { background: var(--page); }

#phone { position: relative; max-width: 480px; height: 100dvh; margin: 0 auto; overflow: hidden; background: var(--page); }
@media (min-width: 700px) {
  body { display: flex; align-items: center; justify-content: center; }
  #phone { height: min(900px, 96vh); width: 420px; border-radius: 28px; box-shadow: 0 0 0 10px #1c1f2b, 0 20px 60px #000a; }
}

/* the painting behind everything */
#bg { position: absolute; inset: 0; background-size: cover; background-position: center top; image-rendering: pixelated; transition: opacity .3s; }
#bg::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, var(--dimness, .35)); transition: background .3s; }
body.plain #bg { display: none; }
#app { position: absolute; inset: 0; overflow-y: auto; padding: 8px 8px 14px; display: flex; flex-direction: column; gap: 6px;
  padding-top: max(8px, env(safe-area-inset-top)); }
body.peek #app { opacity: 0; pointer-events: none; }
body.peek #bg::after { background: rgba(0, 0, 0, 0); }
#peekhint { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; font-weight: 700; text-shadow: var(--shadow); display: none; }
body.peek #peekhint { display: block; }

/* windows */
.win { background: var(--glass); border: 2px solid #f0f0f0; outline: 2px solid #000; box-shadow: inset 0 0 0 2px var(--lilac); padding: 9px 10px; margin: 2px; }
.win.gold { box-shadow: inset 0 0 0 2px var(--gold); }
.win.mint { box-shadow: inset 0 0 0 2px var(--mint); }
body.plain .win { border: 1px solid var(--lilac); outline: none; box-shadow: none; border-radius: 8px; margin: 0; }
body.plain .win.gold { border: 2px solid var(--gold); }
body.plain .win.mint { border: 1px solid var(--lilac); }
.t { text-shadow: var(--shadow); line-height: 1.25; }
.title { font-family: var(--title); font-weight: 700; color: var(--gold); text-shadow: var(--shadow); line-height: 1.1; }
.gold { color: var(--gold); } .mint { color: var(--mint); } .dim { color: var(--dim); } .red { color: var(--red); }
.small { font-size: 12px; } .tiny { font-size: 11px; } .big { font-size: 20px; font-weight: 700; }
.row { display: flex; align-items: center; gap: 6px; } .grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.link { cursor: pointer; user-select: none; text-shadow: var(--shadow); font-weight: 700; }
.link:active { opacity: .6; }

/* buttons */
.btn { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 40px; padding: 6px 8px; cursor: pointer;
  background: var(--navy); border: 2px solid #f0f0f0; outline: 2px solid #000; box-shadow: inset 0 0 0 2px var(--lilac);
  color: var(--gold); font-weight: 700; font-size: 14px; text-shadow: var(--shadow); user-select: none; margin: 2px; flex: 1; }
.btn.sel { box-shadow: inset 0 0 0 2px var(--gold); }
.btn.mint { color: var(--mint); } .btn.red { color: var(--red); } .btn.white { color: var(--text); } .btn.dimc { color: var(--dim); }
.btn.big { font-size: 19px; min-height: 52px; }
.btn:active { filter: brightness(1.4); }
.btn.off { opacity: .45; pointer-events: none; }
body.plain .btn { border: 1px solid var(--lilac); outline: none; box-shadow: none; border-radius: 8px; margin: 0; font-weight: 500; }
body.plain .btn.sel { border: 2px solid var(--gold); }
.btns { display: flex; gap: 6px; } body.plain .btns { gap: 6px; }

/* home menu */
.menu .item { padding: 7px 0 7px 26px; font-size: 19px; font-weight: 700; cursor: pointer; position: relative; text-shadow: var(--shadow); display: flex; }
.menu .item.on { color: var(--gold); }
.menu .item.on::before { content: "▶"; position: absolute; left: 4px; color: var(--gold); font-size: 14px; top: 11px; }
.menu .item .n { margin-left: auto; color: var(--dim); font-size: 14px; font-weight: 500; }
body.plain .home-art { display: none; }
.plainlist .card { padding: 13px 14px; font-size: 17px; font-weight: 600; cursor: pointer; display: flex; }
.plainlist .card .n { margin-left: auto; color: var(--dim); font-weight: 400; font-size: 14px; }

/* list rows */
.rowcard { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.thumb { width: 38px; height: 38px; background-size: cover; background-position: center; image-rendering: pixelated; flex: none; border: 1px solid #000; }
body.plain .thumb { display: none; }
.pct { color: var(--text); font-weight: 700; text-shadow: var(--shadow); }

/* reader / player */
.lines .ln { padding: 5px 4px; font-size: 18px; line-height: 1.5; cursor: pointer; text-shadow: var(--shadow); border-radius: 2px; }
.lines .ln .vn { color: #e8a33c; font-size: 12px; margin-right: 4px; }
.lines .ln.cur { background: rgba(255, 220, 120, .22); }
body.plain .lines .ln.cur { background: rgba(31, 91, 216, .12); font-weight: 600; }
.bar { height: 10px; border: 2px solid #f0f0f0; background: #000; position: relative; cursor: pointer; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: repeating-linear-gradient(90deg, var(--mint) 0 6px, transparent 6px 8px); }
body.plain .bar { height: 6px; border: none; background: var(--lilac); border-radius: 3px; }
body.plain .bar > i { background: var(--gold); border-radius: 3px; }
.dialog { min-height: 150px; }
.dialog .who { color: var(--gold); font-weight: 700; font-size: 14px; text-shadow: var(--shadow); }
.dialog .say { font-size: 20px; font-weight: 700; line-height: 1.35; margin-top: 6px; text-shadow: var(--shadow); }
.ideas b { color: var(--red); font-weight: 700; }
.fillpad { flex: 1; min-height: 20px; }

/* toast + options sheet */
#toast { position: absolute; left: 30px; right: 30px; top: 42%; z-index: 20; }
#sheet { position: absolute; inset: 0; z-index: 30; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; }
#sheet > div { width: 100%; max-height: 85%; overflow-y: auto; background: #181c4a; color: #f0f0f0; padding: 18px 18px 24px; border-radius: 16px 16px 0 0; }
body.plain #sheet > div { background: var(--navy); color: var(--text); }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(128,128,128,.25); }
.opt .grow div:first-child { font-size: 16px; } .opt .grow div:last-child { font-size: 12px; opacity: .7; margin-top: 2px; }
.sw { width: 50px; height: 28px; border-radius: 14px; background: #555; position: relative; flex: none; cursor: pointer; }
.sw::after { content: ""; position: absolute; width: 22px; height: 22px; top: 3px; left: 3px; border-radius: 50%; background: #ddd; transition: left .15s; }
.sw.on { background: #ffec8c; } .sw.on::after { left: 25px; background: #14184a; }
body.plain .sw.on { background: #1f5bd8; } body.plain .sw.on::after { background: #fff; }

.demo-tag { font-size: 11px; color: var(--dim); text-align: center; padding: 4px 0 0; text-shadow: var(--shadow); }
.mini { display: flex; align-items: center; gap: 8px; cursor: pointer; }
