:root {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --correct: #0d9488;    /* Teal - Colorblind friendly */
    --wrong: #ea580c;      /* Orange - Colorblind friendly */
    --locked-bg: #334155;
    --border-radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

header {
    width: 100%;
    max-width: 600px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--surface-color);
}

h1 {
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
    transition: transform 0.2s;
}

.icon-btn:hover {
    transform: scale(1.1);
}

main {
    width: 100%;
    max-width: 600px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.game-info {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Hints Grid */
.hints-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.hint-card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 80px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.hint-card.locked {
    background-color: var(--locked-bg);
    color: var(--text-muted);
}

.hint-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.hint-value {
    font-weight: bold;
    font-size: 1.1rem;
}

.hint-card.revealed {
    animation: flipIn 0.5s ease forwards;
    border-color: var(--primary);
}

@keyframes flipIn {
    0% { transform: rotateX(90deg); opacity: 0; }
    100% { transform: rotateX(0); opacity: 1; }
}

/* Input Form */
.guess-form {
    display: flex;
    gap: 0.5rem;
}

#guess-input {
    flex: 1;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--surface-color);
    background-color: var(--surface-color);
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
}

#guess-input:focus {
    border-color: var(--primary);
}

#guess-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button[type="submit"] {
    padding: 0 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    background-color: var(--primary);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

button[type="submit"]:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

button[type="submit"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.error-message {
    color: var(--wrong);
    font-size: 0.85rem;
    text-align: center;
    height: 1rem;
}

/* Guesses List */
.guesses-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.guess-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    background-color: var(--surface-color);
    font-weight: bold;
    animation: slideIn 0.3s ease;
}

.guess-row.wrong {
    border-left: 4px solid var(--wrong);
}

.guess-row.correct {
    border-left: 4px solid var(--correct);
    background-color: rgba(13, 148, 136, 0.2);
}

@keyframes slideIn {
    0% { transform: translateX(-10px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

/* Modals */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--bg-color);
    border: 1px solid var(--surface-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    position: relative;
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 10px; right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}

.modal-content h2 {
    margin-bottom: 1rem;
}

.modal-content ul {
    text-align: left;
    margin: 1rem 0 1rem 1.5rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.end-message {
    margin-bottom: 1.5rem;
    font-weight: bold;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.share-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--correct);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
}

.share-btn:hover {
    background-color: #0f766e;
}

.toast {
    margin-top: 0.5rem;
    color: var(--correct);
    font-size: 0.9rem;
}