/* =========================================
   3. 게임 화면 (테두리 래퍼)
   ========================================= */
#game-screen {
    position: relative;
    padding: 24px 20px; /* 상단 패딩을 32px에서 24px로 줄여 전체적으로 위로 올림 */
    background: linear-gradient(135deg, #0f172a 0%, #0f1219 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    margin: 10px;
    min-height: 600px;
    overflow: hidden;
}

#game-screen::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 4px double rgba(212, 175, 55, 0.3);
    border-radius: 16px;
    pointer-events: none;
    z-index: 1;
}

#game-screen::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 12px;
    pointer-events: none;
    z-index: 1;
}

/* =========================================
   게임 화면 - 상단바 & 정보영역
   ========================================= */
.game-nav {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* 상단 정렬로 통일 */
    margin-bottom: 20px;
    padding: 0;
    position: relative;
    z-index: 10;
}

.back-btn, .home-btn {
    width: 95px; /* 법률 화면과 동일한 너비 */
    height: 36px; /* 법률 화면과 동일한 높이 */
    padding: 0;
    border: 1px solid rgba(212, 175, 55, 0.5); /* 골드 테두리 적용 */
    border-radius: 8px;
    background: #1a1f2c;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: normal;
}

.back-btn:hover, .home-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
    border-color: #d4af37;
    transform: translateY(-2px);
}

.back-btn:active, .home-btn:active {
    transform: scale(0.95);
}

.nav-btn {
    background: transparent;
    border: 1px solid #363c4e;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    color: #fbbf24; /* 포인트 컬러: 노란색 */
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.nav-btn:hover {
    background-color: #363c4e;
}

/* 생명력 표시 (디자인 요소) */
.life-container {
    display: flex;
    gap: 4px;
    margin-top: 10px; /* 정렬 미세 조정 */
}

.dot {
    font-size: 18px; /* 하트 크기 */
    color: #ef4444; /* 빨간색 하트 (활성) */
    display: inline-block;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 2px rgba(239, 68, 68, 0.4));
    line-height: 1;
}

.dot::before {
    content: "♥"; /* 하트 유니코드 */
}

.dot.lost {
    color: #475569; /* 잃은 생명 (어두운 회색) */
    filter: none;
    opacity: 0.6;
}

.game-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.info-tag {
    background-color: #1e293b;
    color: #94a3b8;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid #334155;
    font-weight: 500;
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-count {
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
}

/* 프로그레스 바 */
.progress-bar-container {
    height: 6px;
    background: #334155;
    border-radius: 3px;
    margin-bottom: 20px; /* 30px에서 20px로 줄여 공간 확보 */
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(to right, #fde68a, #fbbf24);
    width: 0%;
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

/* =========================================
   4. 문제 카드 영역
   ========================================= */
.question-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 20px;
    padding: 24px 20px;
    min-height: 170px;
    width: 92%;
    margin: 0 auto 0; /* 피드백 영역에서 통합 제어를 위해 하단 여백 제거 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    width: 100%;
}

#question-text {
    font-size: 18px;
    line-height: 1.6;
    color: #f1f5f9;
    font-weight: 700;
    width: 100%;
    text-align: left; /* 시작점 일치를 위해 왼쪽 정렬로 변경 */
    word-break: break-all;
    white-space: pre-wrap;
    padding: 0 10px; /* 좌우 여백 약간 추가 */
}

/* 힌트 박스 */
.hint-placeholder {
    height: 170px; /* 112px에서 50% 추가하여 약 170px로 확대 */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.hint-box {
    background: rgba(30, 41, 59, 0.8);
    color: #fbbf24;
    border: 1px dashed #fbbf24;
    padding: 16px;
    border-radius: 12px;
    width: 92%;
    margin: 0 auto;
    text-align: center;
    font-size: 18px; /* 14px에서 18px로 확대 */
    font-weight: 700; /* 600에서 700으로 굵기 증가 */
    animation: fadeIn 0.4s ease;
}

.hint-label {
    font-weight: 800;
    margin-right: 8px;
    color: #fde68a; /* 라벨 색상도 연한 노란색으로 변경 */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   5. 입력 및 정답 선택 영역
   ========================================= */
.input-section {
    display: flex;
    gap: 10px;
    width: 92%;
    margin: 0 auto; /* 상단 여백 제거 */
    padding-top: 0;
}

#answer-input {
    flex: 1;
    height: 60px;
    padding: 16px 20px;
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 14px;
    color: #ffffff;
    font-size: 17px;
    font-weight: 600;
    outline: none;
    transition: all 0.2s;
}

#answer-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

#btn-submit {
    padding: 0 24px;
    height: 60px;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    font-size: 15px;
    transition: all 0.2s;
}

#btn-submit:hover {
    background: #4f46e5;
    transform: translateY(-2px);
}

.expert-feedback-text {
    text-align: center;
    color: #f87171; /* 오답 강조 컬러 */
    font-size: 15px;
    font-weight: 600;
    margin-top: 10px;
    margin-bottom: 10px;
    animation: fadeIn 0.3s ease;
}

/* 객관식 버튼 (2열 그리드) */
.choice-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 92%;
    margin: 0 auto; /* 상단 여백 제거 */
    padding-top: 0;
}

.choice-btn {
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 16px;
    padding: 20px;
    font-size: 17px; /* 15px -> 17px로 확대 */
    font-weight: 700;
    color: #f1f5f9;
    cursor: pointer;
    text-align: center;
    min-height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    word-break: break-all;
    line-height: 1.4;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.choice-btn:hover {
    border-color: #6366f1;
    background: #1e1b4b;
    transform: translateY(-3px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

.choice-btn:active {
    transform: scale(0.97);
}

.choice-btn.correct {
    background-color: #059669 !important; /* 초록색 */
    border-color: #059669 !important;
    color: white !important;
}

.choice-btn.wrong {
    background-color: #dc2626 !important; /* 빨간색 */
    border-color: #dc2626 !important;
    color: white !important;
}

.choice-btn.vibrate {
    animation: vibrate 0.4s ease-in-out;
}

@keyframes vibrate {
    0% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
    100% { transform: translateY(0); }
}

/* OX 퀴즈 버튼 (초보자 모드 선택 버튼과 동일한 스타일 적용) */
.ox-section {
    display: flex;
    gap: 15px; 
    justify-content: center;
    width: 92%; 
    margin: 0 auto; 
    padding-top: 0;
}

.ox-btn {
    width: 48%;
    min-height: 80px; /* 초보자 선택 버튼과 높이 통일 */
    border-radius: 16px; /* 테두리 둥글기 통일 */
    border: 2px solid #334155;
    font-size: 28px; 
    font-weight: 800;
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.ox-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

.ox-btn:active {
    transform: scale(0.97);
}

.btn-o {
    background-color: #2563eb; /* 파랑 */
    border-color: #3b82f6;
}

.btn-x {
    background-color: #dc2626; /* 빨강 */
    border-color: #ef4444;
}

.game-footer {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 15px; /* 버튼 사이 간격 추가 */
    width: 100%;
}

.game-action-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
}