/* Estilo base */
:root {
    --bg: #fff7ed;
    --surface: #ffffff;
    --primary: #0f766e;
    --primary-dark: #0a5c56;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    --strong-text: #0f172a;
    --accent: #b45309;
    --accent-bg: #ffedd5;
}

body {
    font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: radial-gradient(circle at top, #ffedd5 0%, #fff7ed 45%, #fef3c7 100%);
    color: var(--text);
}

header {
    background: linear-gradient(135deg, #fb923c, #f97316);
    color: #1f2937;
    padding: 24px 16px;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 28px;
    letter-spacing: 0.5px;
}

nav {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 12px;
    box-shadow: var(--shadow);
}

nav a {
    text-decoration: none;
    color: white;
    background-color: var(--primary);
    padding: 12px 18px;
    font-size: 16px;
    border-radius: 999px;
    min-width: 120px;
    text-align: center;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

nav a:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

main {
    flex: 1;
    padding: 24px 16px 32px;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.hero-image {
    width: 100%;
    max-width: 520px;
    max-height: 45vh;
    height: auto;
    object-fit: contain;
    border-radius: 18px;
    margin: 18px auto 0;
    box-shadow: var(--shadow);
    border: 3px solid #fff;
    display: block;
}

p {
    color: var(--muted);
}

label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 600;
    color: var(--strong-text);
}

input[type="number"] {
    font-size: 18px;
    padding: 10px 12px;
    width: 140px;
    border-radius: 10px;
    border: 2px solid #94a3b8;
    color: var(--strong-text);
    background: #ffffff;
}

input[type="text"] {
    font-size: 18px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 2px solid #94a3b8;
    color: var(--strong-text);
    background: #ffffff;
}

select {
    font-size: 18px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 2px solid #94a3b8;
    color: var(--strong-text);
    background: #ffffff;
}

button {
    font-size: 18px;
    padding: 12px 18px;
    margin-top: 12px;
    border: 0;
    border-radius: 12px;
    background-color: var(--primary);
    color: white;
    cursor: pointer;
    min-height: 48px;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

.card {
    background: var(--surface);
    border: 2px solid #cbd5f5;
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.stack label {
    align-self: flex-start;
}

.option-group {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.option-group legend {
    font-weight: 700;
    padding: 0 6px;
}

.inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-field {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.inline-field input[type="text"] {
    flex: 1 1 auto;
}

.inline-field button {
    margin-top: 0;
    white-space: nowrap;
}

.word-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.word-list-item span {
    flex: 1 1 auto;
}

.muted {
    color: var(--muted);
}

.hidden {
    display: none;
}

.secondary {
    background-color: #334155;
}

.secondary:hover {
    background-color: #1f2937;
}

.role-box {
    font-size: 28px;
    font-weight: 700;
    padding: 16px 18px;
    background: #fef3c7;
    border-radius: 14px;
    margin: 12px 0;
}

.rules {
    text-align: left;
    padding-left: 18px;
    margin: 10px 0 16px;
}

.final-word {
    margin-top: 12px;
    font-weight: 700;
}

.error {
    color: #b91c1c;
    font-weight: 600;
}

.suggestion-box {
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 2px solid #fb923c;
    background: var(--accent-bg);
}

.suggestion-word {
    font-size: 22px;
    font-weight: 700;
    color: #7c2d12;
    margin: 6px 0 10px;
}

.scoreboard {
    margin-bottom: 12px;
}

.score-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.score-item {
    background: #f8fafc;
    border: 1px solid var(--border);
    padding: 10px 12px;
    border-radius: 12px;
    text-align: center;
}

.score-item.active {
    border-color: #fb923c;
    box-shadow: 0 0 0 2px rgba(251, 146, 60, 0.2);
}

.badge {
    background: #e0f2fe;
    color: #0f172a;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 600;
}

.game-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 12px 0;
}

.timer {
    font-size: 36px;
    font-weight: 800;
    color: #0f766e;
    text-align: center;
    margin: 8px 0 12px;
}

.word-card {
    background: #fff7ed;
    border: 3px solid #fb923c;
    border-radius: 16px;
    padding: 18px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.word-card.flash {
    animation: wordFlash 0.35s ease;
}

.word-card.timeup {
    animation: wordShake 0.45s ease;
    border-color: #ef4444;
    background: #fee2e2;
}

.time-up-strong {
    animation: timePulse 0.6s ease-in-out;
    color: #b91c1c;
}

.resume-box {
    margin-top: 18px;
    padding: 12px;
    border-radius: 12px;
    border: 2px dashed #38bdf8;
    background: #ecfeff;
}

.team-name-box {
    margin: 12px 0;
    padding: 12px;
    border-radius: 12px;
    border: 2px solid #16a34a;
    background: #dcfce7;
}

#setup-screen label {
    font-weight: 700;
}

#setup-screen .muted {
    color: #475569;
}

@keyframes wordFlash {
    0% { transform: scale(1); box-shadow: none; }
    45% { transform: scale(1.05); box-shadow: 0 12px 30px rgba(251, 146, 60, 0.35); }
    100% { transform: scale(1); box-shadow: none; }
}

@keyframes wordShake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

@keyframes timePulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

.dice {
    width: 64px;
    height: 64px;
    margin: 6px;
    vertical-align: middle;
}

#dice-result {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

footer {
    background-color: var(--surface);
    text-align: center;
    padding: 12px 10px;
    border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
    header h1 {
        font-size: 24px;
    }

    nav {
        justify-content: stretch;
    }

    nav a {
        flex: 1 1 auto;
        min-width: 140px;
    }

    main {
        padding: 20px 14px 28px;
        text-align: left;
    }

    button,
    input[type="number"],
    input[type="text"],
    select {
        width: 100%;
    }

    .stack {
        align-items: stretch;
    }
}
