/* W!G - glossy early-iPhone (iOS 3-6) style */
:root {
  --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --tag: 'Sedgwick Ave Display', 'Marker Felt', cursive;
  --nav-top: #b4c0cf;
  --nav-mid: #8b9db5;
  --nav-bot: #6d83a1;
  --blue-top: #7fb4ff;
  --blue-bot: #1f6be6;
  --red-top: #ff5b4d;
  --red-bot: #c90f0f;
  --text: #000;
  --text-dim: #7f7f7f;
  --label-blue: #385487;
  --group-line: #abb0b6;
  --cell-line: #e0e0e0;
  --stripe-a: #c5ccd4;
  --stripe-b: #cbd2d8;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: #e6e2dd;
  font: 17px/1.25 var(--font);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

/* app frame: full screen on phones, centered phone-width column on desktop */
.app {
  position: relative; max-width: 480px; min-height: 100dvh; margin: 0 auto;
  box-shadow: 0 0 40px rgba(0, 0, 0, .25);
}
.screen { min-height: 100dvh; padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
.screen.nobar { padding-bottom: 0; }
.screen.stripes { background: repeating-linear-gradient(90deg, var(--stripe-a) 0 5px, var(--stripe-b) 5px 7px); }
.screen.white { background: #fff; }
.screen.dark { background: #000; color: #fff; }
.screen.spring { background: #000; color: #fff; }

/* ---------- navigation bar ---------- */
.nav {
  position: sticky; top: 0; z-index: 4;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px;
  height: calc(44px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 6px 0;
  background: linear-gradient(180deg, var(--nav-top) 0%, var(--nav-mid) 50%, var(--nav-bot) 50%, #6a7f9c 100%);
  border-bottom: 1px solid #2d3642; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
}
.nav h1 {
  margin: 0; font-size: 20px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, .55); max-width: 60vw; text-align: center;
}
.nav .l { justify-self: start; } .nav .r { justify-self: end; }
.barbtn {
  display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 5px;
  font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, .5);
  background: linear-gradient(180deg, #8ea3c2 0%, #5f7ba3 50%, #4a6891 50%, #4f6e98 100%);
  border: 1px solid #36465c; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 0 rgba(255, 255, 255, .3);
  white-space: nowrap;
}
.barbtn.back { padding-left: 14px; clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%); border-radius: 0 5px 5px 0; }
.barbtn.dark { background: linear-gradient(180deg, #555 0%, #222 50%, #000 50%, #111 100%); border-color: #000; line-height: 1; text-align: center; }
.barbtn.pill { border-radius: 8px; }
.barbtn:active { filter: brightness(.8); }

/* ---------- grouped table ---------- */
.content { padding: 10px 10px 20px; }
.group {
  background: #fff; border: 1px solid var(--group-line); border-radius: 10px; margin: 10px 0 18px; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}
.cell { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; border-top: 1px solid var(--cell-line); }
.cell:first-child { border-top: 0; }
.cell > b { width: 100px; flex: none; font-size: 16px; }
.cell .val { color: var(--label-blue); flex: 1; min-width: 0; }
.cell input[type=text], .cell input[type=tel], .cell input[type=password], .cell input:not([type]) {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 17px; padding: 4px 0;
}
.cell input::placeholder { color: #9a9a9a; }
.chev::after { content: '›'; color: #8e8e8e; font-size: 26px; line-height: 1; margin-left: auto; font-weight: 700; }
.foot { text-align: center; color: #4c566c; font-size: 14px; text-shadow: 0 1px 0 rgba(255, 255, 255, .8); margin: -6px 12px 14px; }
.label { font-weight: 700; color: #4c566c; text-shadow: 0 1px 0 rgba(255, 255, 255, .8); margin: 16px 4px 6px; font-size: 16px; }

/* ---------- segmented control ---------- */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid #7a7f86; border-radius: 8px; overflow: hidden; }
.seg button {
  height: 44px; border: 0; border-left: 1px solid #9a9ea4; font-size: 15px; font-weight: 700; color: #4e5563;
  background: linear-gradient(180deg, #fff 0%, #f1f1f1 50%, #e2e2e2 50%, #eaeaea 100%);
}
.seg button:first-child { border-left: 0; }
.seg button.on {
  color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, .35);
  background: linear-gradient(180deg, #8bb4f0 0%, #5e8fe0 50%, #4074d6 50%, #4a7edc 100%);
}
.seg.dark { border-color: #000; border-radius: 6px; }
.seg.dark button { height: 34px; color: #fff; font-size: 13px; letter-spacing: .5px; background: linear-gradient(180deg, #4a4a4a 0%, #2b2b2b 50%, #161616 50%, #1e1e1e 100%); border-left-color: #000; }
.seg.dark button.on { background: linear-gradient(180deg, #7aa7ee 0%, #4c82dc 50%, #2f68cf 50%, #3a73d6 100%); }

/* ---------- buttons ---------- */
.big {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 54px; border-radius: 10px;
  font-size: 21px; font-weight: 700; color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, .4);
  background: linear-gradient(180deg, #8ec0ff 0%, #4b92f6 50%, #1f6be6 50%, #2a78ee 100%);
  border: 1px solid #1d4fa8; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 2px rgba(0, 0, 0, .3);
}
.big:disabled { filter: grayscale(.8) brightness(1.1); opacity: .6; }
.big:active { filter: brightness(.85); }
.big.gray { background: linear-gradient(180deg, #fff 0%, #eee 50%, #ddd 50%, #e6e6e6 100%); color: #3b4458; text-shadow: 0 1px 0 #fff; border-color: #9aa0a8; }
.big.red { background: linear-gradient(180deg, var(--red-top) 0%, #ee2a20 50%, var(--red-bot) 50%, #d81a14 100%); border-color: #8a0909; }
.small-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 22px; border-radius: 6px;
  font-size: 15px; font-weight: 700; color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, .4);
  background: linear-gradient(180deg, #8ec0ff 0%, #4b92f6 50%, #1f6be6 50%, #2a78ee 100%); border: 1px solid #1d4fa8;
}
.small-btn.on { background: linear-gradient(180deg, #fff 0%, #eee 50%, #ddd 50%, #e6e6e6 100%); color: #3b4458; text-shadow: none; border-color: #9aa0a8; }
.fire, .burnbtn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: 6px; border: 1px solid #7a0606; color: #fff; font-weight: 800; text-shadow: 0 -1px 0 rgba(0, 0, 0, .45);
  background: linear-gradient(180deg, #ff6a5c 0%, #f02a1f 50%, #cc0d0b 50%, #e01b14 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 1px 1px rgba(0, 0, 0, .4);
  touch-action: manipulation; user-select: none;
}
.fire { width: 58px; height: 40px; font-size: 20px; }
.burnbtn { width: 64px; height: 38px; font-size: 14px; letter-spacing: .5px; }
.fire:active, .burnbtn:active { filter: brightness(.8); }
.pop { animation: pop .25s ease-out; }
@keyframes pop { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ---------- covers: graffiti tag on black ---------- */
.cover {
  width: 64px; height: 64px; flex: none; background: #050505; display: grid; place-items: center; overflow: hidden;
  font-family: var(--tag); font-size: 22px; color: #050505; letter-spacing: -1px;
  -webkit-text-stroke: 1.2px hsl(var(--h) 95% 55%);
  text-shadow: 0 0 6px hsl(var(--h) 95% 45%), 1px 1px 0 hsl(calc(var(--h) + 120) 90% 50%);
  transform: rotate(-3deg);
}
.cover.sm { width: 52px; height: 52px; font-size: 18px; }
.cover.lg { width: 100px; height: 100px; font-size: 34px; box-shadow: 0 3px 8px rgba(0, 0, 0, .45); transform: none; }

/* ---------- light list (Rate, profile) ---------- */
.rows { list-style: none; margin: 0; padding: 0; background: #fff; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--cell-line); min-height: 76px; }
.rows .t { font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .s { color: var(--text-dim); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .n { font-weight: 700; white-space: nowrap; font-size: 16px; }
.rows a.main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.rows .grow { flex: 1; min-width: 0; }
.rows li.chev::after { margin-left: 0; }
.rows li.tight { padding: 0 12px 0 0; }
.section {
  padding: 4px 12px; font-weight: 700; font-size: 16px; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
  background: linear-gradient(180deg, #a5b1bf, #8f9db0); border-top: 1px solid #9aa4b0; border-bottom: 1px solid #8592a3;
}

/* ---------- dark list (Live, Scores) ---------- */
.drows { list-style: none; margin: 0; padding: 0; }
.drows li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-bottom: 1px solid #262626; background: #0c0c0c; min-height: 68px; }
.drows li:nth-child(even) { background: #121212; }
.drows li.hl { background: linear-gradient(180deg, #23426e, #10284f); }
.drows li.sel { background: linear-gradient(180deg, #0a8cf6, #0062e0); }
.drows li.me .t::after { content: ' · you'; color: #ffd60a; font-weight: 400; font-size: 13px; }
.drows .rk { width: 22px; color: #9a9a9a; font-weight: 700; font-size: 17px; text-align: center; flex: none; }
.drows li.sel .rk { color: #fff; }
.drows .t { font-weight: 700; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drows .s { color: #9a9a9a; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drows .n { font-weight: 700; font-size: 18px; white-space: nowrap; }
.drows a.main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.drows .grow { flex: 1; min-width: 0; }
.drows li.slim { min-height: 44px; }
.livetag { color: #ff3b30; font-size: 11px; font-weight: 800; margin-left: 6px; vertical-align: 2px; }
.dhead {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; font-weight: 700; font-size: 17px;
  background: linear-gradient(180deg, #4b4b4b, #2a2a2a); border-top: 1px solid #5d5d5d; border-bottom: 1px solid #000;
  text-shadow: 0 -1px 0 #000;
}

/* ---------- live stream ---------- */
.stream {
  position: relative; aspect-ratio: 4 / 3; max-height: 46vh; width: 100%; overflow: hidden;
  background: repeating-linear-gradient(135deg, #2b2b2b 0 14px, #232323 14px 28px);
  border-bottom: 3px solid #2c7ff0;
}
.stream iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stream .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #8d8d8d; font-size: 15px; }
.stream .np { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 12px 10px; background: linear-gradient(transparent, rgba(0, 0, 0, .85)); pointer-events: none; }
.stream .np .k { color: #c9c9c9; font-size: 14px; font-weight: 700; }
.stream .np .v { color: #fff; font-size: 19px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stream .top { position: absolute; left: 10px; right: 10px; top: calc(10px + env(safe-area-inset-top)); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.livebadge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 5px; font-size: 12px; font-weight: 800; color: #fff;
  background: linear-gradient(180deg, #ff5a4f, #d40f0f); border: 1px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.livebadge.off { background: linear-gradient(180deg, #888, #555); }
.livebadge i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.blackpill { padding: 3px 9px; border-radius: 7px; background: rgba(0, 0, 0, .8); border: 1px solid #555; font-size: 13px; font-weight: 700; color: #fff; }
.homebtn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .7); border: 2px solid #777; }
.homebtn::before { content: ''; width: 11px; height: 11px; border: 2px solid #ddd; border-radius: 3px; }

.burnzone { padding: 14px 12px 6px; background: #000; }
.burnzone .big { height: 58px; font-size: 24px; }
.combo { height: 22px; text-align: center; color: #ffd60a; font-weight: 800; font-size: 17px; margin-top: 6px; }
.meter { display: flex; align-items: center; gap: 10px; color: #bbb; font-size: 14px; font-weight: 700; }
.meter .bar { flex: 1; height: 10px; border-radius: 5px; background: #262626; border: 1px solid #3a3a3a; overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: linear-gradient(180deg, #ffb340, #ff5a1f); border-radius: 5px; transition: width .2s; }
.prog { height: 4px; background: #333; }
.prog i { display: block; height: 100%; width: 0; background: #2c7ff0; transition: width 1s linear; }

/* ---------- cover flow ---------- */
.flow { position: relative; height: 270px; perspective: 600px; overflow: hidden; margin-top: 10px; }
.flow .it {
  position: absolute; left: 50%; top: 14px; width: 190px; height: 190px; margin-left: -95px; border: 1px solid #333; background: #050505;
  display: grid; place-items: center; font-family: var(--tag); font-size: 64px; color: #050505;
  -webkit-text-stroke: 2px hsl(var(--h) 95% 55%); text-shadow: 0 0 12px hsl(var(--h) 95% 45%), 3px 3px 0 hsl(calc(var(--h) + 120) 90% 50%);
  -webkit-box-reflect: below 2px linear-gradient(transparent 55%, rgba(255, 255, 255, .28));
  transition: transform .35s ease, opacity .35s; cursor: pointer; padding: 0;
}
.flow .it b { position: absolute; left: 8px; bottom: 6px; font: 700 13px var(--font); color: #ddd; -webkit-text-stroke: 0; text-shadow: none; }
.flowinfo { text-align: center; padding: 0 12px 12px; }
.flowinfo .a { font-size: 22px; font-weight: 800; }
.flowinfo .b { color: #9a9a9a; font-weight: 700; font-size: 16px; margin-top: 2px; }
.flowinfo .c { font-weight: 800; margin-top: 8px; }

/* ---------- springboard ---------- */
.board { padding: calc(28px + env(safe-area-inset-top)) 14px 140px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px 10px; }
.app-icon { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #fff; font-size: 13px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.ico {
  position: relative; width: 66px; height: 66px; border-radius: 15px; display: grid; place-items: center; font-size: 36px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .7); overflow: hidden;
}
.ico::after { /* gloss */
  content: ''; position: absolute; left: -10%; right: -10%; top: -46%; height: 92%; border-radius: 0 0 50% 50% / 0 0 30% 30%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, .12));
  pointer-events: none;
}
.ico.brown { background: linear-gradient(180deg, #b0643a, #5a2a10); }
.ico.black { background: linear-gradient(180deg, #4a4a4a, #050505); }
.ico.green { background: linear-gradient(180deg, #7fe07a, #1f9a1a); }
.ico.orange { background: linear-gradient(180deg, #ffb347, #f06a00); }
.ico.blue { background: linear-gradient(180deg, #6fb6ff, #1150c8); }
.ico.sky { background: linear-gradient(180deg, #9fd4ff, #2f86e8); }
.ico.pink { background: linear-gradient(180deg, #ff9ccf, #e0227c); }
.ico.violet { background: linear-gradient(180deg, #c49bff, #5b1fc8); }
.ico.gray { background: linear-gradient(180deg, #c8c8c8, #5e5e5e); }
.ico.white { background: linear-gradient(180deg, #fff, #ddd); color: #000; }
.ico.cal { background: #fff; display: block; text-align: center; color: #111; }
.ico.cal .d { display: block; background: linear-gradient(180deg, #ff6b60, #d9271c); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 0 2px; }
.ico.cal .n { display: block; font-size: 36px; font-weight: 700; line-height: 46px; }
.ico.rainbow { background: #fff; font-family: var(--tag); font-size: 26px; color: transparent; -webkit-background-clip: border-box; }
.ico.rainbow span {
  display: inline-block; -webkit-text-fill-color: transparent; text-shadow: none;
  background: linear-gradient(180deg, #5ebd3e 0 17%, #ffb900 17% 33%, #f78200 33% 50%, #e23838 50% 67%, #973999 67% 83%, #009cdf 83%);
  -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 900; font-family: var(--font); font-size: 24px; letter-spacing: -1px;
}
.badge {
  position: absolute; top: -7px; right: -7px; z-index: 2; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px;
  background: radial-gradient(circle at 50% 30%, #ff6a6a, #d00 70%); color: #fff; font-size: 14px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
.icowrap { position: relative; }
.dock {
  position: fixed; z-index: 3; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  display: grid; grid-template-columns: repeat(4, 1fr); padding: 14px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(200, 206, 214, .9), rgba(140, 150, 162, .92));
  border-top: 1px solid rgba(255, 255, 255, .7); box-shadow: 0 -1px 0 rgba(0, 0, 0, .5);
}

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; z-index: 5; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 3px 4px calc(3px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #434343 0%, #2a2a2a 50%, #141414 50%, #0a0a0a 100%); border-top: 1px solid #000;
}
.tabbar[hidden] { display: none; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 0 3px; border-radius: 4px; color: #8f8f8f; font-size: 11px; font-weight: 700; }
.tabbar a svg { width: 30px; height: 30px; fill: currentColor; filter: drop-shadow(0 -1px 0 #000); }
.tabbar a.on { background: rgba(255, 255, 255, .13); color: #fff; }
.tabbar a.on svg { fill: url(#tabblue); filter: drop-shadow(0 0 3px rgba(30, 144, 255, .55)); }

/* ---------- welcome / profile ---------- */
.rainbow-logo {
  margin: 18px auto 4px; text-align: center; font-family: var(--tag); font-size: 96px; line-height: 1; letter-spacing: -2px;
  background: linear-gradient(180deg, #5ebd3e 0 17%, #ffb900 17% 33%, #f78200 33% 50%, #e23838 50% 67%, #973999 67% 83%, #009cdf 83%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .9));
}
.tagline { text-align: center; font-weight: 700; color: #4c566c; text-shadow: 0 1px 0 rgba(255, 255, 255, .8); font-size: 17px; }
.phead { display: flex; gap: 14px; padding: 16px 14px; border-bottom: 1px solid var(--cell-line); }
.phead .nm { font-size: 24px; font-weight: 800; }
.phead .meta { color: var(--text-dim); font-size: 15px; margin: 2px 0; }
.phead .stats { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.bigrow { display: flex; align-items: center; padding: 14px; font-size: 22px; font-weight: 800; border-bottom: 1px solid var(--cell-line); }

/* ---------- iOS 5 switch ---------- */
.switch { appearance: none; position: relative; width: 94px; height: 30px; border-radius: 15px; margin: 0; flex: none; cursor: pointer;
  border: 1px solid #a5a5a5; background: linear-gradient(180deg, #e6e6e6, #fdfdfd); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .25); }
.switch::after { content: 'OFF'; position: absolute; right: 14px; top: 6px; font-size: 15px; font-weight: 800; color: #7d7d7d; }
.switch::before { content: ''; position: absolute; left: -1px; top: -1px; width: 32px; height: 30px; border-radius: 15px; z-index: 1;
  background: linear-gradient(180deg, #fff, #d6d6d6); border: 1px solid #9a9a9a; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: left .15s; }
.switch:checked { background: linear-gradient(180deg, #2a6de0, #5c9cf9); border-color: #1d4fa8; }
.switch:checked::after { content: 'ON'; left: 16px; right: auto; color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, .3); }
.switch:checked::before { left: 61px; }

/* ---------- misc ---------- */
.play { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 1px solid #9aa0a8; padding: 0; font-size: 12px;
  background: linear-gradient(180deg, #fff, #dcdcdc); color: #333; box-shadow: 0 1px 1px rgba(0, 0, 0, .2); }
.play.on { background: linear-gradient(180deg, #8ec0ff, #1f6be6); color: #fff; border-color: #1d4fa8; }
.dark .play { border-color: #555; background: linear-gradient(180deg, #555, #222); color: #ddd; }
.empty { padding: 26px 14px; text-align: center; color: #8a8a8a; }
.dark .empty { color: #777; }
.loading { padding: 60px 0; text-align: center; color: #8a8a8a; }
.chevlink { color: #8e8e8e; font-size: 26px; font-weight: 700; line-height: 1; }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.muted { color: var(--text-dim); }
.file { position: relative; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
audio { width: 100%; }

.toast {
  position: fixed; z-index: 10; left: 50%; top: calc(54px + env(safe-area-inset-top)); transform: translate(-50%, -20px); opacity: 0;
  max-width: calc(100% - 40px); padding: 10px 16px; border-radius: 10px; background: rgba(0, 0, 0, .82); color: #fff; border: 2px solid rgba(255, 255, 255, .8);
  font-weight: 700; font-size: 15px; text-align: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .5); transition: all .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: rgba(170, 12, 12, .9); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- interactivity layer ---------- */
.floater { position: absolute; z-index: 3; font-size: 26px; pointer-events: none; animation: floatup 1.6s ease-out forwards; }
@keyframes floatup { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translate(0, -20px) scale(1.1); } 100% { transform: translate(var(--dx), -180px) scale(.8); opacity: 0; } }

/* fake webcam when no stream is set */
.cam { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #3a2a5a, #0d0a18 70%); overflow: hidden; }
.cam::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 2px, transparent 2px 4px); pointer-events: none; }
.vinyl { width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, #ff4fb3 0 14%, #111 15% 17%, #222 18% 30%, #111 31% 33%, #262626 34% 50%, #111 51% 53%, #1c1c1c 54% 70%); box-shadow: 0 0 30px rgba(180, 60, 255, .5); animation: spin 1.8s linear infinite; }
.cam.idle .vinyl { animation-duration: 8s; }
@keyframes spin { to { transform: rotate(360deg); } }
.eq { position: absolute; bottom: 64px; left: 0; right: 0; display: flex; justify-content: center; align-items: flex-end; gap: 4px; height: 50px; }
.eq i { width: 7px; background: linear-gradient(180deg, #ff4fb3, #6a3cff); border-radius: 2px; animation: eq .9s ease-in-out infinite alternate; }
.cam.idle .eq i { animation-play-state: paused; height: 6px !important; }
@keyframes eq { from { height: 6px; } to { height: 48px; } }
.camtag { position: absolute; right: 10px; top: 46px; font: 700 11px var(--font); color: #ddd; background: rgba(0,0,0,.55); padding: 2px 6px; border-radius: 4px; }

/* live chat */
.chatbox { background: #0c0c0c; border-top: 1px solid #262626; }
.chatlog { list-style: none; margin: 0; padding: 6px 12px; height: 132px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; font-size: 15px; }
.chatlog li { animation: slidein .25s ease-out; }
.chatlog b { color: #6fb6ff; margin-right: 6px; }
.chatlog li.mine b { color: #ffd60a; }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } }
.chatin { display: flex; gap: 8px; padding: 8px 10px; background: linear-gradient(180deg, #2b2b2b, #161616); }
.chatin input { flex: 1; min-width: 0; height: 32px; border-radius: 16px; border: 1px solid #555; background: #fff; color: #000; padding: 0 12px; font-size: 15px; outline: 0; }
.chatin button { height: 32px; padding: 0 14px; border-radius: 16px; border: 1px solid #1d4fa8; color: #fff; font-weight: 700;
  background: linear-gradient(180deg, #8ec0ff 0%, #4b92f6 50%, #1f6be6 50%, #2a78ee 100%); }

/* SMS-style chat screen */
.sms { padding: 10px 10px 70px; display: flex; flex-direction: column; gap: 8px; }
.bub { max-width: 75%; padding: 8px 12px; border-radius: 16px; font-size: 16px; line-height: 1.3; box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 1px 1px rgba(0,0,0,.25); animation: slidein .2s ease-out; }
.bub .who { display: block; font-size: 11px; font-weight: 700; color: #6b7280; margin-bottom: 2px; }
.bub.them { align-self: flex-start; background: linear-gradient(180deg, #f4f4f4, #dedede); border: 1px solid #c2c2c2; }
.bub.me { align-self: flex-end; color: #fff; background: linear-gradient(180deg, #8fd48f, #3fae3f); border: 1px solid #2e8b2e; text-shadow: 0 -1px 0 rgba(0,0,0,.2); }
.bub.me .who { color: #e8ffe8; }
.typing { align-self: flex-start; color: #6b7280; font-size: 13px; padding: 2px 8px; }
.delivered { align-self: flex-end; color: #6b7280; font-size: 12px; margin-top: -4px; }
.smsbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 5; padding-bottom: env(safe-area-inset-bottom); }

/* beats */
.steps { display: grid; grid-template-columns: repeat(16, 1fr); gap: 2px; margin-top: 6px; }
.steps i { height: 6px; border-radius: 2px; background: #e2e2e2; }
.steps i.k { background: #ffb0a8; } .steps i.s { background: #a8c8ff; }
.steps i.now { background: #1f6be6; }

/* settings */
.cell .check { margin-left: auto; color: #385487; font-weight: 800; font-size: 18px; }
.cell.linkish { width: 100%; background: #fff; border: 0; border-top: 1px solid var(--cell-line); border-radius: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.cell.linkish:first-child { border-top: 0; }
.cell.linkish:active, a.cell:active { background: linear-gradient(180deg, #058cf5, #015de6); color: #fff; }
.cell.danger { color: #d40f0f; font-weight: 700; justify-content: center; cursor: pointer; }

/* iOS alert */
.alert-wrap { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(0,0,0,.45); animation: fadein .15s; }
.alert-wrap.out { opacity: 0; transition: opacity .15s; }
@keyframes fadein { from { opacity: 0; } }
.alert { width: min(284px, calc(100% - 40px)); padding: 16px 14px 12px; border-radius: 12px; text-align: center; color: #fff;
  background: linear-gradient(180deg, rgba(64, 86, 140, .97), rgba(24, 40, 92, .97)); border: 2px solid rgba(255,255,255,.85);
  box-shadow: 0 6px 24px rgba(0,0,0,.6), inset 0 0 0 1px rgba(0,0,0,.4); animation: popin .2s ease-out; position: relative; overflow: hidden; }
.alert::before { content: ''; position: absolute; left: -20%; right: -20%; top: -60px; height: 100px; border-radius: 50%; background: rgba(255,255,255,.18); pointer-events: none; }
@keyframes popin { 0% { transform: scale(1.15); opacity: 0; } 100% { transform: scale(1); } }
.alert h3 { margin: 0 0 6px; font-size: 18px; text-shadow: 0 -1px 0 rgba(0,0,0,.5); }
.alert p { margin: 0 0 14px; font-size: 15px; text-shadow: 0 -1px 0 rgba(0,0,0,.5); }
.alert-btns { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.alert-btns.stack { grid-auto-flow: row; }
.alert-btns button { height: 42px; border-radius: 8px; border: 1px solid rgba(0,0,0,.6); color: #fff; font-weight: 700; font-size: 16px; text-shadow: 0 -1px 0 rgba(0,0,0,.5);
  background: linear-gradient(180deg, rgba(255,255,255,.35) 0%, rgba(255,255,255,.12) 50%, rgba(255,255,255,.04) 50%, rgba(255,255,255,.1) 100%); }
.alert-btns button.def { background: linear-gradient(180deg, rgba(255,255,255,.5) 0%, rgba(255,255,255,.25) 50%, rgba(255,255,255,.12) 50%, rgba(255,255,255,.2) 100%); }

/* TV */
.tvscreen { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.tvscreen .cam { position: absolute; }
.tvbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: linear-gradient(180deg, #4b4b4b, #1e1e1e); }
.tvbar .scrub { flex: 1; height: 6px; border-radius: 3px; background: #555; overflow: hidden; }
.tvbar .scrub i { display: block; height: 100%; width: 0; background: #2c7ff0; }

/* ---------- 320px screens (3GS edition, small phones) ---------- */
@media (max-width: 340px) {
  body { font-size: 15px; }
  .app { box-shadow: none; }
  .nav { height: calc(44px + env(safe-area-inset-top)); }
  .nav h1 { font-size: 18px; max-width: 170px; }
  .barbtn { font-size: 11px; padding: 0 8px; height: 28px; }
  .barbtn.back { padding-left: 13px; }
  .board { grid-template-columns: repeat(4, 1fr); gap: 16px 6px; padding: 14px 8px 120px; }
  .ico { width: 57px; height: 57px; border-radius: 11px; font-size: 30px; }
  .ico.cal .n { font-size: 30px; line-height: 38px; }
  .app-icon { font-size: 11px; gap: 4px; }
  .dock { padding: 10px 8px calc(8px + env(safe-area-inset-bottom)); }
  .cover { width: 50px; height: 50px; font-size: 17px; }
  .cover.sm { width: 42px; height: 42px; font-size: 14px; }
  .cover.lg { width: 84px; height: 84px; font-size: 28px; }
  .rows li { gap: 8px; padding: 8px; min-height: 64px; }
  .rows .t, .drows .t { font-size: 16px; }
  .rows .s, .drows .s { font-size: 13px; }
  .rows .n, .drows .n { font-size: 14px; }
  .drows li { gap: 8px; padding: 6px 8px; min-height: 58px; }
  .drows .rk { width: 16px; font-size: 15px; }
  .fire { width: 46px; height: 34px; font-size: 17px; }
  .burnbtn { width: 52px; height: 32px; font-size: 12px; }
  .stream { aspect-ratio: 4 / 3; }
  .stream .np .v { font-size: 16px; }
  .burnzone .big { height: 48px; font-size: 20px; }
  .vinyl { width: 90px; height: 90px; }
  .eq { bottom: 52px; height: 36px; }
  .chatlog { height: 96px; font-size: 13px; }
  .flow { height: 210px; }
  .flow .it { width: 150px; height: 150px; margin-left: -75px; font-size: 50px; }
  .flowinfo .a { font-size: 19px; }
  .phead { gap: 10px; padding: 12px 10px; }
  .phead .nm { font-size: 20px; }
  .small-btn { padding: 0 14px; font-size: 13px; height: 30px; }
  .cell { padding: 8px 10px; min-height: 44px; }
  .cell > b { width: 84px; font-size: 15px; }
  .switch { width: 80px; height: 28px; }
  .switch:checked::before { left: 47px; }
  .switch::before { width: 30px; height: 28px; }
  .switch::after { top: 5px; font-size: 13px; }
  .rainbow-logo { font-size: 72px; margin-top: 8px; }
  .big { height: 46px; font-size: 18px; }
  .tabbar a { font-size: 10px; } .tabbar a svg { width: 26px; height: 26px; }
  .play { width: 30px; height: 30px; }
}

/* inside the 3GS shell: touch-style scrolling, no desktop scrollbar */
html.embedded { scrollbar-width: none; }
html.embedded::-webkit-scrollbar, html.embedded body::-webkit-scrollbar { display: none; }
