/*
 * UI fixes on top of musicshake.min.css (2026-09-23). Not minified on purpose (no build tools on the
 * server). Loaded after the main bundle by head-includes.phtml as /css/ui.<mtime>.min.css.
 */

/* Songs / People: the submenu now opens on tap (js/ui.min.js), not on hover */
#header-nav li.m > a.t { cursor: pointer; }
#header-nav li.m > a.t::after { content: " \25BE"; font-size: 0.8em; }
#header-nav li.m.open > a.t::after { content: " \25B4"; }

/* action buttons (MP3 Download / Favorite) fully visible, not only on hover */
.item .actions { opacity: 1; }

/* play / add buttons on covers are always shown (js/ui.min.js adds them on load) */
.cdimg .play, .cdimg .add { display: block; }

/* chart rows: only the rank is left on the left side */
.item.chart .weeks, .item.chart .diff { display: none; }

/* header: always as wide as the window, so the notification / user menu on the right stays on
   screen in narrow windows (the old min-width:1000px pushed it out of a fixed header) */
#header { min-width: 0; }
#header-login {
	z-index: 3;
	background: #2a2a2a;
	padding-left: 12px;
	box-shadow: -12px 0 12px -6px #2a2a2a;
	white-space: nowrap;
}

/* chart rows: the rank fills the whole left square (the weeks/diff space is gone) */
#charts div.block.w .rank {
	height: 100px;
	line-height: 100px;
	font-size: 44px;
	font-weight: bold;
	letter-spacing: -1px;
}
#charts div.block.w .rank .icon { display: none; }

/* chart week picker (js/ui.min.js charts_nav): one button, panel opens on tap */
#charts-nav.cw { position: relative; border: none; padding: 0 0 10px; }
#charts-nav .cw-button {
	display: inline-flex; align-items: center; gap: 8px;
	background: #444; color: #fff; border: 0; border-radius: 4px;
	font: bold 15px/1 Arial, Helvetica, sans-serif; padding: 10px 14px; cursor: pointer;
}
#charts-nav .cw-button:hover { background: #555; }
#charts-nav .cw-button .cw-caret { font-size: 11px; opacity: .8; }
#charts-nav .cw-panel {
	display: none; position: absolute; left: 0; top: 46px; z-index: 50;
	background: #fff; border: 1px solid #ccc; border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.2);
	padding: 12px; gap: 10px; align-items: flex-end; flex-wrap: wrap;
}
#charts-nav.open .cw-panel { display: flex; }
#charts-nav .cw-panel label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #666; }
#charts-nav .cw-panel select { font-size: 15px; padding: 6px 8px; min-width: 90px; }
#charts-nav .cw-panel select.cw-week { min-width: 200px; }

/* Recent Songs search box (2026-09-23) */
#recent-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
#recent-search input[type=search] {
	flex: 1 1 220px; min-width: 0; font-size: 15px; padding: 8px 10px;
	border: 1px solid #bbb; border-radius: 4px;
}
#recent-search select { font-size: 15px; padding: 7px 8px; border: 1px solid #bbb; border-radius: 4px; background: #fff; }
#recent-search button {
	font: bold 15px Arial, Helvetica, sans-serif; padding: 8px 16px; border: 0; border-radius: 4px;
	background: #444; color: #fff; cursor: pointer;
}
#recent-search button:hover { background: #555; }
#recent-search .clear { font-size: 13px; }

/* list pages without the old right column (banner/ads removed): use the full content width */
#content .left.full { width: auto; float: none; }

/* ---- phones / narrow windows (2026-09-23) ------------------------------------------------------
   layout.phtml now has a viewport tag, so phones render at device width instead of zooming the
   whole ~1000px page out (which made the 12px menu text unreadably small). The page container is
   fluid up to 940px, and the menu keeps its size: it never wraps or shrinks — it scrolls sideways. */
.fixcenter { width: auto; max-width: 940px; padding: 0 10px; box-sizing: border-box; }
#content img { max-width: 100%; height: auto; }

