/* 5x5 스도쿠 게임 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Noto Sans KR', sans-serif;
}

:root {
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: rgba(0, 0, 0, 0.1);
    --primary-color: #6e8efb;
    --primary-hover: #5a7bf9;
    --primary-active: #486be7;
    --accent-color: #a777e3;
    --bg-gradient: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
    --glass-blur: blur(12px);
}

body {
    background: linear-gradient(135deg, #f5f9ff 0%, #f0eaff 100%);
    color: #333;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 배경 그래디언트 원 효과 */
body::before, body::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    z-index: -1;
}

body::before {
    background: radial-gradient(circle, rgba(110, 142, 251, 0.15) 0%, rgba(110, 142, 251, 0) 70%);
    top: -250px;
    left: -100px;
    animation: float 15s infinite alternate ease-in-out;
}

body::after {
    background: radial-gradient(circle, rgba(167, 119, 227, 0.15) 0%, rgba(167, 119, 227, 0) 70%);
    bottom: -250px;
    right: -100px;
    animation: float 20s infinite alternate-reverse ease-in-out;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

header {
    background: var(--bg-gradient);
    color: white;
    text-align: center;
    padding: 1.2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 10;
}

header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

header p {
    margin: 0.5rem 0 0;
    font-size: 1rem;
    opacity: 0.9;
}

.game-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem;
    margin: 2.5rem auto;
    max-width: 1200px;
    padding: 0 1.5rem;
    flex: 1;
    position: relative;
    z-index: 1;
}

/* 글래스모피즘 카드 기본 스타일 */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 var(--glass-shadow);
}

.sudoku-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 1.8rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.sudoku-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.sudoku-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 2px;
    background-color: #ddd;
    border: 2px solid #999;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.cell {
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 500;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.cell.given {
    font-weight: 700;
    color: var(--primary-color);
    cursor: not-allowed;
}

.cell.selected {
    box-shadow: inset 0 0 0 2px var(--primary-color);
}

.cell.error {
    color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.08) !important;
}

.cell.solution {
    color: #27ae60;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* 숫자 패드 그리드 레이아웃 */
.number-pad {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    width: 100%;
}

/* 포기 버튼 스타일 (그리드 아이템) */
.forfeit-btn {
    background: #e74c3c;
    color: white;
    font-weight: 600;
}

/* 모바일용 컨트롤 - 기본적으로 숨김 */
.mobile-controls {
    display: none;
    width: 100%;
    margin-top: 0.2rem;
    margin-bottom: 0.8rem;
}

/* 데스크톱용 컨트롤 */
.desktop-controls {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.number-pad {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-top: 10px;
}

@media (max-width: 480px) {
    .number-pad {
        grid-template-columns: repeat(6, 1fr);
    }
}

.number-btn {
    padding: 0.9rem 0;
    font-size: 1.3rem;
    font-weight: 600;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    color: #333;
    position: relative;
    overflow: hidden;
}

.number-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(110, 142, 251, 0.25);
    background: rgba(255, 255, 255, 0.7);
}

.number-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(110, 142, 251, 0.2);
    background: rgba(255, 255, 255, 0.9);
}

.number-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: all 0.6s ease;
}

.number-btn:hover::before {
    left: 100%;
}

.erase-btn {
    background: rgba(231, 76, 60, 0.15);
    color: #c0392b;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    grid-column: auto;
}

.erase-btn i {
    margin: 0 auto;
}

.erase-btn:hover {
    background: rgba(231, 76, 60, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.2);
}

.erase-btn::before {
    content: '\f55a';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 6px;
}

.message {
    margin-top: 0.6rem;
    padding: 1rem;
    text-align: center;
    min-height: 24px;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.3s ease;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.message.error {
    color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.message.success {
    color: #27ae60;
    background-color: rgba(39, 174, 96, 0.08);
    border: 1px solid rgba(39, 174, 96, 0.2);
}

.controls-container {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-panel {
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    padding: 1.4rem;
    transition: transform 0.3s ease;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
}

.info-panel:hover {
    transform: translateY(-3px);
}

.info-panel h3 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 8px;
}

.info-panel h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--bg-gradient);
    border-radius: 1.5px;
}

.info-panel p {
    margin: 0.8rem 0;
    font-size: 1rem;
    line-height: 1.5;
    color: #555;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin: 0.8rem 0;
    font-size: 1rem;
    padding: 8px 0;
    border-bottom: 1px solid rgba(240, 240, 240, 0.6);
}

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

.info-item span:first-child {
    color: #666;
}

