:root {
    --bg: #f6f7f9;
    --ink: #17202a;
    --muted: #6b7280;
    --line: #d8dee7;
    --accent: #f4c542;
    --blue: #2463eb;
    --green: #167245;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
}

.topbar {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    padding: 16px 28px;
}

.brand {
    font-weight: 700;
    text-decoration: none;
}

.topbar nav {
    display: flex;
    gap: 18px;
}

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

.page {
    margin: 0 auto;
    max-width: 1180px;
    padding: 28px;
}

.login-page {
    align-items: center;
    display: flex;
    min-height: 100vh;
    justify-content: center;
}

.login-box,
.admin-form {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    max-width: 460px;
    padding: 28px;
    width: 100%;
}

label {
    display: block;
    font-weight: 700;
    margin: 16px 0 8px;
}

input,
textarea {
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    padding: 12px;
    width: 100%;
}

button,
.button {
    background: var(--blue);
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    padding: 12px 18px;
    text-decoration: none;
}

button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.alert {
    background: #ffe9e9;
    border: 1px solid #f0b5b5;
    border-radius: 6px;
    color: #8a1f1f;
    padding: 10px 12px;
}

.hero h1,
.song-head h1,
.admin-head h1,
.admin-form h1 {
    margin: 0 0 8px;
}

.song-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    margin-top: 28px;
}

.song-pill {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 6px;
    padding: 18px;
    text-decoration: none;
}

.song-pill span,
.hero p,
.song-head p,
.status-row {
    color: var(--muted);
}

.karaoke-shell {
    min-height: calc(100vh - 110px);
}

.song-head,
.admin-head {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
}

.controls {
    display: flex;
    gap: 10px;
}

.status-row {
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin: 18px 0 28px;
    padding-bottom: 14px;
}

.lyrics {
    font-size: 42px;
    line-height: 1.65;
    padding: 25vh 0;
    white-space: pre-wrap;
}

.word {
    border-radius: 4px;
    padding: 0 .05em;
    transition:
        background-color .28s ease,
        box-shadow .28s ease,
        color .38s ease,
        text-shadow .38s ease;
}

.word.pending {
    color: #b5bdc9;
}

.word.current {
    background: var(--accent);
    color: #111827;
    text-decoration: underline;
}

.word.done {
    color: var(--green);
    font-weight: 700;
    animation: wordDone .34s ease-out;
    text-shadow: 0 0 0 rgba(22, 114, 69, 0);
}

@keyframes wordDone {
    0% {
        color: #b5bdc9;
        text-shadow: 0 0 0 rgba(22, 114, 69, 0);
    }
    55% {
        color: #1f8a58;
        text-shadow: 0 0 10px rgba(22, 114, 69, .18);
    }
    100% {
        color: var(--green);
        text-shadow: 0 0 0 rgba(22, 114, 69, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .word {
        transition: none;
    }

    .word.done {
        animation: none;
    }
}

.table {
    background: #ffffff;
    border-collapse: collapse;
    border: 1px solid var(--line);
    margin-top: 20px;
    width: 100%;
}

.table th,
.table td {
    border-bottom: 1px solid var(--line);
    padding: 12px;
    text-align: left;
}

.actions {
    align-items: center;
    display: flex;
    gap: 12px;
}

.inline-form {
    display: inline;
}

.link-button {
    background: transparent;
    color: #a52828;
    padding: 0;
}

.check {
    align-items: center;
    display: flex;
    gap: 8px;
}

.check input {
    width: auto;
}

.form-actions {
    align-items: center;
    display: flex;
    gap: 14px;
    margin-top: 20px;
}

@media (max-width: 760px) {
    .topbar,
    .song-head,
    .admin-head,
    .status-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .page {
        padding: 20px;
    }

    .lyrics {
        font-size: 31px;
    }
}
