/* Radi Frost Web — Calc Frost / Radi Frost と同じガラスデザイン  © 2026 compact */
:root {
  --accent: #00E5FF;
  --accent-a40: rgba(0, 229, 255, .4);
  --accent-a33: rgba(0, 229, 255, .2);
  --accent-a25: rgba(0, 229, 255, .25);
  --accent-eb: rgba(0, 229, 255, .92);
  --on-accent: #06101A;
  --glass: rgba(10, 15, 30, .6);
  --glass-dark: rgba(10, 15, 30, .72);
  --stroke: rgba(255, 255, 255, .15);
  --text: #fff;
  --text2: rgba(221, 235, 255, .72);
  --text3: rgba(221, 235, 255, .5);
  --rec: #FF6B8A;
  --rec-fill: rgba(255, 107, 138, .33);
  --ok: #8CF0B4;
  --warn: #FFD27F;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #060A16; color: var(--text); overflow: hidden; overscroll-behavior: none; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Segoe UI", sans-serif;
  font-size: 15px; -webkit-text-size-adjust: 100%; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input, textarea { font: inherit; -webkit-user-select: text; user-select: text; }
.hidden { display: none !important; }
.small { font-size: 12px; color: var(--text2); }
.one { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
svg.ic { width: 100%; height: 100%; display: block; fill: currentColor; }

#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }

/* ---------------------------------------------------------------- 骨組み */
#app {
  position: fixed; inset: 0; z-index: 1; display: flex; flex-direction: column;
  padding: var(--sat) var(--sar) var(--sab) var(--sal);
}
#app.under { visibility: hidden; }
.top { display: flex; align-items: center; padding: 10px 8px 6px 18px; gap: 0; }
.titles { flex: 1; min-width: 0; }
.app-title { font-size: 24px; font-weight: 300; letter-spacing: .04em; line-height: 1.25; }
.icon-btn { width: 44px; height: 44px; padding: 10px; border-radius: 12px; color: #fff; flex: none; }
.icon-btn:active { background: rgba(255, 255, 255, .15); }
.icon-btn.on { color: var(--accent); }
#page { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }

.glass { background: var(--glass); border: 1px solid var(--stroke); border-radius: 22px; }
.glass-dark { background: var(--glass-dark); border: 1px solid var(--stroke); border-radius: 22px; }

/* ---------------------------------------------------------------- タブ */
#tabs { display: flex; height: 60px; margin: 10px; flex: none; background: var(--glass); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 5px; border-radius: 14px; color: var(--text2); }
.tab i { width: 24px; height: 24px; display: block; }
.tab span { font-size: 11px; margin-top: 2px; }
.tab:active { background: rgba(255, 255, 255, .15); }
.tab.sel { background: var(--accent-a33); color: var(--accent); }

/* ---------------------------------------------------------------- ボタン・チップ */
.btn {
  min-height: 44px; padding: 0 16px; border-radius: 14px; font-size: 14px; color: #fff;
  background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .25);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
.btn:active { background: rgba(255, 255, 255, .4); }
.btn.accent { background: var(--accent-a40); border-color: var(--accent); }
.btn.accent:active { background: var(--accent-eb); color: var(--on-accent); }
.btn:disabled { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .12); color: var(--text3); }
.btn.round { width: 44px; min-height: 44px; padding: 12px; flex: none; }
.btn .bi { width: 18px; height: 18px; display: inline-block; }
.chip {
  height: 34px; padding: 0 14px; border-radius: 14px; font-size: 13px; flex: none;
  background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .25); color: #fff;
}
.chip.sel { background: var(--accent-eb); border-color: transparent; color: var(--on-accent); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 10px 8px; scrollbar-width: none; flex: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }

.badge { flex: none; margin-left: 8px; font-size: 11px; padding: 2px 8px; border: 1px solid rgba(255, 255, 255, .67); border-radius: 9px; white-space: nowrap; }
.c-accent { color: var(--accent); } .c-rec { color: var(--rec); } .c-ok { color: var(--ok); } .c-warn { color: var(--warn); }

