:root {
    --bg: #f3efe7;
    --panel: rgba(255, 251, 245, 0.92);
    --ink: #241c15;
    --muted: #6d6258;
    --line: rgba(36, 28, 21, 0.12);
    --accent: #0f7b6c;
    --accent-strong: #0a5e53;
    --playing: #2d74da;
    --danger: #c84f44;
    --done: #b9b0a7;
    --shadow: 0 18px 50px rgba(65, 41, 17, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Pretendard", "Noto Sans KR", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(15, 123, 108, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(45, 116, 218, 0.15), transparent 25%),
        linear-gradient(135deg, #efe7da 0%, #f8f4ed 50%, #e8dccb 100%);
    min-height: 100vh;
}

button,
input,
textarea {
    font: inherit;
}

button {
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: white;
    padding: 10px 14px;
    cursor: pointer;
}

button.secondary {
    background: #e8dfd1;
    color: var(--ink);
}

button.danger {
    background: var(--danger);
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.8);
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    align-items: center;
}

.topbar h1,
.panel h2 {
    margin: 0;
}

.topbar p {
    margin: 6px 0 0;
    color: var(--muted);
}

.chat-box {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.layout {
    display: grid;
    grid-template-columns: 1.3fr 1fr 0.8fr;
    gap: 20px;
    padding: 0 28px 28px;
}

.panel {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 20px;
    backdrop-filter: blur(18px);
    min-height: 70vh;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ghost-link {
    color: var(--accent-strong);
    text-decoration: none;
    font-weight: 600;
}

.playing-highlight {
    margin-bottom: 16px;
    border-radius: 18px;
    padding: 14px;
    background: rgba(45, 116, 218, 0.1);
    border: 1px solid rgba(45, 116, 218, 0.2);
}

.song-form,
.search-box {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.inline-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.songs-list {
    display: grid;
    gap: 12px;
}

.song-card {
    border-radius: 18px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
}

.song-card.playing {
    border: 2px solid var(--playing);
    box-shadow: 0 0 0 4px rgba(45, 116, 218, 0.12);
}

.song-card.done,
.song-card.skipped {
    opacity: 0.55;
}

.song-status {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: #efe7da;
}

.song-title {
    margin: 0 0 8px;
    cursor: pointer;
}

.song-requester,
.song-link,
.song-time,
.hint-box {
    margin: 6px 0;
    color: var(--muted);
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.memo-panel textarea {
    min-height: calc(70vh - 74px);
    resize: vertical;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    background: rgba(16, 12, 8, 0.48);
    z-index: 30;
}

.modal.open {
    display: grid;
}

.modal-card {
    width: min(360px, calc(100% - 32px));
    background: #fffaf4;
    border-radius: 22px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.modal-card h2 {
    margin-top: 0;
}

.error {
    color: var(--danger);
    min-height: 20px;
}

.overlay-body {
    margin: 0;
    background: transparent;
    color: white;
    font-family: Pretendard, Arial, sans-serif;
}

.overlay-card {
    width: 460px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.72), rgba(20, 60, 104, 0.62));
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
}

.overlay-label,
.overlay-next-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.75;
}

.overlay-title,
.overlay-next {
    margin-top: 8px;
    font-size: 28px;
    font-weight: 700;
}

.overlay-subtitle {
    margin-top: 8px;
    opacity: 0.9;
}

@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .panel {
        min-height: auto;
    }

    .memo-panel textarea {
        min-height: 280px;
    }
}

.layout-wide {
    grid-template-columns: 1.2fr 0.9fr 0.8fr 0.9fr;
}

.small-note {
    color: var(--muted);
    font-size: 13px;
}

.live-chat-panel {
    min-width: 0;
}

.live-chat-list {
    display: grid;
    gap: 10px;
    max-height: calc(70vh - 90px);
    overflow: auto;
    padding-right: 4px;
}

.live-chat-item {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    border-radius: 16px;
    padding: 12px 14px;
}

.live-chat-item.command {
    border-color: rgba(15, 123, 108, 0.45);
    box-shadow: inset 0 0 0 1px rgba(15, 123, 108, 0.18);
    background: rgba(235, 248, 245, 0.95);
}

.live-chat-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--muted);
}

.live-chat-head strong {
    color: var(--ink);
}

.live-chat-body {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
}

.live-chat-empty {
    border: 1px dashed var(--line);
    border-radius: 16px;
    padding: 16px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.55);
}

.browser-guide a {
    color: var(--accent-strong);
    font-weight: 700;
}
