/* styles.css */

:root {
    --primary: #38003c; /* Deep Purple */
    --primary-light: #5e1166;
    --accent: #00ff85; /* Vibrant Green */
    --accent-hover: #05e579;
    --danger: #e90052; /* Bright Red/Pink for errors */
    --text-dark: #242424;
    --text-light: #ffffff;
    --card-bg: #ffffff;
    --bg-gradient: linear-gradient(135deg, #38003c 0%, #1a001c 100%);
    --shadow: 0 10px 40px rgba(0,0,0,0.5);
    --radius: 20px;
    --btn-radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-dark);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* --- Main Card Container --- */
#ui-container {
    background: var(--card-bg);
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 420px; /* Optimal mobile width */
    text-align: center;
    position: relative;
    overflow: hidden;
}

h1 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* --- Form Elements (Dropdowns) --- */
select {
    width: 100%;
    padding: 14px;
    margin-bottom: 12px;
    border-radius: var(--btn-radius);
    border: 2px solid #e0e0e0;
    font-family: inherit;
    font-size: 1rem;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: border-color 0.2s;
}

select:focus {
    outline: none;
    border-color: var(--primary);
}

/* --- Buttons --- */
button {
    width: 100%;
    padding: 16px;
    border-radius: var(--btn-radius);
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

/* Primary Action Button (Start Game) */
#setup button, #result-screen button {
    background-color: var(--accent);
    color: var(--primary);
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#setup button:hover, #result-screen button:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 133, 0.4);
}

/* --- Game Area --- */
.stats {
    display: inline-block;
    background: var(--primary);
    color: var(--accent);
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

#badge-image {
    max-width: 160px;
    height: auto;
    margin: 1rem 0 2rem 0;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.15));
    transition: transform 0.3s;
}

#badge-image:hover {
    transform: scale(1.05);
}

/* --- Option Buttons (The Answers) --- */
#options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#options-grid button {
    background-color: white;
    color: var(--primary);
    border: 2px solid #eee;
    padding: 14px;
    text-align: center;
    font-weight: 500;
}

#options-grid button:hover {
    border-color: var(--primary);
    background-color: #fcfcfc;
    transform: translateY(-2px);
}

#options-grid button:active {
    background-color: var(--primary);
    color: white;
    transform: translateY(0);
}

/* --- Hints & Footer --- */
#hint-section {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
}

#hint-btn {
    background: transparent;
    color: #888;
    font-size: 0.85rem;
    padding: 8px;
    width: auto;
    text-decoration: underline;
    font-weight: normal;
}

#hint-btn:hover {
    color: var(--primary);
    background: transparent;
    box-shadow: none;
    transform: none;
}

#hints-display p {
    font-size: 0.9rem;
    color: var(--primary);
    background: #f0ebf5;
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 10px;
    animation: fadeIn 0.3s ease-in;
}

#feedback {
    min-height: 24px;
    margin-top: 15px;
    font-weight: 700;
    color: var(--primary);
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

#game-container {
    animation: fadeIn 0.4s ease-out;
}

#share-btn {
    background-color: #1DA1F2; /* Twitter/Generic Share Blue */
    color: white;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

#share-btn:hover {
    background-color: #0c85d0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(29, 161, 242, 0.4);
}

/* --- NEW: Daily Challenge / Hangman Styles --- */

/* The _ _ A _ _ display */
#word-display {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: monospace; /* Monospace keeps letters evenly spaced */
    color: var(--primary);
}

.letter-slot {
    border-bottom: 3px solid var(--primary);
    min-width: 20px;
    text-align: center;
    display: inline-block;
}

.letter-slot.space {
    border-bottom: none;
    width: 15px;
}

/* The Keyboard Grid */
#keyboard {
    display: grid;
    grid-template-columns: repeat(7, 1fr); /* 7 letters per row */
    gap: 6px;
    margin-top: 10px;
}

.key-btn {
    background: #e0e0e0;
    color: var(--text-dark);
    border: none;
    padding: 12px 0;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    touch-action: manipulation; /* Improves mobile tap response */
}

.key-btn:hover { background: #d0d0d0; }

/* Key States */
.key-btn.correct {
    background-color: var(--accent);
    color: var(--primary);
    border: 1px solid var(--accent);
}

.key-btn.wrong {
    background-color: #ccc;
    color: #888;
    opacity: 0.5;
    cursor: not-allowed;
}