#header { display: flex; align-items: center; height: 35px; }
#header .logo { position: static; flex: none; padding: 0 10px; line-height: 0; }
#header .logo img { height: 18px; width: auto; }
#header-nav {
	margin-left: 0; flex: 1 1 auto; min-width: 0;
	overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
#header-nav::-webkit-scrollbar { display: none; }
#header-nav ul { display: flex; flex-wrap: nowrap; margin: 0; padding: 0; }
#header-nav li { float: none; flex: none; }
#header-nav li a { font-size: 12px; white-space: nowrap; }
#header-login { position: static; flex: none; height: 35px; line-height: 35px; padding: 0 12px; }

/* song detail: chart listings sit right under the cover (2026-09-23) */
#song .song-media { width: 200px; }
#song .song-media .cdimg.large { float: none; }
#song .song-media .collage { margin: 12px 0 0; }

/* store: price buttons spread over the full width (2026-09-23) */
#store table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 10px 8px; margin: 0 -10px; }
#store td { padding: 0; }
#store button.x, #store button.plain { width: 100%; }

/* header, top right (2026-09-23): save space in the menu bar
   - logged out: only "Login" (the login page has the Facebook login and a Sign up button)
   - logged in: a bell icon instead of the "Notifications:" label (text kept for screen readers) */
#header-login-fb, #header-login > a[href="/signup"] { display: none !important; }
#header-login a.notification .label {
	position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
#header-login a.notification::before {
	content: ""; display: inline-block; width: 17px; height: 17px; margin-right: 3px; vertical-align: -4px;
	background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23efefef' d='M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z'/%3E%3C/svg%3E");
}
#header-login a.notification:hover::before { opacity: .8; }
#login-signup { margin-top: 20px; padding-top: 16px; }
#login-signup .button { display: inline-block; }

/* logo: the Musicshake wordmark on wide screens, the cup icon (from the iOS app icon) when the window is
   narrow or on phones, so all five menu items fit (2026-09-23) */
#header .logo .logo-icon { display: none; }
@media (max-width: 700px) {
	#header .logo .logo-full { display: none; }
	#header .logo .logo-icon { display: block; width: 28px; height: 28px; }
	#header .logo { padding: 0 6px 0 8px; }
}



/* home: small, fixed gap under the banner; sections with no data leave no empty space (2026-09-23) */
#index > .left.full { margin-top: 16px; }
#index .mini:empty { display: none; }
#index-best > .header { margin-bottom: 10px; }

/* home: animated hero banner (2026-09-23) — replaces the image slideshow.
   Shifting gradient, equalizer bars and rising notes; real text; motion off for "reduce motion". */