/* ---------------------------------------------------------------- リスト */
.panel { flex: 1; min-height: 0; margin: 0 10px; position: relative; overflow: hidden; }
.list { position: absolute; inset: 0; overflow-y: auto; padding: 4px; -webkit-overflow-scrolling: touch; }
.row { display: flex; align-items: center; padding: 10px; border-radius: 12px; border: 1px solid transparent; }
.row + .row { box-shadow: 0 -1px 0 rgba(255, 255, 255, .12); }
.row:active { background: rgba(255, 255, 255, .15); }
.row.sel { background: var(--accent-a33); border-color: var(--accent); box-shadow: none; }
.row.sel + .row { box-shadow: none; }
.row.past { opacity: .45; }
.row.dim { opacity: .6; }
.row .main { flex: 1; min-width: 0; }
.row .t { line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.row .times { width: 54px; flex: none; }
.row .times b { display: block; }
.empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 30px; color: var(--text2); white-space: pre-line; line-height: 1.6; }

/* ---------------------------------------------------------------- ライブ */
.grid { flex: 1; overflow-y: auto; padding: 4px 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; -webkit-overflow-scrolling: touch; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card { padding: 10px; text-align: left; display: block; width: 100%; background: var(--glass); border: 1px solid var(--stroke); border-radius: 22px; }
.card:active { filter: brightness(1.25); }
.card.playing { background: color-mix(in srgb, var(--glass) 75%, var(--accent-a25)); border: 1.5px solid var(--accent); }
.logo-wrap { position: relative; }
.logo-plate { display: block; background: rgba(255, 255, 255, .9); border-radius: 10px; object-fit: contain; }
.card .logo-plate { width: 100%; height: 46px; padding: 4px; }
.card .pl { position: absolute; right: 3px; top: 3px; width: 22px; height: 22px; padding: 5px; border-radius: 8px; background: var(--accent-eb); color: var(--on-accent); }
.card .name { font-size: 13px; font-weight: 700; letter-spacing: .08em; margin-top: 8px; }
.card .now { font-size: 12px; color: var(--text2); min-height: 2.7em; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------------------------------------------------------- 番組表 */
.selbar { display: flex; align-items: center; gap: 8px; padding: 10px; flex: none; }
.selbar .cnt { flex: 1; }

/* ---------------------------------------------------------------- 予約・録音 */
.warnbox { margin: 0 10px 8px; padding: 12px; border-radius: 18px; background: var(--rec-fill); border: 1.5px solid var(--rec); font-size: 12px; line-height: 1.5; flex: none; }
.warnbox.info { background: var(--glass-dark); border: 1px solid var(--stroke); color: var(--text2); }
.btnrow { display: flex; gap: 8px; padding: 0 10px 8px; flex: none; }
.btnrow .grow { flex: 1; }
.where { padding: 0 16px 8px; flex: none; }
.del { width: 44px; height: 44px; padding: 11px; border-radius: 12px; flex: none; color: #fff; }
.del:active { background: rgba(255, 255, 255, .15); }

/* ---------------------------------------------------------------- ミニプレーヤー */
#mini { margin: 6px 10px 0; padding: 10px; flex: none; }
.mini-row { display: flex; align-items: center; gap: 6px; }
.mini-logo { width: 64px; height: 29px; padding: 2px; margin-right: 4px; flex: none; }
.mini-text { flex: 1; min-width: 0; }
.mini-title { overflow: hidden; white-space: nowrap; }
.mini-title span { display: inline-block; }
.mini-title.marquee span { padding-left: 100%; animation: marquee 14s linear infinite; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }

input.seek { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; margin: 6px 0 0; display: block; }
input.seek::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(var(--accent), var(--accent)) 0 / var(--fill, 0%) 100% no-repeat, rgba(255, 255, 255, .2); }
input.seek::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .2); }
input.seek::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
input.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); margin-top: -7px; }
input.seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); }

