/* ========== GLOBAL LAYOUT ========== */

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

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #020617;  /* dark slate */
    color: #e5e7eb;       /* light text */
}

/* Just a padded container so the card can scroll normally */
.centered {
    padding: 1.5rem 1.25rem;
}

/* ========== CARD ========== */

.card {
    background: #0b1120;
    padding: 2.2rem 1.8rem;
    border-radius: 1.25rem;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.6);
    max-width: 480px;
    width: 100%;
    margin: 0 auto;        /* center horizontally */
    text-align: center;
}

/* Reveal card is just a card; we stack content top → bottom */
.reveal-card {
    /* no special layout; normal block flow */
}

/* ========== TYPOGRAPHY ========== */

h1 {
    margin-top: 0;
    margin-bottom: 0.6rem;
    font-size: 1.7rem;
}

h2 {
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
}

.subtitle {
    margin-top: 0;
    margin-bottom: 1.2rem;
    color: #9ca3af;
    font-size: 0.95rem;
}

.word-meta {
    margin: 0.25rem 0 0.75rem;
    font-size: 0.9rem;
    color: #9ca3af;
}

/* ========== FORM / INPUTS ========== */

label {
    font-size: 0.95rem;
    color: #d1d5db;
    display: block;
    text-align: left;
    margin-bottom: 0.35rem;
}

textarea {
    width: 100%;
    border-radius: 0.6rem;
    border: 1px solid #1f2937;
    background: #020617;
    padding: 0.8rem;
    color: #e5e7eb;
    resize: vertical;
    min-height: 130px;
    font-size: 0.95rem;
}

textarea::placeholder {
    color: #6b7280;
}

textarea:focus {
    outline: none;
    border-color: #4f46e5;
}

/* Helper text under textarea */
small {
    display: block;
    margin-top: 0.4rem;
    color: #6b7280;
    font-size: 0.8rem;
    text-align: left;
}

/* ========== FORM ROWS (DROPDOWN / CHECKBOX) ========== */

.form-row {
    text-align: left;
    margin-bottom: 0.9rem;
}

.form-row > label {
    display: block;
    font-size: 0.95rem;
    color: #d1d5db;
    margin-bottom: 0.4rem;
}

/* Flat select (imposters count) */
.select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #020617;
    color: #e5e7eb;
    border: 1px solid #1f2937;
    border-radius: 0.6rem;
    padding: 0.7rem 2.2rem 0.7rem 0.8rem;
    font-size: 0.95rem;
    line-height: 1.2;
    cursor: pointer;
    background-image:
        linear-gradient(45deg, transparent 50%, #9ca3af 50%),
        linear-gradient(135deg, #9ca3af 50%, transparent 50%);
    background-position:
        calc(100% - 1.1rem) calc(50% - 3px),
        calc(100% - 0.9rem) calc(50% - 3px);
    background-size: 7px 7px, 7px 7px;
    background-repeat: no-repeat;
}

.select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 1px rgba(79,70,229,0.6);
}

/* Checkbox row (imposter hint) */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.4rem;
}

.checkbox-row input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.15rem;
    height: 1.15rem;
    border: 1px solid #4b5563;
    border-radius: 0.35rem;
    background: #020617;
    display: inline-block;
    position: relative;
    cursor: pointer;
}

.checkbox-row input[type="checkbox"]:hover {
    border-color: #e5e7eb;
}

.checkbox-row input[type="checkbox"]:checked {
    background: #4f46e5;
    border-color: #4f46e5;
}

.checkbox-row input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 0.32rem;
    top: 0.08rem;
    width: 0.35rem;
    height: 0.7rem;
    border: solid #ffffff;
    border-width: 0 0.18rem 0.18rem 0;
    transform: rotate(45deg);
}

.checkbox-row label {
    font-size: 0.95rem;
    color: #d1d5db;
    user-select: none;
    cursor: pointer;
}

/* ========== BUTTONS ========== */

button {
    margin-top: 1.25rem;
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 999px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    background: #4f46e5;
    color: white;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

button:hover {
    background: #4338ca;
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.55);
}

/* smaller neutral button (e.g. reset words, secondary actions) */
.secondary-btn {
    margin-top: 0.35rem;
    width: auto;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    border: 1px solid #4b5563;
    background: transparent;
    color: #e5e7eb;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: none;
}

.secondary-btn:hover {
    border-color: #e5e7eb;
    background: #020617;
}

/* inline form e.g. "Reset words" */
.inline-form {
    display: inline-block;
    margin-bottom: 0.75rem;
}

/* Next button on reveal pages — same style as normal button, but kept separate class */
.next-container {
    margin-top: 1.6rem;
}

.next-btn {
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 999px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    background: #4f46e5;
    color: white;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

/* ========== ERRORS ========== */

.error {
    color: #f97373;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    background: rgba(248, 113, 113, 0.08);
    border-radius: 0.6rem;
    padding: 0.6rem 0.75rem;
    text-align: left;
    border: 1px solid rgba(248, 113, 113, 0.35);
}

/* ========== REVEAL SCREEN ========== */

.player-label {
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 0.6rem;
}

.player-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.4rem;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* role tags */
.tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.tag.good {
    background: rgba(34, 197, 94, 0.12);
    color: #bbf7d0;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.tag.bad {
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

/* word display */
.word-label {
    font-size: 0.95rem;
    color: #9ca3af;
}

.word {
    font-size: 2.3rem;
    font-weight: 700;
    margin: 0.6rem 0 1.0rem;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.hint {
    font-size: 0.95rem;
    color: #9ca3af;
    margin-top: 0.4rem;
    margin-bottom: 0.4rem;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* top-right progress pill */
.progress {
    position: absolute;
    top: 1.1rem;
    right: 1.5rem;
    font-size: 0.8rem;
    color: #6b7280;
    background: #0b1120;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid #1f2937;
    z-index: 1;
}

/* ========== RESPONSIVE TWEAKS ========== */

/* Bigger screens: slightly more padding & font sizes */
@media (min-width: 768px) {
    .card {
        padding: 2.6rem 2.4rem;
    }

    h1 {
        font-size: 1.9rem;
    }

    .player-name {
        font-size: 2.1rem;
    }

    .word {
        font-size: 2.4rem;
    }
}

/* Very small / narrow screens: let the card be full-width and shrink big text a bit */
@media (max-width: 500px) {
    .card {
        max-width: 100% !important;
        padding: 1.5rem 1.1rem;
    }

    .player-name {
        font-size: 1.8rem;
    }

    .word {
        font-size: 2.0rem;
    }
}