#index-hero {
	position: relative; overflow: hidden; border-radius: 8px;
	height: clamp(220px, 34vw, 320px); display: flex; align-items: center; justify-content: center;
	/* no aspect-ratio + min-height: that pair derives a ~675px min-width and overflowed phones */
	background: linear-gradient(120deg, #1a0f33, #4a1270, #0f2f55, #2b0b46, #1a0f33);
	background-size: 300% 300%; animation: hero-shift 18s ease-in-out infinite;
	color: #fff; text-align: center;
}
@keyframes hero-shift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
#index-hero .hero-bg { position: absolute; inset: 0; pointer-events: none; }
#index-hero .hero-eq {
	position: absolute; left: 0; right: 0; bottom: 0; height: 40%;
	display: flex; align-items: flex-end; gap: 4px; padding: 0 8px; opacity: .35;
}
#index-hero .hero-eq i {
	flex: 1; height: 100%; border-radius: 3px 3px 0 0; transform-origin: bottom;
	background: linear-gradient(to top, #ff3d7f, #ffb300 60%, #ffe066);
	animation: hero-eq 0.8s ease-in-out infinite alternate;
	animation-delay: calc(var(--i) * -97ms);   /* bars out of step */
}
#index-hero .hero-eq i:nth-child(3n)   { animation-duration: 0.9s; }
#index-hero .hero-eq i:nth-child(4n+1) { animation-duration: 1.2s; }
#index-hero .hero-eq i:nth-child(5n+2) { animation-duration: 0.7s; }
@keyframes hero-eq { 0% { transform: scaleY(.12); } 40% { transform: scaleY(.55); } 100% { transform: scaleY(.9); } }
#index-hero .hero-notes b {
	position: absolute; bottom: -40px; left: var(--x); font-size: 28px; font-weight: normal; color: rgba(255,255,255,.55);
	animation: hero-note var(--t) linear var(--d) infinite; opacity: 0;
}
@keyframes hero-note {
	0% { transform: translateY(0) rotate(0); opacity: 0; }
	10% { opacity: .9; }
	100% { transform: translateY(-360px) rotate(25deg); opacity: 0; }
}
#index-hero .hero-text { position: relative; padding: 24px 20px; max-width: 100%; box-sizing: border-box; }
#index-hero h2 {
	margin: 0 0 12px; font: bold clamp(22px, 5vw, 46px)/1.15 Arial, Helvetica, sans-serif; white-space: normal; overflow-wrap: break-word;
	color: #ffd600; text-shadow: 0 2px 8px rgba(0,0,0,.6);
}
#index-hero p { white-space: normal; margin: 0; font-size: clamp(15px, 2.6vw, 24px); line-height: 1.45; text-shadow: 0 1px 6px rgba(0,0,0,.7); }
@media (prefers-reduced-motion: reduce) {
	#index-hero, #index-hero .hero-eq i, #index-hero .hero-notes b { animation: none; }
	#index-hero .hero-eq i { transform: scaleY(.4); }
}


/* home "Best Musicshake Songs" (2026-09-23): a grid of square tiles at every width — as many >=100px
   columns as fit, sharing the width. (Floats left gaps with uneven title heights; a fluid width with the
   fixed 100px cover height stretched covers into rectangles below ~700px.) */
#index-best { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 14px 16px; align-items: start; }
#index-best > .header { grid-column: 1 / -1; margin-bottom: 0; }
#index-best > .clear { display: none; }
#index-best > .item { float: none; width: auto; margin: 0; }
#index-best .cdimg { width: 100%; height: auto; aspect-ratio: 1 / 1; overflow: hidden; }
#index-best .cdimg img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; display: block; }

/* hero design switch: .hero-v1 = equalizer + notes, .hero-v2 = sound waves + rings (default).
   Preview either with ?hero=1 / ?hero=2 (js/ui.min.js). */
