/* Grid Search Specific Styling */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
    background: radial-gradient(circle at top right, #9d174d, var(--background));
}

.game-container {
    width: 100%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--surface-border);
}

.btn-back {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: transparent;
}

.score-display {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary);
}

.game-ui-top {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timer-bar-container {
    width: 100%;
    height: 12px;
    background: var(--surface-glass);
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 1px solid var(--surface-border);
}

.timer-bar {
    height: 100%;
    background: var(--success);
    width: 100%;
    transition: width 0.1s linear, background 0.3s ease;
}

.timer-bar.warning {
    background: var(--error);
}

.target-zone {
    text-align: center;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.target-zone h2 {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.target-character {
    font-size: 4rem;
    line-height: 1.2;
    color: var(--text);
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
    margin-top: 0.5rem;
}

.target-roman {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 2px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    padding: 1rem;
    background: var(--surface-glass);
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.grid-cell {
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 2px solid var(--surface-border);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.2rem;
    font-family: var(--font-kr);
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    color: var(--text);
}

.grid-cell:hover {
    transform: translateY(-2px) scale(1.05);
    background: var(--surface-glass);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.grid-cell:active {
    transform: scale(0.95);
}

.grid-cell.found {
    background: var(--success);
    border-color: var(--success);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5);
    pointer-events: none;
    animation: popIn 0.3s forwards;
}

.grid-cell.wrong {
    animation: shake 0.4s forwards;
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--error);
    color: var(--error);
}

.message-area {
    text-align: center;
    min-height: 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-muted);
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    padding: 3rem 2rem;
    text-align: center;
    z-index: 100;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-over.hidden {
    display: none;
}

.game-over h2 {
    font-size: 2.5rem;
    color: var(--error);
    margin-bottom: 1rem;
}

.game-over p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.mt-4 {
    margin-top: 1rem;
}
