:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: var(--bg-color, #fff); /* Fallback to white for Hugo Pulp Theme compatibility */
    --text: var(--text-color, #222); /* Dark text for Pulp Theme */
    --correct: #22c55e;
    --wrong: #ef4444;
}

#game-container {
    width: 100%;
    margin: 0 auto;
    font-family: var(--font-family-serif, Courier, monospace);
}

#bible-speedrun-ui {
    color: var(--text);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-family: inherit;
}

button:hover {
    background-color: var(--primary-hover);
}

button:active {
    transform: scale(0.95);
}

.game-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    background: var(--bg);
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: bold;
    border: 1px solid #e2e8f0;
}

.game-header>div:first-child {
    text-align: left;
}

.game-header>div:nth-child(2) {
    text-align: center;
}

.game-header>div:last-child {
    text-align: right;
}

#target-display {
    font-weight: bold;
    transition: all 0.2s;
}

.hidden-target {
    background-color: #e2e8f0;
    color: #64748b;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
}

.hidden-target:hover {
    background-color: #cbd5e1;
    color: #475569;
}

.revealed-target {
    color: var(--primary);
    background: none;
    padding: 0;
    cursor: default;
    font-size: inherit;
}

#timer {
    font-family: monospace;
    font-size: 1.5rem;
}

.best-time {
    font-size: 1rem;
    color: #64748b;
    font-weight: normal;
}

#search-bar {
    width: 100%;
    max-width: 500px;
    padding: 12px 20px;
    font-size: 1.1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.2s;
    display: none;
    box-sizing: border-box;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
}

#search-bar:focus {
    border-color: var(--primary);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.book-btn {
    background-color: var(--bg);
    color: var(--text);
    border: 2px solid #e2e8f0;
    padding: 15px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgb(0 0 0 / 0.05);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.book-btn .pinyin {
    font-size: 0.8em;
    color: #64748b;
    font-weight: normal;
}

.book-btn.correct .pinyin,
.book-btn.wrong .pinyin {
    color: rgba(255, 255, 255, 0.85);
}

.book-btn:hover:not(:disabled) {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.book-btn.correct {
    background-color: var(--correct);
    border-color: var(--correct);
    color: white;
    cursor: default;
}

.book-btn.found {
    display: none !important;
}

.book-btn.wrong {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
    background-color: var(--wrong);
    border-color: var(--wrong);
    color: white;
}

@keyframes shake {
    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }
    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }
    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }
    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

#victory-message {
    display: none;
    color: #15803d;
    margin-top: 20px;
    padding: 20px;
    background: #dcfce7;
    border-radius: 12px;
    margin-bottom: 20px;
}

.victory-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

.victory-subtitle {
    font-size: 1.1rem;
    color: #15803d;
    display: block;
}

/* Dark mode adjustments for Hugo Pulp Theme compatibility */
@media (prefers-color-scheme: dark) {
    .toggle-label {
        color: #f8fafc; /* Make text white/light gray in dark mode */
    }
}
