/* Reset & base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0d0d0d;
    color: #e0d6c8;
    font-family: 'Segoe UI', 'Roboto', system-ui, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 820px;
    width: 100%;
    background: #1a1a1a;
    border-radius: 24px;
    padding: 30px 35px 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8);
    border: 1px solid #2e2e2e;
    transition: all 0.2s;
}

header {
    text-align: center;
    margin-bottom: 28px;
}

header h1 {
    font-size: 2.1rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: #f5d9b3;
    text-shadow: 0 0 12px rgba(245, 217, 179, 0.15);
}

.subtitle {
    color: #9a8a7a;
    font-size: 0.95rem;
    margin-top: 4px;
    font-style: italic;
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 20px;
    background: #252525;
    padding: 16px 22px;
    border-radius: 16px;
    margin-bottom: 28px;
    border: 1px solid #333;
}

.controls label {
    font-weight: 500;
    color: #cdc0b0;
    font-size: 0.98rem;
}

.controls select {
    flex: 1 1 180px;
    padding: 8px 14px;
    background: #111;
    color: #f0e6d8;
    border: 1px solid #444;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    transition: border 0.2s;
}
.controls select:focus {
    border-color: #b8956e;
}

.controls button {
    background: #b8956e;
    color: #0d0d0d;
    border: none;
    padding: 9px 28px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s, transform 0.1s;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 14px rgba(184, 149, 110, 0.25);
}
.controls button:hover {
    background: #d4b08c;
    transform: scale(1.02);
}
.controls button:active {
    transform: scale(0.97);
}

/* Poem output */
.poem-box {
    background: #121212;
    border-radius: 18px;
    padding: 30px 28px;
    min-height: 200px;
    border: 1px solid #2a2a2a;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.poem-box .placeholder {
    color: #5e554a;
    font-style: italic;
    font-size: 1.05rem;
}

#poemContent {
    width: 100%;
    text-align: center;
    font-size: 1.25rem;
    line-height: 2.1;
    white-space: pre-wrap;
    word-break: break-word;
    color: #eee7de;
}

#poemContent .line {
    display: block;
}

/* thanh điệu highlight nhẹ (tuỳ chỉnh) */
.tag-vần {
    display: inline-block;
    background: #2a221a;
    padding: 0 8px;
    border-radius: 6px;
    color: #e6d4be;
}

footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.8rem;
    color: #4d443b;
    border-top: 1px solid #26221e;
    padding-top: 16px;
}

footer a {
    color: #9a8a7a;
    text-decoration: none;
}
footer a:hover {
    color: #cdb8a2;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 550px) {
    .container {
        padding: 18px 14px;
    }
    header h1 {
        font-size: 1.6rem;
    }
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    .controls button {
        width: 100%;
    }
    #poemContent {
        font-size: 1.05rem;
        line-height: 2;
    }
}