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

body {
    background-color: #f5f5f5;
    font-family: sans-serif;
    color: #212121;
}

main {
    max-width: 600px;
    margin: 0 auto;
    padding: 48px 32px 40px;
    text-align: center;
}

h1 {
    font-size: 2em;
    font-weight: 600;
    margin-bottom: 32px;
    letter-spacing: -0.5px;
}

p {
    line-height: 1.5;
}

a {
    color: #ff6f91;
}

/* --- Player card --- */

#playerCard {
    background: #fff;
    border-radius: 12px;
    padding: 28px 32px 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* --- Emotion bars --- */

.hidden {
    display: none;
}

#dominantEmotion {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ff6f91;
}

#analysedText {
    font-size: 0.9em;
    color: #757575;
    font-style: italic;
    margin-bottom: 16px;
}

.emotion-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.emotion-row:last-child {
    margin-bottom: 0;
}

.emotion-label {
    width: 72px;
    text-transform: capitalize;
    text-align: left;
    flex-shrink: 0;
}

.emotion-bar-track {
    flex: 1;
    background: #e0e0e0;
    border-radius: 4px;
    height: 12px;
    overflow: hidden;
}

.emotion-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: #ff6f91;
    transition: width 0.5s ease;
}

.emotion-score {
    width: 36px;
    text-align: right;
    flex-shrink: 0;
    font-size: 0.85em;
    color: #757575;
}

/* --- Play / Stop buttons --- */

#toggleBtn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    padding: 0;
    border: none;
    cursor: pointer;
    margin: 20px 8px 0;
    background-color: #ff6f91;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#toggleBtn:hover {
    background-color: #e8547a;
}

#toggleBtn:active {
    background-color: #d13d65;
}

/* --- Analyse section (secondary) --- */

#analyseSection {
    margin: 0 auto;
    text-align: left;
    border-top: 1px solid #e0e0e0;
    padding-top: 16px;
}

#analyseSection summary {
    cursor: pointer;
    font-size: 0.85em;
    color: #757575;
    user-select: none;
    list-style: none;
    text-align: center;
}

#analyseSection summary::-webkit-details-marker {
    display: none;
}

#analyseSection summary::after {
    content: " ▾";
}

#analyseSection[open] summary::after {
    content: " ▴";
}

#analyseContent {
    margin-top: 16px;
}

.hint {
    font-size: 0.8em;
    color: #757575;
    margin-bottom: 12px;
}

/* --- Form fields --- */

.field {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.field label {
    font-size: 0.8em;
    color: #757575;
    margin-bottom: 4px;
}

.field input,
.field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #bdbdbd;
    border-radius: 4px;
    font-size: 0.95em;
    background: #fff;
    outline: none;
    font-family: inherit;
    resize: vertical;
}

.field input:focus,
.field textarea:focus {
    border-color: #ff6f91;
}

#analyseBtn {
    cursor: pointer;
    font-size: 0.9em;
    border: none;
    border-radius: 4px;
    padding: 8px 20px;
    background-color: #ff6f91;
    color: #fff;
    margin-bottom: 8px;
}

#analyseBtn:hover {
    background-color: #e8547a;
}

#analyseBtn:disabled {
    background-color: #f5a0b5;
    cursor: not-allowed;
}

#analyseStatus {
    margin-top: 4px;
}

/* --- Footer --- */

footer {
    margin-top: 48px;
}

footer p {
    font-size: 0.8em;
    color: #bdbdbd;
}
