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

body {
    font-family: 'Times New Roman', 'Yu Mincho', 'Hiragino Mincho ProN', serif;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    min-height: 100vh;
    color: #2c3e50;
    line-height: 1.6;
}

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

.header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 0.8s ease;
    position: relative;
}

.settings-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(248,249,250,0.9);
    border: 2px solid rgba(139,69,19,0.3);
    border-radius: 12px;
    width: auto;
    height: auto;
    padding: 8px 15px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:hover {
    background: rgba(248,249,250,1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139,69,19,0.2);
}

.title {
    font-size: 2.5rem;
    color: #f8f9fa;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 0.5rem;
    font-weight: 400;
    letter-spacing: 0.1em;
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(248,249,250,0.9);
    font-weight: 300;
    font-style: italic;
}

.main {
    background: rgba(248,249,250,0.98);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: fadeInUp 0.8s ease 0.2s both;
    border: 2px solid rgba(139,69,19,0.2);
}

.input-section {
    margin-bottom: 1rem;
}

.input-group {
    margin-bottom: 1rem;
    position: relative;
}

.input-label {
    display: block;
    font-weight: 500;
    color: #8b4513;
    margin-bottom: 0.3rem;
    font-size: 1rem;
    letter-spacing: 0.05em;
    position: relative;
}

.input-label::after {
    content: '';
    margin-left: 0;
}

.season-spring .input-label::after {
    content: '🌸';
}

.season-summer .input-label::after {
    content: '☀️';
}

.season-autumn .input-label::after {
    content: '🍁';
}

.season-winter .input-label::after {
    content: '❄️';
}

.word-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: white;
    min-height: 42px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238b4513' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    cursor: pointer;
}

.word-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.suggestions {
    margin-bottom: 0; /* Changed from 1.5rem to remove space for deleted controls */
}

.controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
}

