* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #1a0533, #2d1b69, #1a0533);
    color: #333;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    margin-bottom: 0.25rem;
    color: #1a1a1a;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.name-section {
    margin-bottom: 1.5rem;
}

.name-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.name-section input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.name-section input:focus {
    outline: none;
    border-color: #4a90d9;
}

.votes-remaining {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #e8f4fd;
    border-radius: 8px;
    transition: background 0.3s, transform 0.3s;
}

.votes-remaining span {
    color: #4a90d9;
    font-size: 1.3rem;
    transition: color 0.3s, font-size 0.3s, text-shadow 0.3s;
}

.votes-remaining.level-6 span { color: #4a90d9; font-size: 1.3rem; }
.votes-remaining.level-5 span { color: #3b82c4; font-size: 1.4rem; }
.votes-remaining.level-4 span { color: #7c3aed; font-size: 1.5rem; }
.votes-remaining.level-3 span { color: #a855f7; font-size: 1.6rem; text-shadow: 0 0 4px rgba(168, 85, 247, 0.3); }
.votes-remaining.level-2 span { color: #dc2626; font-size: 1.8rem; text-shadow: 0 0 6px rgba(220, 38, 38, 0.4); }
.votes-remaining.level-1 span { color: #dc2626; font-size: 2rem; text-shadow: 0 0 10px rgba(220, 38, 38, 0.6); }
.votes-remaining.level-0 span { color: #999; font-size: 1.3rem; text-shadow: none; }

.votes-remaining.level-4 { background: #f3e8ff; }
.votes-remaining.level-3 { background: #ede9fe; }
.votes-remaining.level-2 { background: #fee2e2; }
.votes-remaining.level-1 { background: #fecaca; }
.votes-remaining.level-0 { background: #f0f0f0; }

.votes-remaining.level-2,
.votes-remaining.level-1 {
    animation: pulse 0.8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1.02); }
    50% { transform: scale(1.06); }
}

.book-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.book-row:last-child {
    border-bottom: none;
}

.book-details {
    flex: 1;
    margin-right: 1rem;
}

.book-title {
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.book-title::-webkit-details-marker {
    display: none;
}

.book-title::before {
    content: "\25B6";
    font-size: 0.6rem;
    color: #999;
    transition: transform 0.2s;
}

details[open] > .book-title::before {
    transform: rotate(90deg);
}

.book-description {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
    padding-left: 1rem;
}

.vote-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vote-controls button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s;
}

.vote-controls button:active {
    transform: scale(0.9);
}

.btn-minus {
    background: #f0f0f0;
    color: #666;
}

.btn-minus:hover {
    background: #e0e0e0;
}

.btn-plus {
    background: #4a90d9;
    color: white;
}

.btn-plus:hover {
    background: #3a7bc8;
}

.btn-plus:disabled,
.btn-minus:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.vote-count {
    font-size: 1.2rem;
    font-weight: 700;
    width: 24px;
    text-align: center;
    color: #4a90d9;
}

.vote-count.negative {
    color: #e74c3c;
}

#submit-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    margin-top: 1.5rem;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

#submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

#submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

#submit-btn:disabled {
    background: #ccc;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}

#success-message {
    text-align: center;
    padding: 2rem 0;
}

#success-message h2 {
    color: #2ecc71;
    margin-bottom: 0.5rem;
}

.hidden {
    display: none;
}
