/* Game Panel Header */
.game-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-title {
    font-weight: bold;
}

.game-timer-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-timer {
    font-family: 'Courier New', Courier, monospace;
    font-size: 18px;
    font-weight: bold;
    color: #333333;
}

.game-pause-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    color: #666666;
    border-radius: 3px;
    letter-spacing: -2px;
}

.game-pause-btn:hover {
    background: #D0D0D0;
    color: #333333;
}

.game-options-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 16px;
    cursor: pointer;
    color: #666666;
    border-radius: 3px;
}

.game-options-btn:hover {
    background: #D0D0D0;
    color: #333333;
}

/* Game Content Container */
.game-content {
    position: relative;
}

/* Pause Overlay */
.pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.pause-overlay:not(.hidden) {
    display: flex;
}

.pause-message {
    text-align: center;
    padding: 15px;
}

.pause-icon {
    font-size: 48px;
    color: #666666;
    margin-bottom: 8px;
    letter-spacing: -5px;
}

.pause-text {
    font-size: 24px;
    font-weight: bold;
    color: #333333;
    margin-bottom: 10px;
}

.completion-time {
    font-size: 20px;
    font-family: 'Courier New', Courier, monospace;
    color: #333333;
    font-weight: bold;
}

.play-again-hint {
    margin-top: 12px;
    font-size: 14px;
    color: #666666;
}

.play-again-hint .highlight-clear {
    font-weight: bold;
    color: #333333;
}

/* Pulse animation for Clear Grid button */
.pulse-attention {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 102, 204, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(0, 102, 204, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 102, 204, 0);
    }
}

/* Blurred game state */
.game-blurred {
    filter: blur(1px);
    pointer-events: none;
    user-select: none;
}

/* Crossword Grid */
.crossword-grid {
    display: inline-grid;
    border: 2px solid #333333;
    background: #FFFFFF;
    gap: 0;
}

.grid-cell {
    width: 30px;
    height: 30px;
    border: 1px solid #CCCCCC;
    font-family: 'Courier New', Courier, monospace;
    color: #333333;
    background: #FFFFFF;
    cursor: pointer;
    transition: background-color 0.1s ease;
    position: relative;
}

.grid-cell:hover {
    background: #E0E0E0;
}

.grid-cell-black {
    background: #333333;
}

.grid-cell-black:hover {
    background: #555555;
}

.cell-number {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 8px;
    font-weight: normal;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1;
    z-index: 1;
}

.cell-letter {
    display: block;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    line-height: 30px;
}

/* Playable cell styling */
.grid-cell-playable {
    cursor: text;
}

.grid-cell-playable:hover {
    background: #FFFFFF;
}

.cell-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    font-weight: bold;
    color: #333333;
    padding: 0;
    margin: 0;
    text-transform: uppercase;
    caret-color: #0066CC;
}

.cell-input:focus {
    outline: none;
}

/* Word highlighting */
.cell-highlight {
    background: #FFF9C4 !important; /* Light yellow for word */
}

.cell-current {
    background: #BBDEFB !important; /* Light blue for current cell */
}

.cell-highlight .cell-input,
.cell-current .cell-input {
    background: transparent;
}

.cell-current .cell-input:focus {
    background: transparent;
}

/* Clickable clues */
.clue-item {
    cursor: pointer;
    padding-left: 10px;
    margin-left: -10px;
    border-left: 10px solid transparent;
}

/* Clue highlighting */
.clue-highlight {
    background: #a5d6fa; /* Light blue */
}

/* Secondary clue highlighting (other direction) - blue bar indicator */
.clue-item.clue-secondary {
    border-left: 10px solid #a5d6fa;
}

/* Completed clues */
.clue-complete {
    color: #999999;
    text-decoration: line-through;
    background: #D9D9D9;
}

.clue-complete:hover {
    background: #CCCCCC;
}

/* Statistics */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.stat-item {
    background: #F5F5F5;
    border: 1px solid #CCCCCC;
    padding: 10px;
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: #666666;
    text-transform: uppercase;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #333333;
}

/* Clues */
.clues-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.clue-section {
    background: #FFFFFF;
    border: 1px solid #CCCCCC;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.clue-section-title {
    font-size: 16px;
    font-weight: bold;
    padding: 10px 15px;
    border-bottom: 1px solid #CCCCCC;
    background: #FFFFFF;
    flex-shrink: 0;
}

.clue-section-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 15px;
}

.clue-item {
    margin-bottom: 8px;
    font-size: 14px;
    color: #333333;
}

.clue-number {
    font-weight: bold;
    margin-right: 5px;
}

/* Game Layout Specific Styles */
.game-layout {
    display: grid;
    grid-template-columns: 454px 1fr;
    gap: 20px;
}

.grid-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #F5F5F5;
    width: 454px;
    min-height: 500px;
}

.grid-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* Clue Banner */
.clue-banner {
    background: #a5d6fa;
    padding: 8px 12px;
    font-size: 14px;
    color: #333333;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    position: relative;
}

.clue-banner-content {
    flex: 1;
    min-width: 0;
    padding: 0 8px;
    line-height: 1.4;
}

.clue-banner-number {
    font-weight: bold;
}

.clue-banner-text {
    color: #333333;
}

/* Clue Rotation Arrows */
.clue-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 14px;
    font-weight: bold;
    color: #333333;
    background: #FFFFFF;
    border: 1px solid #CCCCCC;
    border-radius: 3px;
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
}

.clue-arrow:hover:not(.clue-arrow-disabled) {
    background: #E8E8E8;
    border-color: #999999;
}

.clue-arrow:active:not(.clue-arrow-disabled) {
    background: #D0D0D0;
}

.clue-arrow-disabled {
    color: #AAAAAA;
    background: #E8E8E8;
    border-color: #DDDDDD;
    cursor: default;
}

/* Clue Pill Indicator */
.clue-pill {
    position: absolute;
    top: -10px;
    right: -12px;
    background: #FFFFFF;
    border: 1px solid #CCCCCC;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: bold;
    color: #666666;
}

.clues-wrapper {
    background: #F5F5F5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 500px;
    max-height: 500px;
}

/* Responsive */
@media (max-width: 768px) {

    .grid-cell {
        width: 25px;
        height: 25px;
        line-height: 25px;
        font-size: 14px;
    }

    .clues-container {
        grid-template-columns: 1fr;
    }

    .game-layout {
        grid-template-columns: 1fr;
    }
}