/* Tanuki Thunder · Bar Mode (full-screen jukebox). Builds on /styles.css tokens. */
html, body.bar { height: 100%; background: #000; }
body.bar { overflow: hidden; font-size: 18px; line-height: 1.35; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  background: radial-gradient(120% 90% at 30% 0%, #1d160c 0%, #0b0907 45%, #000 100%); }
body.bar svg { width: 1em; height: 1em; flex: none; }
.bar-app { height: 100dvh; display: grid; grid-template-rows: auto 1fr; padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); gap: 12px; }
.bar-app::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(90deg, rgba(212,175,90,.025) 0 2px, transparent 2px 9px), radial-gradient(60% 40% at 50% 110%, rgba(212,175,90,.12), transparent 70%); }
.bar-app > * { position: relative; z-index: 1; }

/* top bar */
.bar-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; border-bottom: 1px solid rgba(212,175,90,.35); padding-bottom: 10px; }
.bar-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-height: 64px; }
.bar-brand img { width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(212,175,90,.6); object-fit: cover; }
.bar-brand b { display: block; font: 400 1.35rem/1 var(--display); color: var(--gold); letter-spacing: .02em; }
.bar-brand small { display: block; font-size: .8rem; color: var(--muted); margin-top: 4px; }
.bar-clock { font: 400 clamp(2.2rem, 5.2vw, 4.2rem)/1 var(--display); color: var(--gold-hi); letter-spacing: .04em; text-shadow: 0 0 24px rgba(212,175,90,.35); font-variant-numeric: tabular-nums; }
.bar-status { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid rgba(212,175,90,.35); border-radius: 99px; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.pill i { width: 10px; height: 10px; border-radius: 50%; background: #6b5a3a; box-shadow: 0 0 0 3px rgba(107,90,58,.25); }
.pill[data-on="true"] { color: var(--gold-hi); border-color: rgba(212,175,90,.7); }
.pill[data-on="true"] i { background: #7fd36b; box-shadow: 0 0 10px #7fd36b; }
.pill[data-on="na"] i { background: #c9733a; }
.tbtn { min-width: 64px; min-height: 64px; display: inline-grid; place-items: center; padding: 0 14px; font: 600 1rem var(--body); color: var(--gold); background: transparent; border: 1px solid rgba(212,175,90,.45); border-radius: 6px; cursor: pointer; }
.tbtn svg { font-size: 26px; }
.tbtn:active { background: rgba(212,175,90,.15); }

/* layout */
.bar-main { min-height: 0; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 16px; }
.frame::before { opacity: .9; }
.np { min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: clamp(10px, 2vh, 22px); padding: clamp(22px, 4vh, 44px) clamp(22px, 3.4vw, 52px);
  background: linear-gradient(180deg, rgba(27,22,15,.92), rgba(11,9,7,.96)); border-radius: 6px; overflow: hidden; }
.np-kicker { margin: 0; display: flex; align-items: center; gap: 12px; font-size: .95rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.np-kicker small { letter-spacing: .1em; color: var(--muted); font-size: .85rem; }
.np-title { font: 400 clamp(2.4rem, 5.6vw, 5.4rem)/1.06 var(--display); color: var(--cream); text-wrap: balance; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 2px 0 #000, 0 0 40px rgba(212,175,90,.18); }
.np-title[lang="ja"] { font-family: var(--jp); font-weight: 800; letter-spacing: .04em; line-height: 1.2; }
.np-title.swap { animation: rise .5s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.np-note { margin: 0; color: var(--gold-hi); font-size: 1.05rem; }
.eq { display: inline-flex; gap: 3px; align-items: flex-end; height: 18px; }
.eq i { width: 4px; height: 30%; background: var(--gold); border-radius: 1px; }
body[data-state="playing"] .eq i { animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s !important; } .eq i:nth-child(3) { animation-delay: -.6s !important; } .eq i:nth-child(4) { animation-delay: -.15s !important; }
@keyframes eq { 0%,100% { height: 25%; } 50% { height: 100%; } }
@media (prefers-reduced-motion: reduce) { body .eq i { animation: none !important; } .np-title.swap { animation: none; } }

/* seek + ranges */
.np-seek { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; }
.time { font: 600 clamp(1.3rem, 2.4vw, 2rem)/1 var(--body); color: var(--gold-hi); font-variant-numeric: tabular-nums; min-width: 3.2em; }
.time:last-child { text-align: right; color: var(--muted); }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 64px; background: transparent; cursor: pointer; --pct: 0%; margin: 0; }
.range::-webkit-slider-runnable-track { height: 14px; border-radius: 99px; background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi) var(--pct), #2a2216 var(--pct)); box-shadow: inset 0 0 0 1px rgba(212,175,90,.35); }
.range::-moz-range-track { height: 14px; border-radius: 99px; background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi) var(--pct), #2a2216 var(--pct)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; margin-top: -10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff4cf, var(--gold) 55%, var(--gold-lo)); border: 2px solid #000; box-shadow: 0 0 0 2px var(--gold), 0 4px 10px #000; }
.range::-moz-range-thumb { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); border: 2px solid #000; }
.seek::-webkit-slider-runnable-track { height: 18px; } .seek::-webkit-slider-thumb { margin-top: -8px; }

/* buttons */
.np-controls { display: flex; justify-content: center; align-items: center; gap: clamp(10px, 2vw, 26px); }
.cbtn { min-width: 76px; min-height: 76px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px 12px;
  font: 600 .82rem var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); background: linear-gradient(180deg, #1f1910, #0e0b07);
  border: 1px solid rgba(212,175,90,.5); border-radius: 10px; cursor: pointer; transition: transform .08s, background .2s, color .2s; }
.cbtn svg { font-size: 34px; }
.cbtn:active { transform: scale(.96); }
.cbtn[aria-pressed="true"] { color: #000; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); border-color: var(--gold-hi); }
.cbtn.play { width: clamp(110px, 12vw, 140px); height: clamp(110px, 12vw, 140px); border-radius: 50%; color: #000; border: 2px solid var(--gold-hi);
  background: radial-gradient(circle at 35% 28%, #fff1c4, var(--gold) 50%, var(--gold-lo)); box-shadow: 0 0 0 6px rgba(212,175,90,.14), 0 0 40px rgba(212,175,90,.35), inset 0 -6px 12px rgba(0,0,0,.25); }
.cbtn.play svg { font-size: 56px; }
.cbtn.play .is, body[data-state="playing"] .cbtn.play .ip { display: none; }
body[data-state="playing"] .cbtn.play .is { display: block; }
.cbtn.wide { flex-direction: row; gap: 12px; padding: 0 22px; font-size: .95rem; min-height: 64px; }
.cbtn.wide svg { font-size: 28px; }
.cbtn.gold { color: #000; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); }
.cbtn.ghost { color: var(--muted); border-color: rgba(201,187,160,.3); }
#fade[aria-pressed="true"] { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(241,213,138,.18); } }
.np-bottom { display: flex; align-items: center; gap: 18px; }
.vol { flex: 1; display: flex; align-items: center; gap: 14px; color: var(--gold); }
.vol svg { font-size: 34px; }
#closing[aria-pressed="true"] { max-width: 55%; }
#closing-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-pool { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.np-pool .lab { font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.chip { min-height: 48px; padding: 0 16px; font: 600 .9rem var(--body); color: var(--muted); background: transparent; border: 1px solid rgba(212,175,90,.3); border-radius: 99px; cursor: pointer; }
.chip[aria-pressed="true"] { color: #000; background: var(--gold); border-color: var(--gold); }

/* side panels */
.side { min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 14px; }
.searchbar { min-height: 76px; display: flex; align-items: center; gap: 14px; padding: 0 22px; font: 600 1.25rem var(--body); color: #000; border: 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold)); box-shadow: 0 6px 24px rgba(212,175,90,.25); }
.searchbar svg { font-size: 30px; } .searchbar small { margin-left: auto; font-size: .9rem; opacity: .7; }
.panel { min-height: 0; display: flex; flex-direction: column; padding: 18px 20px; background: rgba(19,16,12,.92); border-radius: 6px; overflow: hidden; }
.panel h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font: 400 1.3rem var(--display); color: var(--gold); }
.panel h2 small { font-size: .8rem; color: var(--muted); }
.count { min-width: 30px; height: 26px; display: inline-grid; place-items: center; padding: 0 8px; font: 700 .85rem var(--body); color: #000; background: var(--gold); border-radius: 99px; }
.mini { margin-left: auto; min-height: 48px; padding: 0 16px; font: 600 .85rem var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); background: none; border: 1px solid rgba(212,175,90,.45); border-radius: 6px; cursor: pointer; }
.mini:disabled { opacity: .35; }
.list { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 0; -webkit-overflow-scrolling: touch; }
.list li { display: flex; align-items: center; gap: 10px; min-height: 64px; border-top: 1px solid rgba(212,175,90,.14); }
.list li:first-child { border-top: 0; }
.list .n { width: 26px; flex: none; font: 400 1rem var(--display); color: var(--gold-lo); text-align: center; }
.list .t { flex: 1; min-width: 0; font-size: 1.15rem; color: var(--cream); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .t[lang="ja"] { font-family: var(--jp); font-weight: 700; }
.list .tag { flex: none; font-size: .7rem; letter-spacing: .15em; text-transform: uppercase; color: #000; background: var(--gold); padding: 2px 8px; border-radius: 3px; }
.list .x { flex: none; width: 64px; height: 56px; display: grid; place-items: center; color: var(--muted); background: none; border: 1px solid rgba(201,187,160,.25); border-radius: 8px; cursor: pointer; font-size: 26px; }
.list .x:active { color: #000; background: var(--gold); }
#upnext { flex: none; }
.empty { color: var(--muted); font-style: italic; margin: 6px 0 0; }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(0,0,0,.82); backdrop-filter: blur(8px); }
.overlay[hidden] { display: none; }
.sheet { width: min(1100px, 100% - 24px); height: calc(100dvh - 24px); display: grid; grid-template-rows: auto auto 1fr; gap: 10px; padding: 18px; background: #0b0907; border: 1px solid rgba(212,175,90,.5); border-radius: 10px; }
.search-head { display: flex; gap: 12px; }
.search-in { flex: 1; display: flex; align-items: center; gap: 14px; padding: 0 20px; border: 2px solid var(--gold); border-radius: 10px; background: #13100c; color: var(--gold); }
.search-in svg { font-size: 32px; }
.search-in input { flex: 1; min-width: 0; height: 76px; font: 500 2rem var(--body); color: var(--cream); background: none; border: 0; outline: 0; }
.search-hint { margin: 0; color: var(--muted); }
.results { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 0; }
.results button { width: 100%; min-height: 76px; display: flex; align-items: center; gap: 16px; padding: 0 18px; text-align: left; font: 500 1.6rem var(--body); color: var(--cream); background: none; border: 0; border-bottom: 1px solid rgba(212,175,90,.16); cursor: pointer; }
.results button[lang="ja"] { font-family: var(--jp); font-weight: 700; font-size: 1.45rem; }
.results button:active { background: rgba(212,175,90,.14); }
.results mark { background: none; color: var(--gold-hi); text-decoration: underline; text-underline-offset: 4px; }
.dialog { width: min(620px, 100% - 32px); padding: 34px; background: linear-gradient(180deg, #1b160f, #0b0907); border-radius: 8px; text-align: center; }
.dialog h2 { margin: 10px 0 24px; font: 400 clamp(1.8rem, 4vw, 2.6rem)/1.15 var(--display); color: var(--cream); overflow-wrap: anywhere; }
.dialog h2[lang="ja"] { font-family: var(--jp); font-weight: 800; }
.dialog .np-kicker { justify-content: center; }
.pick-btns { display: grid; gap: 12px; }
.pick-btns .cbtn { min-height: 76px; font-size: 1.05rem; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 30; transform: translate(-50%, calc(100% + 80px)); opacity: 0; padding: 16px 26px; font-size: 1.1rem; color: #000; background: var(--gold-hi); border-radius: 8px; box-shadow: 0 10px 30px #000; transition: transform .3s; pointer-events: none; max-width: 90vw; }
.toast.on { transform: translate(-50%, 0); opacity: 1; }

/* portrait / small */
@media (orientation: portrait), (max-width: 900px) {
  body.bar { overflow-y: auto; }
  .bar-app { height: auto; min-height: 100dvh; }
  .bar-main { grid-template-columns: 1fr; }
  .np-title { font-size: clamp(2.4rem, 8.4vw, 5rem); }
  .side { grid-template-rows: auto auto auto; }
  .panel .list { max-height: 50vh; }
}
@media (max-width: 640px) {
  .bar-top { grid-template-columns: 1fr auto; } .bar-clock { grid-row: 2; grid-column: 1 / -1; text-align: center; }
  .bar-brand small, .pill #wake-txt { display: none; }
  .cbtn { min-width: 64px; min-height: 64px; } .cbtn > span { display: none; }
  .np-bottom { flex-wrap: wrap; }
}
@media (orientation: landscape) and (max-height: 700px) { .np-pool .lab { display: none; } .cbtn { min-height: 64px; } .cbtn.play { width: 104px; height: 104px; } }
