/*
 * ============================================================
 * PsyBrazil Hyper Audio Core Edition
 * Frontend Styles
 * ============================================================
 */

:root {
    --psb-bg: #06060a;
    --psb-panel: rgba(12, 12, 20, 0.84);
    --psb-panel-strong: rgba(20, 20, 32, 0.94);
    --psb-text: #ffffff;
    --psb-muted: rgba(255, 255, 255, 0.68);
    --psb-border: rgba(255, 255, 255, 0.14);
    --psb-theme: #ff6600;
    --psb-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    background: radial-gradient(circle at top, #191424 0%, var(--psb-bg) 55%, #000 100%);
    color: var(--psb-text);
    font-family: Arial, Helvetica, sans-serif;
}

body {
    overflow-x: hidden;
}

.psb-embed-body {
    background: transparent;
}

.psb-flipbook {
    width: 100%;
    max-width: 1180px;
    min-height: 760px;
    margin: 0 auto;
    padding: 28px;
    position: relative;
}

.psb-flipbook-embed {
    max-width: none;
    min-height: 100vh;
    padding: 0;
}

.psb-refresh-badge {
    position: absolute;
    top: 18px;
    right: 24px;
    z-index: 20;
    padding: 10px 14px;
    border: 1px solid var(--psb-border);
    border-radius: 999px;
    color: var(--psb-muted);
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(14px);
    font-size: 13px;
}

.psb-stage {
    position: relative;
    min-height: 700px;
    border: 1px solid var(--psb-border);
    border-radius: 32px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.42);
    box-shadow: var(--psb-shadow);
}

.psb-flipbook-embed .psb-stage {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
}

.psb-page {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateX(32px) scale(0.985);
    transition: opacity 420ms ease, transform 420ms ease;
    pointer-events: none;
    overflow: hidden;
}

.psb-page.is-active {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
    z-index: 5;
}

.psb-page-inner {
    position: relative;
    z-index: 2;
    min-height: 700px;
    padding: 56px;
}

.psb-flipbook-embed .psb-page-inner {
    min-height: 100vh;
}

.psb-kicker,
.psb-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--psb-theme);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.psb-page h1,
.psb-page h2 {
    margin: 10px 0 10px;
    line-height: 1;
}

.psb-page h1 {
    font-size: clamp(54px, 9vw, 120px);
    letter-spacing: -0.08em;
}

.psb-page h2 {
    font-size: clamp(34px, 4.6vw, 72px);
    letter-spacing: -0.06em;
}

.psb-page-number {
    color: var(--psb-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.psb-cover-bg,
.psb-station-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.46;
    filter: saturate(1.2) contrast(1.1);
}

.psb-cover-bg {
    background:
        radial-gradient(circle at 20% 15%, rgba(255, 102, 0, 0.42), transparent 35%),
        radial-gradient(circle at 80% 35%, rgba(0, 170, 255, 0.28), transparent 32%),
        linear-gradient(135deg, #180b0a, #05050a);
    opacity: 1;
}

.psb-station-bg::after,
.psb-cover-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.32));
}

.psb-cover-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.psb-cover-subtitle,
.psb-footer-card p {
    max-width: 620px;
    margin: 0 0 30px;
    color: var(--psb-muted);
    font-size: 20px;
    line-height: 1.45;
}

.psb-cover-totals,
.psb-stat-grid,
.psb-footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    max-width: 780px;
}

.psb-cover-totals > div,
.psb-stat-grid > div,
.psb-footer-grid > div {
    padding: 20px;
    border: 1px solid var(--psb-border);
    border-radius: 22px;
    background: var(--psb-panel);
    backdrop-filter: blur(16px);
}

.psb-cover-totals strong,
.psb-stat-grid strong,
.psb-footer-grid strong {
    display: block;
    color: #fff;
    font-size: 38px;
    line-height: 1;
}

.psb-cover-totals span,
.psb-stat-grid span,
.psb-footer-grid span {
    display: block;
    margin-top: 8px;
    color: var(--psb-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.psb-cover-status,
.psb-station-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    color: var(--psb-muted);
}

.psb-live-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--psb-theme);
    box-shadow: 0 0 18px var(--psb-theme);
}

.psb-page-station {
    --psb-theme: #ff6600;
}

.psb-station-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.psb-station-top {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.psb-station-logo {
    width: 82px;
    height: 82px;
    object-fit: contain;
    border-radius: 22px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--psb-border);
}

.psb-now-block {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    max-width: 1040px;
    padding: 22px;
    border: 1px solid var(--psb-border);
    border-radius: 30px;
    background: var(--psb-panel-strong);
    backdrop-filter: blur(18px);
}