.info-item span:last-child {
    font-weight: 600;
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.difficulty-selector {
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.difficulty-select {
    padding: 0.8rem;
    border: 1px solid rgba(110, 142, 251, 0.3);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    flex-grow: 1;
    appearance: none;
    background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236e8efb' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3'/%3E%3C/svg%3E") no-repeat;
    background-position: right 0.8rem center;
    background-color: rgba(255, 255, 255, 0.6);
    padding-right: 2rem;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.difficulty-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(110, 142, 251, 0.2);
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.btn {
    padding: 0.9rem;
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    letter-spacing: 0.5px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: all 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: rgba(110, 142, 251, 0.8);
    color: white;
    box-shadow: 0 8px 20px rgba(110, 142, 251, 0.3);
    border: 1px solid rgba(110, 142, 251, 0.4);
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(110, 142, 251, 0.4);
    background: rgba(110, 142, 251, 0.9);
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(110, 142, 251, 0.3);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.6);
    color: var(--primary-color);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.btn-secondary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

/* 아이콘 추가 */
.btn#new-puzzle-btn::before {
    font-family: 'Font Awesome 5 Free';
    content: '\f2f1';
    margin-right: 10px;
    position: static;
    background: none;
    width: auto;
    height: auto;
}

.btn#check-btn::before {
    font-family: 'Font Awesome 5 Free';
    content: '\f00c';
    margin-right: 10px;
    position: static;
    background: none;
    width: auto;
    height: auto;
}

.btn#show-solution-btn::before {
    font-family: 'Font Awesome 5 Free';
    content: '\f002';
    margin-right: 10px;
    position: static;
    background: none;
    width: auto;
    height: auto;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: all 0.6s ease;
}

.btn:hover::after {
    left: 100%;
}

footer {
    text-align: center;
    padding: 1.5rem;
    background-color: rgba(245, 245, 245, 0.8);
    color: #666;
    margin-top: auto;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 10;
}

/* 타이머 컨테이너 */
.timer-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    width: 100%;
    justify-content: center;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    flex-direction: row;
}

.timer-label {
    font-weight: 600;
    color: #666;
    white-space: nowrap;
}

.timer-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 70px;
    text-align: center;
    padding: 0.4rem 1rem;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.timer-toggle-btn {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 10px;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    background-color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.timer-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* Pause 상태일 때 (기본 상태) */
.timer-toggle-btn i.fa-pause {
    color: var(--primary-color);
}

/* Play 상태일 때 색상 강화 */
.timer-toggle-btn.play-state {
    background-color: var(--primary-color);
    color: white;
    border-color: transparent;
}

.timer-toggle-btn.play-state i {
    color: white;
}

/* 반응형 디자인 개선 */
@media (max-width: 1200px) {
    .game-container {
        max-width: 95%;
    }
}

/* 버튼 행 스타일 */
.button-row {
    display: flex;
    gap: 0.8rem;
    width: 100%;
}

.button-half {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        width: 100%;
        max-width: 100%;
        padding: 0 0.8rem;
        margin: 1.5rem auto;
    }
    
    .controls-container {
        width: 100%;
        max-width: 500px;
    }
    
    /* 모바일에서는 데스크톱 컨트롤 숨기고 모바일 컨트롤 표시 */
    .desktop-controls {
        display: none;
    }
    
    .mobile-controls {
        display: block;
    }
    
    .mobile-controls .controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }
    
    .mobile-controls .btn#mobile-show-solution-btn {
        grid-column: 1 / -1;
    }
    
    /* 게임 규칙은 모바일에서 간략하게 */
    .info-panel:nth-child(2) {
        display: none;
    }
    
    .sudoku-container {
        width: 100%;
        max-width: 500px;
        padding: 1.2rem;
    }
    
    .number-pad {
        grid-template-columns: repeat(6, 1fr);
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 0.9rem;
    }
}