#index-hero.hero-v1 .hero-waves, #index-hero.hero-v1 .hero-rings { display: none; }
#index-hero:not(.hero-v3) .hero-grid, #index-hero:not(.hero-v3) .hero-glow, #index-hero:not(.hero-v3) .hero-spectrum { display: none; }
#index-hero.hero-v3 .hero-eq, #index-hero.hero-v3 .hero-notes, #index-hero.hero-v3 .hero-waves, #index-hero.hero-v3 .hero-rings { display: none; }
#index-hero.hero-v2 .hero-eq, #index-hero.hero-v2 .hero-notes { display: none; }
#index-hero.hero-v2 {
	background: linear-gradient(120deg, #06283d, #1b1464, #0b3d5c, #2a0f5c, #06283d);
	background-size: 300% 300%;
}
#index-hero .hero-waves { position: absolute; inset: 0; }
#index-hero .hero-wave { position: absolute; left: 0; bottom: 0; width: 200%; height: 100%; animation: hero-wave 14s linear infinite; }
#index-hero .hero-wave.w1 { fill: rgba(0, 229, 255, .22); animation-duration: 11s; }
#index-hero .hero-wave.w2 { fill: rgba(124, 77, 255, .28); animation-duration: 16s; animation-direction: reverse; }
#index-hero .hero-wave.w3 { fill: rgba(255, 64, 129, .22); animation-duration: 22s; }
@keyframes hero-wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }
#index-hero .hero-rings { position: absolute; left: 50%; top: 45%; width: 0; height: 0; }
#index-hero .hero-rings span {
	position: absolute; left: -150px; top: -150px; width: 300px; height: 300px; border-radius: 50%;
	border: 2px solid rgba(0, 229, 255, .45); opacity: 0; animation: hero-ring 6s ease-out infinite;
}
#index-hero .hero-rings span:nth-child(2) { animation-delay: 2s; border-color: rgba(124, 77, 255, .45); }
#index-hero .hero-rings span:nth-child(3) { animation-delay: 4s; border-color: rgba(255, 64, 129, .40); }
@keyframes hero-ring { 0% { transform: scale(.25); opacity: .9; } 100% { transform: scale(2.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
	#index-hero .hero-wave, #index-hero .hero-rings span { animation: none; }
	#index-hero .hero-rings span:first-child { opacity: .5; transform: scale(1); }
}

/* hero design #3 — dark studio (2026-09-23): near-black, faint grid, two slow soft lights, a thin mirrored
   waveform; white title with a gold rule, grey body. */
#index-hero.hero-v3 { background: #0b0d12; animation: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
#index-hero .hero-grid {
	position: absolute; inset: 0;
	background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
	                  linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
	background-size: 40px 40px;
	-webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
	        mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}
#index-hero .hero-glow span {
	position: absolute; width: 60%; height: 140%; top: -20%; border-radius: 50%; filter: blur(40px); opacity: .35;
	background: radial-gradient(circle, rgba(64, 120, 255, .55), transparent 65%);
	animation: hero-glow 16s ease-in-out infinite alternate;
}
#index-hero .hero-glow span:nth-child(2) {
	background: radial-gradient(circle, rgba(212, 175, 55, .35), transparent 65%);
	animation-duration: 22s; animation-direction: alternate-reverse; left: 40%;
}
@keyframes hero-glow { 0% { transform: translateX(-30%); } 100% { transform: translateX(60%); } }
#index-hero .hero-spectrum {
	position: absolute; left: 6%; right: 6%; top: 50%; height: 64%; transform: translateY(-50%);
	display: flex; align-items: center; gap: 3px; opacity: .22;
}
#index-hero .hero-spectrum i {
	flex: 1; height: calc(var(--h) * 100%); border-radius: 2px;
	background: linear-gradient(to bottom, transparent, #cfd8ff 30%, #ffffff 50%, #cfd8ff 70%, transparent);
	animation: hero-breathe 2.4s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -71ms);
}
@keyframes hero-breathe { 0% { transform: scaleY(.35); } 100% { transform: scaleY(1); } }
#index-hero.hero-v3 h2 { color: #ffffff; letter-spacing: .3px; text-shadow: 0 2px 20px rgba(0,0,0,.8); }
#index-hero h2, #index-hero p { text-wrap: balance; }   /* even line breaks on phones */
#index-hero.hero-v3 h2::after {
	content: ""; display: block; width: 64px; height: 2px; margin: 16px auto 0; background: #d4af37; border-radius: 2px;
}
#index-hero.hero-v3 p { color: #aab2c0; text-shadow: none; }
@media (prefers-reduced-motion: reduce) {
	#index-hero .hero-glow span, #index-hero .hero-spectrum i { animation: none; }
}

/* menu bar: everything centred on the bar's vertical middle (2026-09-23). Links were placed with
   line-height (text sat a little high) and the login area used 11px text with its own offsets (a little low). */
#header-nav li a { display: flex; align-items: center; height: 35px; line-height: 1; }
#header-login { display: flex; align-items: center; gap: 12px; line-height: 1; }
#header-login > a { display: inline-flex; align-items: center; height: 35px; margin-left: 0; font-size: 12px; line-height: 1; }
#header-login a.notification::before { vertical-align: middle; }
#header .logo { display: flex; align-items: center; height: 35px; }
/* optical alignment: the wordmark's letter bodies sat 2px below the menu text's (measured on a 2x
   screenshot: dense-band centre 39 vs 35 device px) — lift it 2px */
#header .logo .logo-full { position: relative; top: -2px; }