.btn-primary {
    background: linear-gradient(135deg, #8b4513, #a0522d);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e1e5e9;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.output-section {
    margin-bottom: 2rem;
}

.suggestions {
    margin-bottom: 1.5rem;
}

.suggestions-title {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.suggestion-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.suggestion-item {
    background: #f8f9fa;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    border: 2px solid #8b4513;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: 'Times New Roman', 'Yu Mincho', serif;
    min-height: auto;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    font-size: 1rem;
}

.suggestion-item:hover {
    background: #8b4513;
    color: white;
    transform: translateY(-2px);
}

.empty-state {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 2rem;
}

.haiku-display {
    background: linear-gradient(135deg, #f4f1de 0%, #e8dcc6 100%);
    padding: 2rem 1.5rem;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 1.5rem;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.2);
    border: 1px solid rgba(139, 69, 19, 0.1);
    position: relative;
}

.haiku-display::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px solid rgba(139, 69, 19, 0.2);
    border-radius: 12px;
    pointer-events: none;
}

.haiku-text {
    color: #2c3e50;
    text-shadow: none;
    margin-bottom: 1rem;
    font-family: 'Times New Roman', 'Yu Mincho', serif;
}

.haiku-line {
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    line-height: 1.6;
    letter-spacing: 0.1em;
    writing-mode: horizontal-tb;
}

.haiku-line:nth-child(1) {
    text-align: left;
}

.haiku-line:nth-child(2) {
    text-align: center;
}

.haiku-line:nth-child(3) {
    text-align: right;
}

.syllable-count {
    font-size: 1rem;
    color: rgba(139, 69, 19, 0.7);
    font-weight: 300;
    font-style: italic;
    display: none;
}

.author-name {
    position: absolute;
    bottom: 15px;
    right: 20px;
    font-size: 0.9rem;
    color: rgba(139, 69, 19, 0.7);
    font-weight: 300;
    font-style: italic;
}

.seasonal-word {
    color: #8b4513;
    font-weight: 600;
    text-decoration: underline;
    position: relative;
    padding: 0 3px;
    background-color: rgba(139, 69, 19, 0.1);
    border-radius: 4px;
}

.season-spring .seasonal-word {
    color: #ff1493;
    background-color: rgba(255, 105, 180, 0.1);
}

.season-summer .seasonal-word {
    color: #ff4500;
    background-color: rgba(255, 69, 0, 0.1);
}

.season-autumn .seasonal-word {
    color: #ff8c00;
    background-color: rgba(255, 140, 0, 0.1);
}

.season-winter .seasonal-word {
    color: #4169e1;
    background-color: rgba(65, 105, 225, 0.1);
}

/* アニメーション */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.palindrome-display.success {
    animation: pulse 0.6s ease;
}

/* レスポンシブ */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .main {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .input-group {
        margin-bottom: 1.8rem;
    }
    
    .input-label {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }
    
    .word-input {
        padding: 1.2rem;
        font-size: 1.2rem;
        min-height: 52px;
    }
    
    .controls {
        flex-direction: column;
        gap: 1.2rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        padding: 1.2rem;
        font-size: 1.2rem;
        min-height: 52px;
    }
    
    .haiku-display {
        padding: 2.5rem 1.5rem;
        margin-bottom: 2rem;
    }
    
    .haiku-line {
        font-size: 1.6rem;
        margin-bottom: 1rem;
        line-height: 1.4;
    }
    
    .suggestion-item {
        padding: 1rem 1.2rem;
        font-size: 1rem;
        min-height: auto;
        flex: 0 0 auto;
    }
    
    .suggestions-title {
        font-size: 1.4rem;
        margin-bottom: 1.2rem;
    }
    
    .output-section {
        margin-bottom: 1rem;
    }
    
    .settings-panel {
        width: 100vw;
        right: -100vw;
    }
    
    .settings-btn {
        top: 5px;
        right: 5px;
        padding: 6px 12px;
        font-size: 0.9rem;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .main {
        padding: 1.2rem;
    }
    
    .haiku-display {
        padding: 2rem 1rem;
    }
    
    .haiku-line {
        font-size: 1.4rem;
    }
    
    .season-indicator {
        top: 10px;
        right: 15px;
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    .settings-content {
        padding: 1.5rem;
    }
    
    .haiku-display.vertical .haiku-text {
        height: 180px;
        gap: 1rem;
    }
}

/* Vertical writing mode styles */
.haiku-display.vertical .haiku-text {
    writing-mode: vertical-rl;
    text-orientation: upright;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 250px;
    gap: 2rem;
}

.haiku-display.vertical .haiku-line {
    writing-mode: vertical-rl;
    text-orientation: upright;
    text-align: center;
    margin: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.haiku-display.vertical .author-name {
    writing-mode: horizontal-tb;
    position: absolute;
    bottom: 15px;
    left: 20px;
    right: auto;
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    top: 0;
    right: -380px; /* Start off-screen */
    width: 380px;
    height: 100vh;
    background: rgba(248,249,250,0.98);
    backdrop-filter: blur(20px);
    box-shadow: -5px 0 25px rgba(0,0,0,0.3);
    transition: right 0.3s ease;
    z-index: 1000;
    border-left: 2px solid rgba(139,69,19,0.2);
    display: flex;
}

.settings-panel.open {
    right: 0;
}

.settings-handle {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 80px;
    background: rgba(248,249,250,0.98);
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
    border: 2px solid rgba(139,69,19,0.2);
    border-right: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
}

.handle-icon {
    width: 15px;
    height: 25px;
    position: relative;
}

.handle-icon:before {
    content: '⚙';
    position: absolute;
    top: 0;
    left: 0;
    font-size: 20px;
    color: #8b4513;
}

.handle-icon:after {
    content: '';
    display: none;
}

.settings-panel.open .handle-icon:before {
    transform: rotate(45deg);
}

.settings-panel.open .handle-icon:after {
    display: none;
}

.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.settings-overlay.open {
    opacity: 1;
    visibility: visible;
}

.settings-content {
    padding: 2rem;
    height: 100%;
    overflow-y: auto;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(139,69,19,0.2);
}

.settings-header h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(139,69,19,0.1);
    color: #8b4513;
}

.settings-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.setting-item {
    padding: 1rem;
    background: white;
    border-radius: 12px;
    border: 2px solid rgba(139,69,19,0.1);
    transition: all 0.3s ease;
}

.setting-item:hover {
    border-color: rgba(139,69,19,0.3);
    box-shadow: 0 4px 15px rgba(139,69,19,0.1);
}

.setting-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 500;
}

.toggle {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-input:checked + .toggle-slider {
    background-color: #8b4513;
}

.toggle-input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Seasonal color themes */
.season-spring .haiku-display {
    background: linear-gradient(135deg, #ffecf1 0%, #ffd6e6 100%);
    box-shadow: 0 8px 25px rgba(255, 105, 180, 0.2);
    border: 1px solid rgba(255, 105, 180, 0.1);
}

.season-summer .haiku-display {
    background: linear-gradient(135deg, #fff6e9 0%, #ffead1 100%);
    box-shadow: 0 8px 25px rgba(255, 69, 0, 0.2);
    border: 1px solid rgba(255, 69, 0, 0.1);
}

.season-autumn .haiku-display {
    background: linear-gradient(135deg, #fff0e0 0%, #ffe8cc 100%);
    box-shadow: 0 8px 25px rgba(255, 140, 0, 0.2);
    border: 1px solid rgba(255, 140, 0, 0.1);
}

.season-winter .haiku-display {
    background: linear-gradient(135deg, #f0f5ff 0%, #e0eafc 100%);
    box-shadow: 0 8px 25px rgba(65, 105, 225, 0.2);
    border: 1px solid rgba(65, 105, 225, 0.1);
}

.season-spring .btn-primary {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.3);
}

.season-spring .suggestion-item {
    border-color: #ff69b4;
}

.season-spring .suggestion-item:hover {
    background: #ff69b4;
    color: white;
}

.season-summer .btn-primary {
    background: linear-gradient(135deg, #ff4500, #ff6347);
    box-shadow: 0 4px 15px rgba(255, 69, 0, 0.3);
}

.season-summer .suggestion-item {
    border-color: #ff4500;
}

.season-summer .suggestion-item:hover {
    background: #ff4500;
    color: white;
}

.season-autumn .btn-primary {
    background: linear-gradient(135deg, #ff8c00, #ffa500);
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
}

.season-autumn .suggestion-item {
    border-color: #ff8c00;
}

.season-autumn .suggestion-item:hover {
    background: #ff8c00;
    color: white;
}

.season-winter .btn-primary {
    background: linear-gradient(135deg, #4169e1, #6495ed);
    box-shadow: 0 4px 15px rgba(65, 105, 225, 0.3);
}

.season-winter .suggestion-item {
    border-color: #4169e1;
}

.season-winter .suggestion-item:hover {
    background: #4169e1;
    color: white;
}

/* Add share controls styles */
.share-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, #8b4513, #a0522d);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

.btn-icon {
    font-size: 1.2rem;
}

/* Seasonal theme for buttons */
.season-spring .action-btn {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.3);
}

.season-summer .action-btn {
    background: linear-gradient(135deg, #ff4500, #ff6347);
    box-shadow: 0 4px 15px rgba(255, 69, 0, 0.3);
}

.season-autumn .action-btn {
    background: linear-gradient(135deg, #ff8c00, #ffa500);
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
}

.season-winter .action-btn {
    background: linear-gradient(135deg, #4169e1, #6495ed);
    box-shadow: 0 4px 15px rgba(65, 105, 225, 0.3);
}

/* Add season-specific styling for dropdown */
.season-spring select.word-input {
    border-color: rgba(255, 105, 180, 0.5);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ff69b4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.season-summer select.word-input {
    border-color: rgba(255, 69, 0, 0.5);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ff4500' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.season-autumn select.word-input {
    border-color: rgba(255, 140, 0, 0.5);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ff8c00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.season-winter select.word-input {
    border-color: rgba(65, 105, 225, 0.5);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234169e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.season-indicator {
    position: absolute;
    bottom: 15px;
    left: 20px;
    font-size: 0.9rem;
    color: rgba(139, 69, 19, 0.7);
    font-weight: 300;
    font-style: italic;
    background: rgba(255, 255, 255, 0.7);
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Font size selector styles */
.font-size-selector {
    display: flex;
    gap: 0.5rem;
}

.font-size-btn {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.font-size-btn:hover {
    background: rgba(139,69,19,0.1);
}

.font-size-btn.active {
    background: #8b4513;
    color: white;
    border-color: #8b4513;
}

/* Font size classes for haiku text */
.haiku-text.font-small .haiku-line {
    font-size: 1.4rem;
}

.haiku-text.font-medium .haiku-line {
    font-size: 1.8rem;
}

.haiku-text.font-large .haiku-line {
    font-size: 2.2rem;
}

/* Season-specific styles for font size buttons */
.season-spring .font-size-btn.active {
    background: #ff69b4;
    border-color: #ff69b4;
}

.season-summer .font-size-btn.active {
    background: #ff4500;
    border-color: #ff4500;
}

.season-autumn .font-size-btn.active {
    background: #ff8c00;
    border-color: #ff8c00;
}

.season-winter .font-size-btn.active {
    background: #4169e1;
    border-color: #4169e1;
}