@media (max-width: 600px) {
    .cell {
        width: calc(100vw / 6);
        height: calc(100vw / 6);
        max-width: 60px;
        max-height: 60px;
        min-width: 35px;
        min-height: 35px;
        font-size: 1.1rem;
    }
    
    .number-btn {
        padding: 0.7rem 0;
        font-size: 1.2rem;
    }
    
    .info-panel {
        padding: 1.2rem;
    }
    
    .info-panel h3 {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 0.8rem;
        font-size: 1rem;
    }
    
    .timer-container {
        flex-direction: row;
        gap: 10px;
        padding: 8px 12px;
    }
    
    .timer-value {
        font-size: 1.2rem;
        padding: 0.3rem 0.8rem;
    }
    
    .timer-toggle-btn {
        padding: 0.4rem 0.8rem;
    }
    
    .home-link {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .number-pad {
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
    }
    
    .number-btn {
        padding: 8px 0;
        font-size: 0.9rem;
    }
    
    .cell {
        font-size: 1rem;
        min-width: 30px;
        min-height: 30px;
    }
    
    .info-panel h3 {
        font-size: 1rem;
    }
    
    .info-item {
        font-size: 0.9rem;
    }
    
    body {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
}

/* 블록 경계 스타일 */
.border-top {
    border-top: 1px solid #000 !important;
}

.border-bottom {
    border-bottom: 1px solid #000 !important;
}

.border-left {
    border-left: 1px solid #000 !important;
}

.border-right {
    border-right: 1px solid #000 !important;
}

/* 전체 지우기 버튼 스타일 */
.clear-all-btn {
    background-color: #e74c3c; /* 빨간색 배경 */
    color: white;
    transition: all 0.3s ease;
}

.clear-all-btn:hover {
    background-color: #c0392b; /* 더 어두운 빨간색 */
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 2인용 경쟁 모드 타이머 및 패드 레이아웃 */
.timer-container-p1, .timer-container-p2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
/* 타이머바 (도화선) 스타일 */
.timer-bar {
    position: relative;
    width: 100%;
    height: 10px;
    margin: 0;
    background: #ddd !important;
    border-radius: 5px;
    overflow: hidden;
}
.timer-bar-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 그라디언트 배경으로 색상 이동 애니메이션 */
    background-image: linear-gradient(to right, #6e8efb, #f1c40f, #e74c3c);
    background-size: 200% 100%;
    background-position: 0 0;
    background-repeat: no-repeat;
}
.pad-p1, .pad-p2 {
    display: flex;
    justify-content: center;
    margin: 0 !important;
}
.number-pad button {
    margin: 0 0.2rem;
}

/* Retry 버튼 및 난이도 선택 인라인 수정 */
.difficulty-selector-2p {
    margin-bottom: 0.25rem !important;
}

/* 숫자 버튼 크기 확대 및 배치 */
.pad-p1 .number-pad,
.pad-p2 .number-pad {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}
.pad-p1 .number-btn,
.pad-p2 .number-btn {
    padding: 0.8rem 0;
    font-size: 1.5rem;
    min-width: 3rem;
    min-height: 3rem;
}

/* 1P 타이머 및 패드 영역 뒤집기 */
.timer-container-p1,
.pad-p1 {
    transform: rotate(180deg);
}

/* Retry 버튼과 난이도 셀렉터 inline 스타일 대체 */
#retry-btn {
    margin-left: 0.5rem;
}

/* 게임 오버 오버레이 */
.overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.overlay.hidden {
    display: none;
}
.overlay-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    max-width: 80%;
}
.overlay-text {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* 결과 강조 스타일 */
.result-highlight {
    color: var(--primary-color);
    font-weight: 700;
    display: block;
    margin-top: 0.5rem;
}

/* ===== 컴팩트 숫자 패드 오버라이드 시작 ===== */
.pad-p1.number-pad-container,
.pad-p2.number-pad-container {
    padding: 0;
    margin: 0;
    background: none;
    box-shadow: none;
}
.number-pad {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 4px !important;
    width: 100% !important;
    margin: 0;
}
.number-pad .number-btn {
    width: 100% !important;
    padding: 0.5rem 0 !important;
    font-size: 1.3rem !important;
    line-height: 1 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    margin: 0 !important;
}
/* 포기 버튼을 grid 아이템으로 처리 */
.number-pad .forfeit-btn {
    background: #e74c3c !important;
    color: white !important;
    font-weight: 600;
}
/* ===== 컴팩트 숫자 패드 오버라이드 끝 ===== */

/* 컴팩트 레이아웃 간격 조정 */
.difficulty-selector-2p {
    margin-bottom: 0.25rem !important;
}
.pad-p1.number-pad-container {
    margin-bottom: 1rem !important;
}
.pad-p2.number-pad-container {
    margin-top: 1rem !important;
}

/* 폭탄 도화선 애니메이션: 그라디언트 색상 이동 */
@keyframes fuse {
    from { background-position: 0 0; }
    to   { background-position: 100% 0; }
}

/* 타이머바와 타이머 컨테이너 사이 간격 */
.timer-bar + .timer-container-p1 {
    margin-top: 0.5rem;
}
.timer-container-p2 + .timer-bar {
    margin-top: 0.5rem;
}

/* 보드 회전 및 애니메이션 */
#sudoku-board {
    transition: transform 0.3s ease;
    transform-origin: center center;
    /* 초기 상태 유지 */
    transform: rotate(0deg);
}

#sudoku-board.rotated {
    transform: rotate(180deg) !important;
} 
/* 좁은 화면: 숫자 패드와 이모티콘을 두 줄로 (375px에서 가로 스크롤 방지) */
@media (max-width: 600px) {
    .pad-p1.number-pad-container,
    .pad-p2.number-pad-container {
        flex-wrap: wrap;
        justify-content: center;
        max-width: 100%;
    }
    .pad-p1 .number-pad,
    .pad-p2 .number-pad {
        flex: 1 1 100%;
    }
    .pad-p1 .number-btn,
    .pad-p2 .number-btn {
        min-width: 0;
    }
}

/* 좁은 화면: '내 기록' 상자가 제목을 가리지 않게 페이지 맨 아래 한 줄로 */
@media (max-width: 600px) {
    #stats-display {
        position: static !important;
        display: flex;
        flex-wrap: wrap;
        gap: 4px 12px;
        justify-content: center;
        margin: 12px auto 20px;
        width: max-content;
        max-width: calc(100% - 32px);
    }
    #stats-display > div:first-child { margin-bottom: 0 !important; }
}
