:root {
    --villager-brown: #8B5A2B;
    --villager-light-brown: #A67C52;
    --villager-dark-brown: #654321;
    --minecraft-green: #44AA33;
    --minecraft-dark-green: #338822;
    --dirt-brown: #8B4513;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Courier New', Courier, monospace;
}

body {
    background-color: #f5f5dc;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.1) 1px, transparent 1px);
    background-size: 32px 32px;
    color: #333;
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--minecraft-green);
    border: 4px solid #333;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

h1 {
    font-size: 4rem;
    color: white;
    text-shadow: 3px 3px 0 #333;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    color: #f0f0f0;
    font-style: italic;
}

.news-generator {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.input-section {
    background-color: white;
    padding: 20px;
    border: 4px solid #333;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

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

h2 {
    margin-bottom: 20px;
    color: var(--villager-dark-brown);
    border-bottom: 2px solid var(--minecraft-green);
    padding-bottom: 5px;
}

h3 {
    margin-bottom: 10px;
    color: var(--villager-brown);
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

textarea, select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

textarea {
    height: 100px;
    resize: vertical;
}

select {
    background-color: white;
}

.tts-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

input[type="range"] {
    width: 100%;
    margin-top: 5px;
}

#speedValue {
    display: inline-block;
    margin-left: 5px;
    font-weight: bold;
}

button {
    background-color: var(--minecraft-green);
    color: white;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 4px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--minecraft-dark-green);
}

#generateBtn {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    margin-top: 10px;
}

.loading-spinner {
    display: none;
    text-align: center;
    margin-top: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(68, 170, 51, 0.3);
    border-radius: 50%;
    border-top-color: var(--minecraft-green);
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.news-presentation {
    background-color: white;
    border: 4px solid #333;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.news-header {
    background-color: var(--minecraft-green);
    padding: 15px;
    text-align: center;
}

.news-title {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 2px 2px 0 #333;
}

.news-studio {
    background-color: #e7e7e7;
    height: 300px;
    position: relative;
    border-bottom: 4px solid #333;
    overflow: hidden;
}

.news-desk {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background-color: var(--dirt-brown);
    border-top: 4px solid #333;
}

.villager {
    position: absolute;
    bottom: 70px;
    width: 120px;
    height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.villager1 {
    left: 30%;
    transform: translateX(-50%);
}

.villager2 {
    right: 30%;
    transform: translateX(50%);
}

.villager-head {
    width: 100px;
    height: 100px;
    background-color: var(--villager-brown);
    border: 3px solid #333;
    position: relative;
}

.villager-face {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
}

.nose {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 25px;
    background-color: var(--villager-dark-brown);
    border: 2px solid #333;
    border-radius: 10px;
}

.eyes {
    display: flex;
    justify-content: space-between;
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
}

.eye {
    width: 10px;
    height: 10px;
    background-color: #000;
    border-radius: 50%;
}

.brow {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 5px;
    background-color: var(--villager-dark-brown);
}

.name-tag {
    margin-top: 10px;
    padding: 5px 10px;
    background-color: #efefef;
    border: 2px solid #333;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.news-content {
    padding: 20px;
}

#newsText {
    min-height: 200px;
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.news-paragraph {
    margin-bottom: 15px;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.interview-text {
    background-color: rgba(139, 90, 43, 0.1);
    padding: 15px;
    border-left: 4px solid var(--villager-brown);
    margin: 10px 0;
    font-style: italic;
}

.interview-attribution {
    display: block;
    font-weight: bold;
    color: var(--villager-dark-brown);
    margin-top: 5px;
    font-style: normal;
}

footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: #777;
    font-size: 0.9rem;
}

.highlighted {
    background-color: rgba(68, 170, 51, 0.2);
    box-shadow: 0 0 0 2px rgba(68, 170, 51, 0.5);
    border-radius: 3px;
}

.hidden {
    display: none;
}

.talking .nose {
    animation: talk 0.3s infinite alternate;
}

@keyframes talk {
    from { height: 25px; }
    to { height: 30px; }
}

@media (max-width: 768px) {
    .news-studio {
        height: 250px;
    }
    
    .villager-head {
        width: 80px;
        height: 80px;
    }
    
    .villager-face {
        width: 60px;
        height: 60px;
    }
    
    .nose {
        width: 30px;
        height: 20px;
    }
    
    .news-title {
        font-size: 1.5rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
}