/* ---------------------------------------------------------------- 設定などの画面 */
.screen {
  position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column;
  padding: var(--sat) var(--sar) var(--sab) var(--sal); animation: fadein .18s ease-out;
}
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.screen > canvas.bgc { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; }
.screen-head { display: flex; align-items: center; padding: 8px 12px 6px 6px; flex: none; }
.screen-head .st { font-size: 22px; font-weight: 300; padding-left: 8px; }
.screen-body { flex: 1; overflow-y: auto; padding: 4px 16px 24px; -webkit-overflow-scrolling: touch; }
.scard { padding: 16px 16px 10px; margin-bottom: 14px; background: var(--glass-dark); border: 1px solid var(--stroke); border-radius: 22px; }
.scard h3 { margin: 0 0 4px; font-size: 13px; font-weight: 500; color: var(--accent); }
.srow { display: flex; align-items: center; padding: 10px 0; border-radius: 12px; }
.srow.click:active { background: rgba(255, 255, 255, .15); }
.srow .l { flex: 1; min-width: 0; }
.srow .d { font-size: 12px; color: var(--text2); margin-top: 2px; white-space: pre-line; line-height: 1.45; }
.srow .v { color: var(--accent); font-size: 14px; padding-left: 10px; text-align: right; flex: none; max-width: 50%; }
.lbl { padding-top: 10px; }
.note { font-size: 12px; color: var(--text2); line-height: 1.5; padding: 4px 0 10px; }
.bufchips { display: flex; gap: 8px; padding: 10px 0; }
.bufchips .chip { flex: 1; height: 38px; }
.swatches { display: flex; align-items: center; height: 60px; }
.swatch { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 3px solid transparent; }
.swatches { justify-content: space-between; }
.swatch.sel { border-color: #fff; }
.rangehead { display: flex; padding-top: 10px; }
.rangehead span:first-child { flex: 1; }
.copy { text-align: center; color: var(--text2); font-size: 13px; padding: 24px 0 8px; }
.kwrow { display: flex; align-items: center; padding: 4px 0; gap: 6px; }
.kwrow .w { flex: 1; font-size: 16px; min-width: 0; word-break: break-all; }
.kwrow .w.off { color: var(--text3); }
.kwrow .chip { width: 56px; height: 32px; padding: 0; }
.input {
  flex: 1; min-width: 0; height: 44px; padding: 10px 14px; border-radius: 14px; color: #fff; outline: none;
  background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .25); font-size: 16px;
}
.input::placeholder { color: var(--text3); }
.input:focus { border-color: var(--accent); }

/* 切り出し */
.crop { position: fixed; inset: 0; z-index: 8; background: #060A16; touch-action: none; }
.crop canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.crop .hint { position: absolute; top: calc(var(--sat) + 40px); left: 50%; transform: translateX(-50%); padding: 8px 14px; border-radius: 22px; background: var(--glass-dark); border: 1px solid var(--stroke); font-size: 13px; white-space: nowrap; }
.crop .bar { position: absolute; left: 12px; right: 12px; bottom: calc(var(--sab) + 28px); display: flex; gap: 8px; padding: 10px; border-radius: 22px; background: var(--glass-dark); border: 1px solid var(--stroke); }
.crop .bar .btn { flex: 1; }

/* ---------------------------------------------------------------- ダイアログ・トースト */
.dlg-wrap { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .5); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fadein .15s ease-out; }
.dlg {
  width: 100%; max-width: 420px; max-height: 80vh; display: flex; flex-direction: column;
  padding: 20px 20px 14px; border-radius: 22px; border: 1px solid var(--stroke);
  background: linear-gradient(rgba(26, 43, 69, .95), rgba(14, 26, 46, .95));
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.dlg .dt { font-size: 18px; padding-bottom: 10px; word-break: break-all; }
.dlg .dm { font-size: 14px; color: var(--text2); line-height: 1.55; white-space: pre-line; overflow-y: auto; -webkit-user-select: text; user-select: text; word-break: break-all; }
.dlg .db { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding-top: 14px; }
.dlg .items { overflow-y: auto; }
.dlg .item { display: block; width: 100%; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid transparent; }
.dlg .item:active { background: rgba(255, 255, 255, .15); }
.dlg .item.sel { background: var(--accent-a33); border-color: var(--accent); }
.dlg .item .s { font-size: 12px; color: var(--text2); }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--sab) + 180px); transform: translate(-50%, 20px); z-index: 30;
  max-width: calc(100% - 40px); padding: 10px 16px; border-radius: 18px; font-size: 14px; line-height: 1.45; text-align: center;
  background: rgba(20, 28, 48, .95); border: 1px solid var(--stroke); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
