* {
    box-sizing: border-box;
}

:root {
    --bg: #121212;
    --panel: #1e1e1e;
    --panel2: #252525;
    --text: #f0f0f0;
    --muted: #aaa;
    --accent: #f2b84b;
    --accent2: #f7ca70;
    --border: #3a3a3a;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
    padding: 14px 16px;
    background: #181818;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #222;
}

.topbar h1 {
    margin: 0;
    font-size: 1.45rem;
}

.topbar a {
    color: var(--accent);
    text-decoration: none;
}

main {
    padding: 16px;
    padding-bottom: 48px;
    max-width: 760px;
    margin: 0 auto;
}

section {
    margin-bottom: 28px;
}

h1, h2 {
    margin-top: 0;
}

h2 {
    font-size: 1.1rem;
    color: var(--accent2);
}

.subtle {
    color: var(--muted);
    font-size: 0.9rem;
}

.book-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.book-card {
    display: flex;
    gap: 12px;
    background: var(--panel);
    padding: 12px;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
}

.book-card.featured {
    border-color: rgba(242, 184, 75, 0.45);
    background: linear-gradient(180deg, #252016, var(--panel));
}

.book-card:active {
    background: var(--panel2);
}

.cover {
    background: #333;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cover.small {
    width: 76px;
    height: 76px;
}

.cover.large {
    width: min(82vw, 320px);
    aspect-ratio: 1;
    margin: 0 auto 20px auto;
}

.no-cover {
    width: 100%;
    height: 100%;
    padding: 10px;
    font-size: 0.8rem;
    color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.book-info {
    min-width: 0;
    flex: 1;
}

.title {
    font-weight: 750;
    font-size: 1.05rem;
    line-height: 1.25;
}

.author,
.meta,
.progress-text {
    color: var(--muted);
    margin-top: 4px;
}

.progress-text {
    color: var(--accent);
}

.progress-bar {
    height: 7px;
    background: #333;
    border-radius: 99px;
    overflow: hidden;
    margin-top: 9px;
}

.progress-bar div {
    height: 100%;
    background: var(--accent);
}

.progress-bar.wide {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.book-detail,
.player {
    text-align: center;
}

.primary-button {
    display: block;
    background: var(--accent);
    color: #111;
    text-decoration: none;
    padding: 15px;
    border-radius: 999px;
    margin: 22px 0;
    font-weight: 800;
}

.small-button {
    display: inline-block;
    background: #2a2a2a;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 9px 12px;
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
}

.track-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.track-row {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 10px;
    padding: 13px;
    background: var(--panel);
    color: inherit;
    text-decoration: none;
    border-radius: 12px;
    text-align: left;
}

.track-row span:first-child {
    color: var(--accent);
    text-align: right;
}

audio {
    width: 100%;
    margin: 20px 0;
}

.track-title {
    color: var(--accent);
    margin-top: 14px;
    line-height: 1.35;
}

.rewind-info {
    color: var(--muted);
    font-size: 0.9rem;
    min-height: 1.4em;
    margin-top: 4px;
}

.transport,
.speed,
.next-prev {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 14px;
}

.speed span {
    width: 100%;
    color: var(--muted);
    margin-bottom: 2px;
}

button {
    background: #2a2a2a;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 12px 16px;
    font-size: 1rem;
    min-width: 78px;
}

button.active {
    background: var(--accent);
    color: #111;
    border-color: var(--accent);
    font-weight: 800;
}

button:active {
    transform: translateY(1px);
    background: #444;
}

@media (min-width: 700px) {
    .book-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .book-card.featured {
        grid-column: span 2;
    }
}
