:root {
    --bg: #ffffff;
    --text: #111111;
    --accent: #d1400f;
    --accent-dark: #a5300a;
    --muted: #555555;
    --border: #dddddd;
    --font-size: 6vw;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    overscroll-behavior: none;
    user-select: none;
}

#app {
    height: 100vh;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.view {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* ---------- List view ---------- */

#list-view header {
    padding: 20px 16px 12px;
    border-bottom: 2px solid var(--border);
}

#list-view h1 {
    margin: 0;
    font-size: 7vw;
    font-weight: 800;
    letter-spacing: -0.02em;
}

#song-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    list-style: none;
    margin: 0;
    padding: 8px 0 24px;
}

#song-list li {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#song-list li:active {
    background: #f2f2f2;
}

.song-title {
    font-size: 6vw;
    font-weight: 700;
}

.song-composer {
    font-size: 3.6vw;
    color: var(--muted);
}

.list-empty {
    padding: 40px 20px;
    color: var(--muted);
    font-size: 4.5vw;
    text-align: center;
}

/* ---------- Lyrics view ---------- */

#lyrics-view {
    background: var(--bg);
}

.lyrics-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 10px;
    border-bottom: 2px solid var(--border);
    gap: 8px;
}

.icon-btn {
    border: 2px solid var(--border);
    background: #fafafa;
    color: var(--text);
    font-size: min(6vw, 22px);
    line-height: 1;
    width: min(13vw, 48px);
    height: min(13vw, 48px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-btn:active {
    background: #eaeaea;
}

.topbar-side {
    display: flex;
    align-items: center;
    width: 104px;
    flex-shrink: 0;
}

.topbar-side-left {
    justify-content: flex-start;
}

.font-controls.topbar-side-right {
    justify-content: flex-end;
    gap: 6px;
}

.lyrics-title-wrap {
    flex: 1;
    min-width: 0;
    text-align: center;
    overflow: hidden;
    padding: 0 4px;
}

.lyrics-title-wrap .t {
    font-weight: 700;
    font-size: 4vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lyrics-title-wrap .c {
    font-size: 3vw;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#lyrics-scroller {
    flex: 1;
    overflow: hidden;
    position: relative;
    touch-action: pan-y;
}

.lyrics-part {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6vw 6vw calc(6vw + 40px);
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.lyrics-part p {
    font-size: var(--font-size);
    line-height: 1.35;
    font-weight: 600;
    white-space: pre-line;
    text-align: center;
    margin: 0;
    max-height: 100%;
    overflow-y: auto;
}

.lyrics-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    border-top: 2px solid var(--border);
}

.nav-btn {
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 5vw;
    padding: 12px 20px;
    border-radius: 12px;
    min-width: 20vw;
}

.nav-btn:disabled {
    background: #ccc;
    color: #888;
}

.nav-btn:active:not(:disabled) {
    background: var(--accent-dark);
}

#part-indicator {
    font-size: 3.8vw;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