.psb-cover-art {
    width: 168px;
    height: 168px;
    border-radius: 26px;
    object-fit: cover;
    border: 1px solid var(--psb-border);
    background: #111;
}

.psb-now-text strong {
    display: block;
    margin-top: 12px;
    font-size: clamp(25px, 3.4vw, 46px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.psb-now-text small {
    display: block;
    margin-top: 14px;
    color: var(--psb-muted);
    font-size: 16px;
}

.psb-live-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    max-width: 1040px;
    margin-top: 18px;
}

.psb-live-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    border: 1px solid var(--psb-border);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.34);
}

.psb-live-row span {
    color: var(--psb-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.psb-live-row strong {
    color: #fff;
    font-size: 15px;
    text-align: right;
}

.psb-live-row em {
    color: var(--psb-muted);
    font-style: normal;
}

.psb-history {
    margin-top: 18px;
    max-width: 1040px;
    padding: 18px 22px;
    border: 1px solid var(--psb-border);
    border-radius: 24px;
    background: rgba(0, 0, 0, 0.38);
}

.psb-history ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 24px;
    margin: 12px 0 0;
    padding-left: 20px;
    color: var(--psb-muted);
    max-height: 210px;
    overflow: auto;
}

.psb-history li {
    font-size: 13px;
    line-height: 1.32;
}

.psb-page.is-offline .psb-live-dot {
    background: #777;
    box-shadow: none;
}

.psb-sponsor-card,
.psb-footer-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.psb-sponsor-link {
    display: flex;
    width: min(720px, 100%);
    min-height: 260px;
    margin: 24px 0;
    align-items: center;
    justify-content: center;
    border-radius: 30px;
    border: 1px solid var(--psb-border);
    background: var(--psb-panel-strong);
    overflow: hidden;
}

.psb-sponsor-link img {
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
}

.psb-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    padding: 18px 0 0;
}

.psb-flipbook-embed .psb-controls {
    position: absolute;
    left: 50%;
    bottom: 18px;
    z-index: 30;
    transform: translateX(-50%);
    padding: 8px 12px;
    border: 1px solid var(--psb-border);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(14px);
}

.psb-controls button {
    width: 46px;
    height: 46px;
    border: 1px solid var(--psb-border);
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.psb-controls button:hover {
    background: rgba(255, 255, 255, 0.16);
}

.psb-controls span {
    color: var(--psb-muted);
    min-width: 80px;
    text-align: center;
}

.has-error .psb-cover-status,
.has-error .psb-station-status {
    color: #ff9b9b;
}

@media (max-width: 760px) {
    .psb-flipbook {
        padding: 14px;
        min-height: 760px;
    }

    .psb-stage,
    .psb-page-inner {
        min-height: 720px;
    }

    .psb-page-inner {
        padding: 28px;
    }

    .psb-cover-totals,
    .psb-stat-grid,
    .psb-footer-grid,
    .psb-history ol,
    .psb-live-details {
        grid-template-columns: 1fr;
    }

    .psb-now-block {
        grid-template-columns: 1fr;
    }

    .psb-cover-art {
        width: 150px;
        height: 150px;
    }

    .psb-station-logo {
        width: 64px;
        height: 64px;
    }

    .psb-live-row {
        display: block;
    }

    .psb-live-row strong {
        display: block;
        margin-top: 5px;
        text-align: left;
    }
}


/*
 * ============================================================
 * v1.1.2 Magical Book Spread / Legacy Station Pages
 * ============================================================
 */

.psb-flipbook-book {
    max-width: 1120px;
    min-height: 860px;
    padding: 28px 22px 84px;
}

.psb-flipbook-book.psb-flipbook-embed {
    min-height: 900px;
    padding: 24px 0 88px;
}

.psb-flipbook-book .psb-stage {
    width: min(980px, calc(100vw - 40px));
    min-height: 760px;
    margin: 0 auto;
    overflow: visible;
    border: 5px solid #000;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 18px 55px rgba(0,0,0,.45);
    cursor: pointer;
}

.psb-flipbook-book .psb-page {
    display: none;
    position: absolute;
    top: 0;
    bottom: 0;
    inset: auto;
    width: 50%;
    min-height: 760px;
    opacity: 0;
    transform: none;
    transition: opacity 260ms ease, box-shadow 260ms ease;
    pointer-events: none;
    overflow: hidden;
    background: #fff;
    color: #00a7a7;
    font-family: Georgia, 'Times New Roman', serif;
}

.psb-flipbook-book .psb-page.is-active {
    display: block;
    opacity: 1;
    pointer-events: auto;
    z-index: 5;
}

.psb-flipbook-book .psb-page.is-left {
    left: 0;
    border-right: 1px solid rgba(0,0,0,.28);
    box-shadow: inset -28px 0 32px rgba(0,0,0,.12);
}

.psb-flipbook-book .psb-page.is-right {
    right: 0;
    border-left: 1px solid rgba(255,255,255,.6);
    box-shadow: inset 28px 0 32px rgba(0,0,0,.10);
}

.psb-flipbook-book .psb-page.is-single {
    left: 25%;
    right: auto;
    width: 50%;
    box-shadow: 0 0 34px rgba(0,0,0,.24);
}

.psb-flipbook-book .psb-page-inner {
    min-height: 760px;
    padding: 22px 28px;
}

.psb-page-paper .psb-cover-bg,
.psb-page-paper .psb-station-bg {
    opacity: .18;
    filter: saturate(1.15) contrast(1.05);
}

.psb-page-paper .psb-cover-bg::after,
.psb-page-paper .psb-station-bg::after {
    background: rgba(255,255,255,.66);
}

.psb-legacy-page-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #00aaa8;
    font-weight: 700;
    overflow-y: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.psb-legacy-page-content h1 {
    margin: 38px 0 10px;
    color: purple;
    font-size: clamp(30px, 3.2vw, 44px);
    line-height: 1.02;
    letter-spacing: -0.02em;
}

.psb-legacy-page-content h2 {
    margin: 14px 0 12px;
    color: rebeccapurple;
    font-size: clamp(24px, 2.2vw, 34px);
    line-height: 1.08;
    letter-spacing: 0;
}

.psb-legacy-page-content .psb-kicker {
    color: #ff7a00;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    letter-spacing: .16em;
}

.psb-cover-paper h2 {
    color: mediumpurple;
    font-size: 20px;
    line-height: 1.25;
}

.psb-cover-total-hits {
    margin-top: 28px;
    color: orange;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 24px;
    font-weight: 900;
}

.psb-cover-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 22px auto 0;
    max-width: 410px;
    font-family: Arial, Helvetica, sans-serif;
}

