/* radio on the phone. Colours and type come from the skin (set as variables by app.js);
   sizes follow the Android phone layout. */
:root {
    --case: #1E211F; --ink: #E6EAE2; --link: #5AB7F6; --line: #4A5256;
    --lcd: #162330; --nameInk: #DBE9F2; --lcdInk: #DBE9F2; --lcdQuiet: #B0CAD7;
    --listBack: #162330; --listInk: #E6EAE2; --listQuiet: #9AA6AE; --pick: #FFFFFF; --pickBack: #2B5E8E;
    --menuBack: #2F3430; --menuInk: #E6EAE2;
    --nameFont: -apple-system, sans-serif; --songFont: -apple-system, sans-serif; --monoFont: Menlo, monospace; --listFont: -apple-system, sans-serif;
    --nameWeight: 700; --songWeight: 400; --monoWeight: 400; --listWeight: 400;
    --nameSize: 18px; --counterSize: 13px; --songSize: 16px; --statusSize: 12px; --rowSize: 15px;
    --textShadow: none; --nameTransform: none;
    color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--case); color: var(--ink); overflow: hidden;
    font: 15px -apple-system, "Helvetica Neue", "Segoe UI", sans-serif; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
#body { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
#app { position: relative; z-index: 1; height: 100%; max-width: 640px; margin: 0 auto; display: flex; flex-direction: column;
    padding: calc(env(safe-area-inset-top) + 12px) calc(env(safe-area-inset-right) + 12px) calc(env(safe-area-inset-bottom) + 12px) calc(env(safe-area-inset-left) + 12px); }

/* ---- display ---- */
.lcd { position: relative; cursor: pointer; outline: none; user-select: none; -webkit-user-select: none; }
.lcd .art { position: absolute; inset: 0; width: 100%; height: 100%; }
.namebar { position: relative; display: flex; align-items: stretch; }
.text { position: relative; padding: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: var(--textShadow); }
.text > span { display: block; overflow: hidden; text-overflow: ellipsis; }
.text > .dots { display: none; position: absolute; left: 8px; top: 8px; width: calc(100% - 16px); height: calc(100% - 16px); }
body.pixel .text > span { visibility: hidden; }
body.pixel .text > .dots { display: block; }
.text.name { flex: 1; min-width: 0; color: var(--nameInk); font: var(--nameWeight) var(--nameSize)/1.25 var(--nameFont); text-transform: var(--nameTransform); }
.counter { flex: none; color: var(--nameInk); font: var(--monoWeight) var(--counterSize)/1.25 var(--monoFont); display: flex; align-items: center; }
.counter > span { white-space: nowrap; }
.song { color: var(--lcdInk); font: var(--songWeight) var(--songSize)/1.3 var(--songFont); white-space: normal; padding-bottom: 0;
    height: calc(var(--songSize) * 2.6 + 8px); }
.song > .dots { height: calc(100% - 8px); }
.song > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; }
.status { color: var(--lcdQuiet); font: var(--monoWeight) var(--statusSize)/1.3 var(--monoFont); }

/* ---- keys ---- */
.keys { display: flex; height: 56px; margin-top: 8px; }
.key { position: relative; flex: 1; min-width: 0; touch-action: manipulation; }
.key canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.key svg { position: relative; width: 28px; height: 28px; display: block; margin: auto; overflow: visible; }
.key svg .f { fill: currentColor; }
.key svg .s { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.key svg .heart.filled { fill: currentColor; }
.key:disabled { opacity: 0.35; cursor: default; }

/* ---- station list ---- */
.tools { display: flex; align-items: center; height: 44px; margin-top: 8px; font-size: 14px; }
.tools b { flex: 1; color: var(--ink); }
.tool { color: var(--link); padding: 0 12px; height: 100%; }
#more { font-weight: 700; font-size: 18px; padding: 0 10px; }
.list { flex: 1; min-height: 0; margin: 4px 0 0; padding: 0; list-style: none; overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: var(--listBack); overscroll-behavior: contain; }
.list li { display: flex; align-items: baseline; gap: 8px; padding: 11px 14px; color: var(--listInk); font: var(--listWeight) var(--rowSize)/1.25 var(--listFont);
    white-space: nowrap; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: pointer; }
.list li.picked { background: var(--pickBack); color: var(--pick); }
.list li .pre, .list li .suf { color: var(--listQuiet); flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.list li.picked .pre, .list li.picked .suf { color: var(--pick); }
.list li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.list li .lead { display: none; }
.list.leader li .nm { flex: 0 1 auto; }
.list.leader li .lead { display: block; flex: 1; min-width: 8px; border-bottom: 1.5px dotted var(--listQuiet); transform: translateY(-4px); }
.list.leader li { box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--listInk) 18%, var(--listBack)); }
.list.caps li .nm { text-transform: uppercase; }
.list .empty { color: var(--listQuiet); white-space: normal; cursor: default; line-height: 1.5; }

/* ---- menus and dialogs: bottom sheet in the skin's menu colours ---- */
.sheet { position: fixed; inset: 0; z-index: 10; background: rgba(0,0,0,0.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.panel { width: 100%; max-width: 640px; max-height: 85%; overflow-y: auto; background: var(--menuBack); color: var(--menuInk);
    border-radius: 14px 14px 0 0; border: 1px solid var(--line); border-bottom: 0; padding: 8px 0 calc(env(safe-area-inset-bottom) + 8px); }
.panel h2 { margin: 8px 18px 4px; font-size: 13px; font-weight: 600; opacity: 0.75; letter-spacing: 0.02em; }
.panel p { margin: 8px 18px 12px; line-height: 1.45; white-space: pre-line; }
.panel .item { display: flex; width: 100%; text-align: left; padding: 14px 18px; gap: 10px; align-items: center; }
.panel .item:active, .panel .item.on { background: var(--pickBack); color: var(--pick); }
.panel .item:disabled { opacity: 0.4; }
.panel .item .mark { width: 1.2em; flex: none; }
.panel .row { display: flex; justify-content: flex-end; gap: 6px; padding: 6px 12px 4px; }
.panel .row button { padding: 11px 16px; border-radius: 9px; color: var(--link); font-weight: 600; }
.panel .row button.main { background: var(--pickBack); color: var(--pick); }
.panel textarea { display: block; width: calc(100% - 36px); margin: 4px 18px 8px; min-height: 120px; font: 13px/1.4 Menlo, monospace;
    background: rgba(0,0,0,0.25); color: var(--menuInk); border: 1px solid var(--line); border-radius: 8px; padding: 10px; resize: vertical; }
.panel .like { padding: 12px 18px; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.panel .like small { display: block; opacity: 0.7; margin-top: 3px; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 24px); transform: translateX(-50%); z-index: 20;
    background: var(--menuBack); color: var(--menuInk); border: 1px solid var(--line); padding: 10px 16px; border-radius: 20px;
    max-width: 90%; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
