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

:root {
    --primary-color: #FF6B6B;
    --secondary-color: #4ECDC4;
    --accent-color: #FFE66D;
    --dark-color: #2A2A2A;
    --light-color: #F7F7F7;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 30px 0;
    text-align: center;
    box-shadow: var(--shadow);
}

.logo {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.tagline {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    margin: 30px auto;
}

.theme-section {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    text-align: center;
}

.theme-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8em;
}

.theme-content {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--dark-color);
    padding: 20px;
    background: var(--accent-color);
    border-radius: var(--border-radius);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-form-section {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.post-form-section h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

input[type="text"],
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

textarea {
    resize: vertical;
}

.submit-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.submit-btn:hover {
    background: #FF5252;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.posts-section {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.posts-section h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.post-item {
    background: var(--light-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.post-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.post-nickname {
    font-weight: bold;
    color: var(--primary-color);
}

.post-time {
    font-size: 0.9em;
    color: #999;
}

.post-content {
    margin-bottom: 15px;
    line-height: 1.8;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vote-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.vote-btn:hover:not(:disabled) {
    background: #45B7AA;
    transform: scale(1.05);
}

.vote-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.vote-count {
    font-weight: bold;
    color: var(--primary-color);
}

.past-themes-section {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.past-themes-section h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.load-past-btn {
    background: var(--accent-color);
    color: var(--dark-color);
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    width: 100%;
}

.load-past-btn:hover {
    background: #FFD93D;
    transform: translateY(-2px);
}

.past-theme-item {
    background: var(--light-color);
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
}

.past-theme-date {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.past-theme-content {
    font-size: 1.1em;
    margin-bottom: 15px;
}

.best-post {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid var(--accent-color);
}

.best-post-label {
    font-size: 0.9em;
    color: var(--secondary-color);
    font-weight: bold;
    margin-bottom: 5px;
}

footer {
    background: var(--dark-color);
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: var(--dark-color);
}

.loading {
    text-align: center;
    color: #999;
    padding: 20px;
}

.success-message {
    background: #4CAF50;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.error-message {
    background: #f44336;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

@media (max-width: 768px) {
    .logo {
        font-size: 2em;
    }
    
    .tagline {
        font-size: 1em;
    }
    
    .theme-content {
        font-size: 1.2em;
        padding: 15px;
    }
    
    .post-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .post-time {
        margin-top: 5px;
    }
    
    .post-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .vote-btn {
        margin-top: 10px;
    }
    
    main {
        margin: 20px auto;
    }
    
    .theme-section,
    .post-form-section,
    .posts-section,
    .past-themes-section {
        padding: 20px;
        margin-bottom: 20px;
    }
}