:root {
    --bg: #0f172a;
    --card: #1e293b;
    --accent: #38bdf8;
    --danger: #f43f5e;
    --text: #f8fafc;
    --text-dim: #64748b;
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
}

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

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--safe-top) 0 var(--safe-bottom);
}

header {
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.system-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    font-weight: bold;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 4px;
}

.logo {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 3px;
    text-align: center;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
}

.main-display {
    background: var(--card);
    border-radius: 24px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    margin-bottom: 20px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.q-label { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 5px; }
#q-number { font-size: 5rem; font-weight: 900; color: var(--accent); line-height: 1; }

#answer-area { margin-top: 15px; animation: slideUp 0.3s ease; }
#song-title { font-size: 1.4rem; font-weight: bold; }
#artist-name { color: var(--text-dim); font-size: 1rem; }

.playlist-section {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.section-tag { font-size: 0.65rem; color: var(--text-dim); margin-bottom: 10px; }

#song-list { list-style: none; padding: 0; margin: 0; }
.list-item {
    padding: 15px;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    border: 1px solid transparent;
}

.list-item.active {
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--accent);
}

.item-num { font-family: monospace; width: 30px; color: var(--text-dim); }
.active .item-num { color: var(--accent); }

footer {
    padding: 10px 20px 20px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
}

.control-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-main {
    height: 85px;
    border-radius: 20px;
    border: none;
    background: var(--accent);
    color: var(--bg);
    font-size: 1.8rem;
    font-weight: 900;
}

.btn-main:active { opacity: 0.8; transform: scale(0.98); }

.sub-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-secondary {
    height: 60px;
    border-radius: 15px;
    border: 1px solid var(--text-dim);
    background: transparent;
    color: var(--text);
    font-weight: bold;
}

.hidden { display: none; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-content {
    width: 80%;
    max-width: 400px;
    text-align: center;
}

#event-list-ui {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.event-item {
    background: var(--card);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 16px;
    border: 1px solid var(--border);
    font-weight: bold;
    color: var(--accent);
    transition: transform 0.2s;
}

.event-item:active {
    transform: scale(0.95);
    background: rgba(56, 189, 248, 0.2);
}

.overlay.hidden { display: none; }