/* Hit and Blow Specific Styles */

.game-container {
    max-width: 800px;
    padding-bottom: 60px;
}

.game-header {
    text-align: center;
    margin-bottom: 40px;
}

.game-header h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 32px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--secondary-color);
}

.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: all 0.2s;
}

.radio-label:hover {
    background-color: var(--bg-color);
}

.radio-label input:checked+span {
    color: var(--primary-color);
    font-weight: 600;
}

.radio-label input:checked {
    accent-color: var(--primary-color);
}

.secret-input-wrapper {
    display: flex;
    gap: 12px;
}

.secret-input-wrapper input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.2rem;
    letter-spacing: 4px;
    text-align: center;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    opacity: 0.9;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-large {
    width: 100%;
    font-size: 1.1rem;
    padding: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.9rem;
}

.btn-text {
    background: none;
    color: var(--text-light);
    text-decoration: underline;
    padding: 8px;
}

.divider {
    text-align: center;
    margin: 20px 0;
    color: var(--text-light);
    font-size: 0.9rem;
    position: relative;
}

.divider::before,
.divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background-color: var(--border-color);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.error-message {
    color: #e53935;
    font-size: 0.9rem;
    margin-top: 8px;
    min-height: 1.2em;
}

/* Game Board Layout */
.game-board {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.turn-indicator {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.board-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.player-board,
.computer-board {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.computer-board {
    background-color: #fcfcfc;
}

.secret-display {
    margin: 12px 0;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    letter-spacing: 2px;
}

.history-container {
    flex-grow: 1;
    min-height: 300px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 12px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid #eee;
    font-family: monospace;
    font-size: 1.1rem;
}

.history-item:last-child {
    border-bottom: none;
}

.history-guess {
    letter-spacing: 2px;
    font-weight: 600;
}

.history-result {
    display: flex;
    gap: 8px;
}

.hit-count {
    color: #e53935;
    font-weight: 700;
}

.blow-count {
    color: #1e88e5;
    font-weight: 700;
}

.input-area {
    margin-top: auto;
}

.current-guess {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.digit-box {
    width: 40px;
    height: 50px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    background: white;
}

.digit-box.filled {
    border-color: var(--secondary-color);
}

.numpad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.num-btn,
.action-btn {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.1s;
}

.num-btn:hover,
.action-btn:hover {
    background-color: #f0f0f0;
}

.num-btn:active,
.action-btn:active {
    transform: scale(0.95);
}

.num-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.action-btn {
    background-color: #f5f5f5;
    font-size: 1rem;
}

#enter-btn,
#modal-enter-btn {
    grid-column: span 2;
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

#enter-btn:hover,
#modal-enter-btn:hover {
    background-color: var(--primary-hover);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.modal-content h3 {
    margin-bottom: 24px;
}

/* Cheat Mode */
.cheat-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.cheat-input-section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.cheat-results {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    max-height: 600px;
    overflow-y: auto;
}

.candidate-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.candidate-item {
    background: #f5f5f5;
    padding: 4px;
    text-align: center;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
}

/* Memo Area */
.memo-area {
    margin: 16px 0;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.memo-area h4 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.memo-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.memo-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.memo-btn:hover {
    transform: scale(1.1);
}

/* Memo States */
.memo-btn.state-1 {
    /* Not Used (X) */
    background-color: #ffebee;
    color: #e53935;
    border-color: #e53935;
    text-decoration: line-through;
}

.memo-btn.state-2 {
    /* Used (O) */
    background-color: #e8f5e9;
    color: #43a047;
    border-color: #43a047;
    font-weight: 700;
}

.memo-btn.state-3 {
    /* Maybe (?) */
    background-color: #e3f2fd;
    color: #1e88e5;
    border-color: #1e88e5;
}

/* In-Game Candidates */
.ingame-candidates {
    margin-bottom: 16px;
}

#ingame-candidate-list {
    margin-top: 8px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {

    .board-layout,
    .cheat-layout {
        grid-template-columns: 1fr;
    }

    .numpad {
        gap: 4px;
    }

    .num-btn {
        padding: 10px;
    }
}