/* Mantra Guru Dev 12C - consolidated layout */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: linear-gradient(135deg,#312e81,#581c87); color: #fff; font: 16px/1.4 Arial,sans-serif; }
main { max-width: 1190px; margin: auto; padding: 8px 16px 6px; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
header { text-align: center; margin-bottom: 10px; }
/* Verified VIP status: independent of the desktop heading and player geometry. */
.mg-header { position: relative; }
.member-status { position: absolute; top: 0; right: 0; width: min(25%, 230px); text-align: right; font-size: 12px; line-height: 1.25; }
.member-label { display: block; color: #f4dc9e; font-size: 14px; font-weight: 700; text-decoration: none; }
.member-name { display: block; color: #f1e8ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-status form { margin: 0; }
.member-status button { background: transparent; color: #e9d5ff; padding: 0; border-radius: 0; font-size: 11px; line-height: 1.2; text-decoration: underline; }
.member-label:hover { text-decoration: underline; }
h1 { font-size: clamp(28px,4.4vh,38px); line-height: 1.1; margin: 0 0 4px; }
header p { font-size: 14px; margin: 0; opacity: .9; }
.columns { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.12fr); gap: 14px; align-items: stretch; flex: 1; }
.left-column { display: grid; grid-template-rows: minmax(0,1fr) auto; gap: 10px; min-width: 0; }
.panel { background: #ffffff1b; border-radius: 9px; padding: 12px; min-width: 0; }
/* Player: centered full-width information rows, paired control groups */
.player { display: grid; grid-template-columns: minmax(0,1fr) auto auto minmax(0,1fr); grid-template-rows: minmax(180px,1fr) repeat(6,auto); align-items: center; justify-items: center; gap: 6px; text-align: center; min-width: 0; }
.player .visual { grid-column: 1/-1; grid-row: 1; position: relative; width: 100%; height: 100%; min-height: 0; overflow: hidden; border-radius: 8px; }
.visual button,.visual video,.visual img { width: 100%; height: 100%; object-fit: contain; }
.visual button,.visual video { position: absolute; inset: 0; }
.visual button { background: transparent; padding: 0; }
.visual video { display: block; object-position: center center; }
button { font: inherit; color: #fff; border: 0; cursor: pointer; background: #9333ea; border-radius: 24px; padding: 7px 17px; }
button:focus-visible,a:focus-visible { outline: 3px solid #facc15; outline-offset: 3px; }
.player .welcome-slot { grid-column: 1/-1; grid-row: 2; min-height: 1.3em; font-size: 20px; width: 100%; }
.player #welcome[hidden] { display: block !important; visibility: hidden; }
#welcome { font-size: 20px; line-height: 1.3; font-weight: 600; margin: 0; }
.player #title { grid-column: 1/-1; grid-row: 3; font-size: 30px; font-weight: 700; line-height: 1.2; margin: 0; text-align: center; overflow-wrap: anywhere; max-width: 100%; height: 2.4em; min-height: 2.4em; display: grid; place-items: center; }
.player:has(#chanter:empty) #title { visibility: hidden; }
.player #chanter { grid-column: 1/-1; grid-row: 4; font-size: 22px; line-height: 1.3; min-height: 1.3em; margin: 0; text-align: center; }
.player #chanter:empty { visibility: hidden; }
.player #count { grid-column: 1/-1; grid-row: 5; display: inline-block; background: #5145cd; border-radius: 20px; padding: 5px 14px; font-size: 17px; white-space: nowrap; }
.player > div:has(> #random) { grid-column: 2; grid-row: 6; }
.player #random { background: #4f46e5; font-size: 21px; padding: 9px 15px; white-space: nowrap; }
.player .controls { grid-column: 3; grid-row: 6; display: flex; justify-content: center; gap: 6px; margin: 0; }
.player .controls button { font-size: 21px; padding: 9px 13px; white-space: nowrap; }
#stop { background: #dc2626; }
.player #status { grid-column: 1/-1; grid-row: 7; font-size: 15px; margin: 0; color: #f5e7ff; height: 1.4em; min-height: 1.4em; overflow: auto; }
.player #status:empty { visibility: hidden; }
/* Background sounds and reading area */
.right-panel { display: flex; flex-direction: column; }
.background-title { font-size: 20px; margin: 0 0 8px; }
.sounds { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px 10px; flex-shrink: 0; }
.sound { border-radius: 6px; background: transparent; padding: 0; overflow: hidden; display: flex; flex-direction: column; gap: 3px; }
.sound img { width: 100%; height: clamp(80px,11vh,115px); object-fit: contain; object-position: center; background: #30204f; }
.sound span { display: block; width: 100%; background: #2e1c50; border-radius: 5px; font-size: 15px; padding: 2px; }
.sound[aria-pressed=true] { outline: 3px solid #a78bfa; }
.sound[aria-pressed=true] span { background: #6d28d9; }
.mantra-details { margin-top: 9px; padding: 10px 12px; background: #26164588; border-radius: 8px; border: 1px solid #ffffff24; flex: 1 0 auto; }
.mantra-details h3 { font-size: 18px; margin: 0 0 5px; color: #e9d5ff; }
.description-stack { display: grid; min-width: 0; }
#benefits,.description-measure { grid-area: 1/1; font-size: 24px; line-height: 1.35; margin: 0; color: #fff; overflow-wrap: anywhere; }
.description-measure,.credit-measure { visibility: hidden; pointer-events: none; user-select: none; }
.credit-slot { display: grid; min-width: 0; flex-shrink: 0; }
#sound-credit,.credit-measure { grid-area: 1/1; margin-top: 6px; padding: 6px 8px; border-top: 1px solid #ffffff35; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
#sound-credit p,.credit-measure p { white-space: pre-line; margin: 4px 0 0; }
#sound-credit strong,.credit-measure strong { font-size: 14px; }
/* Commercial navigation */
.commercial { display: flex; flex-direction: column; justify-content: center; gap: 7px; padding: 10px 12px; }
.commercial h2 { margin: 0; text-align: center; font-size: 17px; color: #f4eaff; }
.commercial-links { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.commercial-link { display: block; text-align: center; padding: 9px 4px; border-radius: 8px; background: #382259; border: 1px solid #ffffff30; color: #fff; text-decoration: none; font-weight: bold; font-size: 13px; line-height: 1.3; }
.commercial-link:first-child { background: #5145cd; }
.commercial-link:hover { background: #6743a2; }
.commercial-link small { display: block; font-size: 11px; font-weight: normal; color: #e9d5ff; margin-top: 2px; }
footer { text-align: center; margin-top: 6px; font-size: 11px; }
a { color: #e9d5ff; }
/* Narrow screens: single column; controls may occupy two rows */
@media (max-width: 800px) {
    main { padding: 16px 12px; }
    .member-status { position: static; width: auto; display: flex; justify-content: center; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; text-align: center; }
    .member-name { white-space: normal; overflow-wrap: anywhere; }
    .columns { grid-template-columns: 1fr; }
    .left-column { display: contents; }
    .player { grid-row: 1; grid-template-rows: auto repeat(6,auto); }
    .right-panel { grid-row: 2; }
    .commercial { grid-row: 3; }
    .panel { padding: 15px; }
    .player .visual { height: auto; aspect-ratio: 4/3; max-height: 360px; }
    .sound img { height: auto; aspect-ratio: 2.4; }
    .description-measure,.credit-measure { display: none; }
    #benefits { font-size: 20px; }
    .player #title { font-size: 26px; }
    .player #chanter { font-size: 19px; }
}
@media (max-width: 450px), (min-width: 801px) and (max-width: 1000px) {
    .player > div:has(> #random) { grid-column: 1/-1; grid-row: 6; }
    .player .controls { grid-column: 1/-1; grid-row: 7; }
    .player #status { grid-row: 8; }
}
@media (max-width: 450px) {
    .commercial-links { grid-template-columns: 1fr; }
}
