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

body {
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.header-text {
    text-align: center;
}

/* Banner Images */
header .title-banner {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.current-theme .theme-banner {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    border-radius: 10px 10px 0 0;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

/* レタスキャラクタースタイル */
.lettuce-character {
    position: relative;
    display: inline-block;
}

.lettuce-character img {
    max-width: 100%;
    height: auto;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 5px;
}

.lettuce-character .emoji-fallback {
    display: none;
    font-size: 1.5em;
}

.main-character img {
    width: 120px;
    height: 120px;
    animation: bounce 2s infinite;
}

.main-character .emoji-fallback {
    font-size: 4em;
    animation: bounce 2s infinite;
}

.thinking-character img {
    width: 100px;
    height: 100px;
    animation: think 2s ease-in-out infinite;
}

.thinking-character .emoji-fallback {
    font-size: 3em;
    animation: think 2s ease-in-out infinite;
}

.happy-character img {
    width: 120px;
    height: 120px;
    animation: wiggle 1.5s ease-in-out infinite;
}

.happy-character .emoji-fallback {
    font-size: 3.5em;
    animation: wiggle 1.5s ease-in-out infinite;
}

.waving-character img {
    width: 80px;
    height: 80px;
    animation: wave 1s ease-in-out infinite;
}

.waving-character .emoji-fallback {
    font-size: 2.5em;
    animation: wave 1s ease-in-out infinite;
}

/* セクションヘッダー */
.section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    margin-bottom: 0;
}

.section-header .lettuce-character {
    margin-left: 10px;
}

/* ランキングバナー画像 */
.ranking-banner {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

/* 回答一覧バナー画像 */
.answers-banner {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    border-radius: 8px;
}

/* フッター */
.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* アニメーション */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg) scale(1.05);
    }
    75% {
        transform: rotate(5deg) scale(1.05);
    }
}

@keyframes wave {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-15deg);
    }
    75% {
        transform: rotate(15deg);
    }
}

@keyframes think {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.05) rotate(-2deg);
    }
    50% {
        transform: scale(1.1) rotate(0deg);
    }
    75% {
        transform: scale(1.05) rotate(2deg);
    }
}

section {
    background-color: white;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.current-theme {
    padding: 0;
    overflow: hidden;
}

.current-theme form {
    padding: 30px;
}

h2 {
    color: #ff6b6b;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.section-description {
    color: #666;
    font-size: 1em;
    margin-bottom: 20px;
    text-align: center;
    font-style: italic;
}

form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

input[type="text"],
input[type="email"],
textarea {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]#author-input {
    position: relative;
}

input[type="text"]#author-input:focus::after {
    content: attr(maxlength);
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 12px;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-color: #ff6b6b;
}

/* デモグラフィック選択エリア */
.demographics-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.demo-group {
    margin-bottom: 20px;
}

.demo-group:last-child {
    margin-bottom: 0;
}

.demo-label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    color: #495057;
    font-size: 14px;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.demo-btn {
    padding: 8px 16px;
    background-color: #e9ecef;
    color: #495057;
    border: 1px solid #ced4da;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.demo-btn:hover {
    background-color: #dee2e6;
    border-color: #adb5bd;
}

.demo-btn.selected {
    background-color: #4caf50;
    color: white;
    border-color: #4caf50;
}

.demo-btn.selected:hover {
    background-color: #45a049;
    border-color: #45a049;
}

.char-counter {
    text-align: right;
    font-size: 0.8em;
    color: #999;
    margin-top: -5px;
    margin-bottom: 10px;
}

.char-counter span {
    font-weight: bold;
}

.email-notice {
    font-size: 0.85em;
    color: #666;
    margin-top: -10px;
    margin-bottom: 10px;
    text-align: right;
}

.section-title-with-link {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.section-title-with-link h2 {
    margin-bottom: 0;
}

.section-title-with-link .answers-banner {
    width: 100%;
}

.view-all-link {
    color: #ff6b6b;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: bold;
    transition: color 0.3s;
    align-self: flex-end;
    margin-top: -10px;
}

.view-all-link:hover {
    color: #ff5252;
    text-decoration: underline;
}

.load-more-btn {
    display: block;
    margin: 30px auto 0;
    padding: 15px 30px;
    background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.load-more-btn:hover {
    background: linear-gradient(135deg, #45a049 0%, #5db05e 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

button {
    padding: 12px 24px;
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #ff5252;
}


.sort-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.sort-btn {
    padding: 8px 16px;
    background-color: #e0e0e0;
    color: #666;
    font-size: 14px;
}

.sort-btn.active {
    background-color: #ff6b6b;
    color: white;
}

.answer-card {
    background-color: #f9f9f9;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    border-left: 4px solid #ff6b6b;
}

.answer-content {
    font-size: 1.1em;
    margin-bottom: 10px;
}

.answer-demographics {
    font-size: 0.8em;
    color: #888;
    margin-bottom: 8px;
    font-style: italic;
}

.answer-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    color: #666;
    font-size: 0.9em;
}

.answer-author {
    font-weight: bold;
}

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

.like-btn {
    background: none;
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
    padding: 5px 15px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.like-btn.liked {
    background-color: #ff6b6b;
    color: white;
}

.ranking-section {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border: 2px solid #ffd54f;
}

.ranking-section h2 {
    color: #f57c00;
    text-align: center;
    margin-bottom: 30px;
}

#ranking-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ranking-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.ranking-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.rank-medal {
    font-size: 2em;
    min-width: 50px;
    text-align: center;
}

.ranking-content {
    flex: 1;
}

.ranking-content .answer-content {
    font-size: 1.15em;
    margin-bottom: 12px;
}

.ranking-content .answer-demographics {
    font-size: 0.75em;
    color: #888;
    margin-bottom: 10px;
    font-style: italic;
}

.ranking-content .answer-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.likes-display {
    color: #666;
    font-size: 0.9em;
    padding: 5px 15px;
    background-color: #f5f5f5;
    border-radius: 15px;
    border: 1px solid #ddd;
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    color: #666;
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    section {
        padding: 20px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-character img {
        width: 80px;
        height: 80px;
    }
    
    .main-character .emoji-fallback {
        font-size: 3em;
    }
    
    .section-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .section-header .lettuce-character {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .thinking-character img {
        width: 80px;
        height: 80px;
    }
    
    .happy-character img {
        width: 90px;
        height: 90px;
    }
    
    .waving-character img {
        width: 60px;
        height: 60px;
    }
    
    .thinking-character .emoji-fallback,
    .happy-character .emoji-fallback {
        font-size: 2.5em;
    }
    
    .waving-character .emoji-fallback {
        font-size: 2em;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .email-notice {
        text-align: left;
        font-size: 0.8em;
    }
    
    .button-group {
        justify-content: center;
    }
    
    .demo-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .theme-display {
        font-size: 1.3em;
        padding: 20px;
        border-radius: 12px;
    }
    
    /* Responsive banner images */
    header .title-banner {
        width: 100%;
        height: auto;
    }
    
    .current-theme .theme-banner {
        width: 100%;
        height: auto;
    }
    
    .ranking-banner {
        width: 100%;
    }
    
    .answers-banner {
        width: 100%;
    }
    
    .view-all-link {
        align-self: center;
        margin-top: 0;
    }
}