:root {
    --primary: #F97316;
    --secondary: #FB923C;
    --accent: #FED7AA;
    --background: #7C2D12;
    --text-color: #F3F4F6;
    --grid-bg: #FFFFFF;
    --grid-line: #333333;
    --grid-text: #000000;
    --grid-number: #666666;
    --highlight-cell: #F97316; /* Primary */
    --highlight-word: #FED7AA; /* Accent */
    --modal-bg: #2D1B1B;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background);
    color: var(--text-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    display: grid;
    grid-template-areas:
        "header header"
        "game clues";
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.app-header {
    grid-area: header;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

h1 {
    margin: 0;
    color: var(--primary);
    font-size: 2rem;
}

.timer-display {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
}

.controls {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn.primary {
    background-color: var(--primary);
    color: white;
}

.btn.secondary {
    background-color: var(--secondary);
    color: #1a1a1a;
}

.btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.game-area {
    grid-area: game;
    display: flex;
    justify-content: center;
    align-items: start;
    position: relative;
}

.grid-container {
    background-color: var(--grid-bg);
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

canvas {
    display: block;
    cursor: pointer;
}

.clues-container {
    grid-area: clues;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 600px;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.1);
    padding: 15px;
    border-radius: 8px;
}

.clue-section h3 {
    color: var(--accent);
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.clue-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.clue-item {
    padding: 6px 10px;
    margin-bottom: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.95rem;
    line-height: 1.4;
}

.clue-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.clue-item.active {
    background-color: var(--primary);
    color: white;
}

.clue-item.related {
    background-color: rgba(249, 115, 22, 0.3); /* Primary with opacity */
}

/* Modal */
.modal-overlay {
    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;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--modal-bg);
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    border: 2px solid var(--primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    color: var(--primary);
    margin-top: 0;
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        grid-template-areas:
            "header"
            "game"
            "clues";
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .clues-container {
        max-height: 300px;
    }

    .app-header {
        flex-direction: column;
        gap: 10px;
    }
}