.psb-cover-mini-grid > div {
    padding: 10px 8px;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 12px;
    background: rgba(255,255,255,.72);
}

.psb-cover-mini-grid strong {
    display: block;
    color: #111;
    font-size: 22px;
}

.psb-cover-mini-grid span {
    display: block;
    color: #666;
    font-size: 10px;
    text-transform: uppercase;
}

.psb-station-name {
    margin-bottom: 8px;
    color: var(--psb-theme);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.psb-current-title,
.psb-on-air-title {
    color: #00aaa8;
    font-size: 15px;
    line-height: 1.25;
    margin: 8px auto;
    max-width: 390px;
}

.psb-radio-lines {
    margin: 7px auto 4px;
    max-width: 410px;
    font-size: 14px;
    line-height: 1.34;
}

.psb-red { color: red; }
.psb-pink { color: hotpink; }
.psb-blue { color: blue; }
.psb-purple { color: purple; }
.psb-cyan { color: darkturquoise; }
.psb-yellow { color: #d8d800; }
.psb-green { color: green; }

.psb-station-status {
    justify-content: center;
    margin-top: 6px;
    color: #00aaa8;
    font-size: 14px;
}

.psb-played-list {
    margin: 16px auto 0;
    padding-left: 22px;
    max-width: 390px;
    color: #00aaa8;
    font-size: 13px;
    line-height: 1.28;
    text-align: center;
    max-height: 430px;
    overflow: auto;
}

.psb-played-list li {
    margin-bottom: 5px;
}

.psb-page-number {
    position: absolute;
    right: 20px;
    bottom: 18px;
    color: lightgreen;
    font-size: 12px;
    text-transform: none;
    letter-spacing: 0;
}

.psb-flipbook-book .psb-controls {
    position: absolute;
    left: 50%;
    bottom: 18px;
    z-index: 40;
    transform: translateX(-50%);
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    background: rgba(0,0,0,.62);
    backdrop-filter: blur(14px);
}

.psb-flipbook-book .psb-controls button {
    width: 42px;
    height: 42px;
}

@media (max-width: 819px) {
    .psb-flipbook-book,
    .psb-flipbook-book.psb-flipbook-embed {
        min-height: 780px;
        padding: 12px 8px 84px;
    }

    .psb-flipbook-book .psb-stage {
        width: min(470px, calc(100vw - 18px));
        min-height: 720px;
    }

    .psb-flipbook-book .psb-page,
    .psb-flipbook-book .psb-page.is-single,
    .psb-flipbook-book .psb-page.is-left,
    .psb-flipbook-book .psb-page.is-right {
        left: 0;
        right: auto;
        width: 100%;
        min-height: 720px;
        border: 0;
    }

    .psb-flipbook-book .psb-page-inner {
        min-height: 720px;
        padding: 18px 18px;
    }

    .psb-played-list {
        max-height: 390px;
    }
}
