@font-face {
    font-family: 'GmarketSans';
    src: url('fonts/GmarketSansTTFLight.ttf') format('truetype');
    font-weight: 300; /* Light */
    font-style: normal;
}

@font-face {
    font-family: 'GmarketSans';
    src: url('fonts/GmarketSansTTFMedium.ttf') format('truetype');
    font-weight: 500; /* Medium */
    font-style: normal;
}

@font-face {
    font-family: 'GmarketSans';
    src: url('fonts/GmarketSansTTFBold.ttf') format('truetype');
    font-weight: 700; /* Bold */
    font-style: normal;
}

body {
    font-family: 'GmarketSans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500; /* 기본 폰트 두께를 Medium으로 설정 */
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 15px;
    font-size: 15px;
    box-sizing: border-box;
    overflow-y: scroll; 
}

/* --- 랜딩 페이지 스타일 --- */
#landing-page { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; width: 100%; height: 100vh; }
.landing-container { position: relative; display: inline-block; }
.logo-image { max-width: 300px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); display: block; }
#start-button { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); background-color: white; color: #FFC107; border: 2px solid #FFC107; padding: 6px 35px; font-size: 1.1em; font-weight: 700; border-radius: 8px; cursor: pointer; transition: all 0.3s; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); }
#start-button:hover { background-color: #FFF8E1; color: #FFB300; border-color: #FFB300; transform: translateX(-50%) translateY(-2px); }
#admin-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    cursor: pointer;
    padding: 0;
    font-size: 32px; /* 아이콘 크기 조절 */
    color: rgba(0, 0, 0, 0.4);
    transition: color 0.2s;
}
#admin-button:hover {
    color: rgba(0, 0, 0, 0.7);
}
#admin-button::before {
    content: '🔒'; /* 뚱뚱한 자물쇠 이모지 사용 */
    font-weight: 900;
}


/* --- 메인 앱 스타일 --- */
.container {
    background-color: #ffffff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    width: 386px; /* 가로 사이즈 고정 */
    height: 786px; /* 세로 사이즈 고정 */
    text-align: center;
    position: relative;
    overflow: auto; /* 내용이 길어지면 스크롤 생성 */
    display: flex;
    flex-direction: column;
}
.background-layer { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-image: url('background-pattern.png'); background-repeat: repeat; opacity: 1; z-index: 1; }
.content-layer { position: relative; z-index: 2; transition: min-height 0.3s ease; flex-grow: 1; display: flex; flex-direction: column; }
h1 { color: #FFC107; margin: 10px 0px 10px; font-size: 2.4em; font-weight: 700; }
.input-frame, .output-frame { border: 1px solid #dcdcdc; border-radius: 8px; padding: 8px; margin-bottom: 20px; background-color: #ffffff; }
h2 { color: #424242; margin-top: 0; margin-bottom: 15px; font-size: 1.2em; border-bottom: 2px solid #FFC107; padding-bottom: 5px; display: inline-block; font-weight: 700; }

/* --- 번호 생성기 탭 스타일 --- */
.controls-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
    row-gap: 5px;
    column-gap: 15px;
    margin: 5px 0px 5px;
}
.control-group { display: flex; flex-direction: row; align-items: center; gap: 5px; }
label { font-weight: 700; margin-bottom: 0; color: #555; white-space: nowrap; }
select, input[type="number"] { 
    width: 100%; 
    padding: 8px; 
    border: 1px solid #ccc; 
    border-radius: 6px; 
    font-size: 0.9em; 
    background-color: #f9f9f9; 
    transition: border-color 0.3s, box-shadow 0.3s; 
    font-family: 'GmarketSans', sans-serif;
}
select:focus, input[type="number"]:focus { outline: none; border-color: #FFC107; box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2); }
.generation-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin: 0px 0px 5px; }
.num-combinations-buttons {
    display: flex;
    gap: 5px;
}
.num-combo-btn {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    font-weight: 700;
    color: #555;
    transition: all 0.2s;
}
.num-combo-btn.active {
    background-color: #FFC107;
    border-color: #FFB300;
    color: #333;
    transform: scale(1.05);
}
#generate-button { background-color: #FFC107; color: #333; border: none; padding: 5px 8px; font-size: 1em; font-weight: 700; border-radius: 6px; cursor: pointer; transition: background-color 0.3s, transform 0.2s; margin-bottom: 0; }
#generate-button:hover { background-color: #FFB300; transform: translateY(-2px); }
#generate-button:disabled { background-color: #ccc; cursor: not-allowed; transform: none; }


/* '번호 생성기' 탭의 출력 UI 수정 */
#tab1 .output-frame {
    padding: 8px;
}
#output-text {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 4px;
    min-height: 150px;
    display: block;
}
.generated-combination-row {
    display: flex;
    flex-wrap: wrap;
    row-gap: 6px;
    column-gap: 10px;
    justify-content: flex-start;
}
.generated-combination-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    width: 100%;
}
.generated-combination-container .combination-header {
    font-weight: 700;
    text-align: left;
    font-size: 1.1em;
    color: #333;
    min-width: 25px;
}
/* '번호 생성기' 탭에서 재사용되는 확률 확인 UI 스타일 */
#tab1 .prob-output-frame {
    display: flex;
    flex-grow: 1;
    padding: 0;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    background-color: transparent;
}
#tab1 .prob-output-text {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    width: 100%;
    justify-content: center;
    padding: 2px;
}
#tab1 .prob-result-item {
    flex: 1;
    padding: 2px;
    gap: 4px;
    font-size: 0.8em;
}
#tab1 .prob-result-item .prob-num {
    font-size: 1.6em;
}
#tab1 .prob-result-item .prob-percent {
    font-size: 0.58em;
    color: #444;
}
#tab1 .prob-result-item .prob-class {
    font-size: 0.58em;
    padding: 2px 3px;
    color: #444;
}


.output-frame { display: flex; flex-direction: column; flex-grow: 1; }
.output-frame h2 {
    margin: 0px 0px 5px; 
    padding: 0px 0px 1px; 
}

/* --- 탭 공통 스타일 (책갈피 디자인) --- */
.tab-menu {
    display: flex;
    margin-bottom: 0;
    position: relative;
    z-index: 10;
}
.tab-button {
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.8em;
    font-weight: 700;
    color: #888;
    padding: 10px 5px;
    cursor: pointer;
    transition: all 0.2s;
    flex-grow: 1;
    border-radius: 8px 8px 0 0;
    margin-right: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tab-button:last-child {
    margin-right: 0;
}
.tab-button.active {
    background: transparent;
    border: none;
    color: #FFC107;
    transform: scale(1.05) translateY(1px);
}
.tab-content { 
    display: none; 
    flex-direction: column;
    flex-grow: 1; 
    border: none;
    box-shadow: none;
    border-radius: 0 8px 8px 8px;
    padding: 15px;
    background-color: transparent;
}
.tab-content.active { 
    display: flex;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

.settings-section { background: #f8f9fa; border-radius: 15px; padding: 8px 10px; margin-bottom: 10px; }
.stat-btn { padding: 3px 6px; font-size: 0.95em; border-radius: 8px; border: none; background: #FFC107; color: #333; cursor: pointer; margin-left: 10px; font-weight: 700; transition: background-color 0.3s, transform 0.1s; }
.stat-btn:hover { background: #FFB300; }
.stat-btn:disabled { background: #ccc; cursor: not-allowed; }
.stat-btn:active { transform: scale(0.95); }

/* --- 당첨 통계 조회 탭 스타일 --- */
.filter-controls-container { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; justify-content: center; flex-wrap: wrap; }
.rank-slider-container { flex-shrink: 0; width: 102px; }
.slider-labels { display: flex; justify-content: space-between; font-size: 0.8em; color: #555; padding: 0 5px; }
.rank-slider { width: 100%; -webkit-appearance: none; appearance: none; height: 8px; background: #fff; border: 1px solid #ddd; border-radius: 5px; outline: none; }
.rank-slider::-webkit-slider-runnable-track { width: 100%; height: 8px; cursor: pointer; background: linear-gradient(to right, #1E5631 var(--slider-progress, 100%), #fff var(--slider-progress, 100%)); border-radius: 5px; }
.rank-slider::-moz-range-track { width: 100%; height: 8px; cursor: pointer; background: linear-gradient(to right, #1E5631 var(--slider-progress, 100%), #fff var(--slider-progress, 100%)); border-radius: 5px; }
.rank-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; background: #fff; border-radius: 50%; cursor: pointer; border: 2px solid #1E5631; box-shadow: 0 0 5px rgba(0,0,0,0.2); margin-top: -6px; }
.rank-slider::-moz-range-thumb { width: 14px; height: 14px; background: #fff; border-radius: 50%; cursor: pointer; border: 2px solid #1E5631; box-shadow: 0 0 5px rgba(0,0,0,0.2); }
.pause-checkbox-label { display: flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; font-size: 0.9em; }
.pause-checkbox-label:has(input:disabled) { color: #ccc; cursor: not-allowed; }
.lotto-stats-container { display: flex; flex-direction: column; gap: 5px; margin-bottom: 5px; }

.game-area { display: flex; flex-direction: column; gap: 5px; }
.game-boards-container { display: flex; flex-direction: column; gap: 5px; align-items: center; }
.result-windows-container { display: flex; flex-direction: column; gap: 5px; align-items: center; }
.lotto-game, .lotto-game-placeholder { min-width: 0; width: 312px; height: 75px; }
.lotto-game { position: relative; background: #fff; border: 2px solid #e53935; border-radius: 16px; box-shadow: 0 2px 8px rgba(229,57,53,0.08); padding: 4px; display: flex; flex-direction: column; align-items: center; transition: box-shadow 0.2s, border-color 0.2s; }
.lotto-game.selected {
    border-color: #c62828;
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.2);
}
.remove-game-btn {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 12px;
    height: 12px;
    background-color: #ffffff;
    color: #e53935;
    border: 1px solid #e53935;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 900;
    line-height: 10px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: all 0.2s;
    padding: 1px 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.remove-game-btn:hover {
    background-color: #e53935;
    color: #ffffff;
    transform: scale(1.1);
}

.lotto-game-placeholder {
    display: flex;
    border: 2px dashed #ccc;
    border-radius: 16px;
    padding: 4px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(229,57,53,0.08);
}
.add-game-style {
    width: 100%;
    height: 100%;
    border: none;
    color: #aaa;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    letter-spacing: -2px;
}
.add-game-style:hover {
    background-color: #f9f9f9;
    color: #888;
}

.stat-detail-result { width: 312px; height: 100px; border: 1px solid #e0e0e0; border-radius: 8px; padding: 5px; text-align: left; background: #fff; font-size: 0.85em; overflow-y: auto; }

.stat-detail-result ul { list-style-type: none; padding-left: 0; margin: 0; }
.stat-detail-result li { background: #f9f9f9; padding: 2px 6px; margin-bottom: 3px; border-radius: 4px; border-left: 3px solid; white-space: nowrap; }
.stat-detail-result li:last-child { margin-bottom: 0; }
.stat-detail-result .partition-1 { border-color: #ffd700; }
.stat-detail-result .partition-2 { border-color: #c0c0c0; }
.stat-detail-result .partition-3 { border-color: #cd7f32; }
.stat-detail-result .partition-4 { border-color: #87ceeb; }
.lotto-game-header {
    color: #e53935;
    font-weight: 700;
    font-size: 0.9em;
    margin-bottom: 8px;
    letter-spacing: 1px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.lotto-game-header > div {
    display: flex;
    align-items: center;
    gap: 4px;
}
#probDisplayA, #probDisplayB {
    font-weight: 500;
    font-size: 0.7em;
}
#probDisplayA strong, #probDisplayB strong {
    font-weight: 700;
}
.lotto-auto-btn { margin-left: 4px; padding: 1px; border-radius: 6px; border: 1px solid #e57373; background: #fff3f3; color: #e53935; font-size: 0.7em; font-weight: 700; cursor: pointer; transition: background 0.2s, color 0.2s, transform 0.1s; }
.lotto-auto-btn:hover { background: #e53935; color: #fff; }
.lotto-auto-btn:active { transform: scale(0.95); }
.lotto-prob-check-btn { 
    margin-left: 4px; 
    padding: 1px; 
    border-radius: 6px; 
    border: 1px solid #e57373; 
    background: #fff3f3; 
    color: #e53935; 
    font-size: 0.7em; 
    font-weight: 700; 
    cursor: pointer; 
    transition: background 0.2s, color 0.2s, transform 0.1s; 
    display: none;
}
.lotto-prob-check-btn:hover { background: #e53935; color: #fff; }
.lotto-prob-check-btn:active { transform: scale(0.95); }
.lotto-grid-wrapper { display: flex; flex-direction: column; justify-content: center; flex-grow: 1; }
.lotto-game-grid { display: grid; grid-template-columns: repeat(15, 1fr); gap: 4px; width: 100%; }
#lottoGameA_row1, #lottoGameB_row1, #lottoGameA_row2, #lottoGameB_row2, #lottoGameProb_row1, #lottoGameProb_row2 { margin-bottom: 4px; }

.lotto-num {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    height: 14px;
}

.lotto-num span {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 15px;
    height: 15px;
    background: #fff3f3;
    color: #e53935;
    border-radius: 40%;
    font-weight: 700;
    font-size: 0.6em;
    border: 1px solid transparent;
    transition: background 0.2s, color 0.2s, border 0.2s;
}

.lotto-num.selected span {
    background: #e53935;
    color: #fff;
    border: 1px inset #b71c1c;
}

.lotto-num.locked span {
    background: #b71c1c;
    color: #fff;
    border: 1px solid #7f0000;
}
.lotto-num.locked span::after {
    content: '';
    position: absolute;
    width: 9px;
    height: 9px;
    right: -1px;
    bottom: -1px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff' stroke='%23ffffff' stroke-width='1'%3E%3Cpath d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.lotto-num.disabled span {
    background: #fff;
    color: #fff;
}

.lotto-num.disabled {
    cursor: not-allowed;
}

.stat-buttons-container { display: flex; justify-content: center; align-items: center; text-align: center; }
#auto-gen-counter {
    display: inline-block;
    padding: 2px 3px;
    font-size: 0.85em;
    border-radius: 8px;
    border: none;
    background: #f0d78e;
    color: #333;
    margin-left: 12px;
    font-weight: 700;
    min-width: 70px;
    text-align: center;
    box-sizing: border-box;
}
.non-winning-num { font-size: 0.8em; color: #aaa; }

/* --- [신규] 회차별 당첨 번호 조회 스타일 --- */
#round-lookup-container {
    margin-top: 15px;
    padding: 12px;
}
#round-lookup-container h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #424242;
    padding-bottom: 5px;
    border-bottom: 2px solid #FFC107;
    display: inline-block;
}
.round-lookup-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}
.round-lookup-controls input[type="number"] {
    flex-grow: 1;
    text-align: center;
}
/* Chrome, Safari, Edge, Opera에서 숫자 입력 화살표 숨기기 */
.round-lookup-controls input::-webkit-outer-spin-button,
.round-lookup-controls input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
/* Firefox에서 숫자 입력 화살표 숨기기 */
.round-lookup-controls input[type=number] {
  -moz-appearance: textfield;
}
.round-lookup-controls .stat-btn {
    flex-shrink: 0;
    margin-left: 0;
}
#round-result-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    min-height: 40px;
    background-color: #fff;
    border-radius: 8px;
    padding: 8px;
    border: 1px solid #e0e0e0;
}
.winning-num-ball {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: 700;
    font-size: 0.9em;
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.2);
}
.bonus-num-ball {
    background-color: #757575; /* 보너스 번호 색상 */
}
.plus-symbol {
    font-size: 1.5em;
    font-weight: 700;
    color: #888;
}

/* --- 고급 설정 탭 스타일 --- */
.adv-settings-container { display: flex; flex-direction: column; gap: 10px; padding: 15px; background: #f8f9fa; border-radius: 8px; text-align: left; }
.setting-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.setting-item label { flex-grow: 1; text-align: left; }
.setting-item .adv-checkbox, .setting-item .adv-select, .setting-item .adv-radio-group { flex-shrink: 0; }
.adv-checkbox { width: 20px; height: 20px; cursor: pointer; }
.adv-select { padding: 8px; border-radius: 6px; border: 1px solid #ccc; background-color: #fff; }
#min-appearance-select { width: 110px; }
.adv-radio-group { display: flex; gap: 10px; }
.adv-radio-group input[type="radio"] { display: none; }

.adv-radio-group label {
    padding: 4px 7px;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    flex: 1;
    text-align: center;
    font-weight: 700;
    color: #888;
}

.adv-radio-group input[type="radio"]:checked + label {
    background-color: #FFC107;
    border-color: #FFB300;
    color: #333;
}

/* --- 고급 설정 드롭다운 스타일 --- */
.adv-dropdown-container {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 10px;
}
.adv-dropdown-container:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}
.adv-dropdown-button {
    background-color: #fff;
    color: #424242;
    padding: 8px 15px;
    font-size: 1em;
    font-weight: 700;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background-color 0.3s, transform 0.1s;
    margin-bottom: 10px;
}
.adv-dropdown-button:hover {
    background-color: #f8f9fa;
}
.adv-dropdown-button:active { transform: scale(0.98); }
.adv-dropdown-content {
    display: none;
    padding: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9em;
    color: #555;
    line-height: 1.6;
    width: 100%; 
    box-sizing: border-box;
    display: none;
    flex-direction: column;
    gap: 15px;
}
.adv-dropdown-content.show {
    display: flex;
}
.adv-dropdown-content ul {
    padding-left: 20px;
    margin: 0;
}
.adv-dropdown-content li strong {
    color: #333;
}
.adv-dropdown-content .setting-item {
    border-bottom: none;
    padding-bottom: 0;
}

.help-text {
    font-size: 0.8em;
    color: #e53935;
    line-height: 1.2;
    text-align: left;
    padding: 0 5px;
    margin-top: -10px;
}


/* --- 커뮤니티 탭 스타일 --- */
#tab5 .input-frame,
#tab5 .output-frame {
    padding: 5px;
}
#tab5 .output-frame {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.community-post-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.nickname-wrapper { display: flex; align-items: center; gap: 8px; width: 100%; }
.nickname-wrapper label { font-weight: 700; }
#nickname-input { width: 30%; padding: 8px; border: 1px solid #ccc; border-radius: 6px; }
#nickname-input:read-only { background-color: #e9ecef; cursor: not-allowed; }
#community-text { width: 100%; resize: vertical; box-sizing: border-box; padding: 10px; border: 1px solid #ccc; border-radius: 6px; }
.community-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; width: 100%; }
.image-upload-wrapper { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.image-upload-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.image-upload-btn { background-color: #FFC107; color: #333; padding: 4px 10px; border-radius: 6px; cursor: pointer; transition: background-color 0.2s, transform 0.1s; border: none; }
.image-upload-btn:hover { background-color: #FFB300; }
.image-upload-btn:active { transform: scale(0.95); }
.image-upload-btn.uploaded { background-color: #e9ecef; color: #495057; }
.image-upload-btn.uploaded:hover { background-color: #dee2e6; }
.image-upload-input { display: none; }
.image-name { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#char-counter { text-align: right; color: #888; }
#post-button { background-color: #FFC107; color: #333; border: none; padding: 6px 20px; font-weight: 700; border-radius: 6px; cursor: pointer; transition: background-color 0.3s, transform 0.1s; margin-left: auto; }
#post-button:hover { background-color: #FFB300; }
#post-button:disabled { background-color: #ccc; cursor: not-allowed; }
#post-button:active { transform: scale(0.95); }
#community-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1px;
    min-height: 150px;
    text-align: left;
    flex-grow: 1; 
}
.community-post {
    background-color: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    width: 100%;
    box-sizing: border-box;
    font-size: 0.75em;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.post-left {
    flex: 0 0 90px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background-color: #f0f0f0;
    padding: 5px;
    border-radius: 5px;
}
.post-right {
    flex: 1;
    min-width: 0;
}
.post-author {
    margin: 0;
    color: #555;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}
.post-meta {
    font-size: 0.8em;
    color: #999;
    white-space: nowrap;
}
.post-text {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-all; 
    text-align: left;
}
.view-image-btn {
    padding: 1px 5px;
    font-size: 0.9em;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #f0f0f0;
    cursor: pointer;
    margin-top: 2px;
    transition: transform 0.1s;
}
.view-image-btn:active { transform: scale(0.95); }

#pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 2px 0px 0px;
}
.page-btn {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 1px 4px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.2s, color 0.2s, transform 0.1s;
    font-size: 0.7em;
}
.page-btn:hover {
    background-color: #f0f0f0;
}
.page-btn.active {
    background-color: #FFC107;
    color: #333;
    border-color: #FFB300;
}
.page-btn:disabled {
    background-color: #e9ecef;
    color: #aaa;
    cursor: not-allowed;
}
.page-btn:active { transform: scale(0.95); }

/* --- 이미지 팝업 스타일 --- */
.image-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.image-popup-content {
    position: relative;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
}
.image-popup-content img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
}
.close-popup-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid #ccc;
}

/* --- 번호 분석기 탭 스타일 --- */
#tab3.active {
    align-items: center;
    width: 100%;
}
#tab3.active h2 { 
    color: white; 
}

#tab3 .lotto-game {
    margin-bottom: 8px; 
}
.prob-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 12px;
}
#tab3 .prob-output-frame,
#analysis-result-container {
    width: 312px;
    box-sizing: border-box;
}
.prob-output-frame {
    display: none;
    background-color: #ffffff;
    border: none;
    padding: 4px;
    margin-top: 6px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
#prob-check-output-text {
    display: flex;
    flex-wrap: nowrap;
    gap: 9px;
    width: 100%;
    text-align: center;
    justify-content: center;
}
.prob-result-item {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85em;
    align-items: center;
    justify-content: space-around;
    transition: all 0.2s;
    flex: 1 1 0;
    cursor: pointer;
}
.prob-result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.prob-result-item.high { 
    background-image: linear-gradient(to bottom right, #ffffff, #f28b82); 
}
.prob-result-item.low { 
    background-image: linear-gradient(to bottom right, #ffffff, #a8c0ff); 
}
.prob-result-item.random { 
    background-image: linear-gradient(to bottom right, #ffffff, #b7e1cd); 
}
.prob-result-item.neutral {
    background-image: linear-gradient(to bottom right, #ffffff, #e0e0e0);
}

.prob-result-item * {
    color: #333 !important;
}

.prob-result-item .prob-num {
    font-weight: 700;
    font-size: 1.6em;
}
.prob-result-item .prob-percent {
    font-weight: 700;
    font-size: 0.8em;
}
.prob-result-item .prob-class {
    font-size: 0.8em;
    font-weight: 700;
    padding: 2px 3px;
    text-align: center;
    border-radius: 4px;
    width: 80%;
    background-color: rgba(255, 255, 255, 0.829);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* 번호 분석기 심층 분석 스타일 */
#analysis-section {
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.analysis-actions-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 0;
}
#run-analysis-btn {
    margin: 10px 0px 0px 10px;
}
#fill-numbers-btn {
    margin: 10px 0px 0px 10px;
}
#analysis-result-container {
    margin: 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.analysis-summary {
    font-size: 0.9em;
    color: #555;
    margin: 0;
    font-weight: 700;
}
.analysis-result-display {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}
.analysis-result-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    width: 100%;
}
.analysis-result-display .prob-result-item {
    padding-top: 2px;
    padding-bottom: 2px;
    gap: 4px;
    flex: 1 1 0;
}
.analysis-result-display .prob-result-item .prob-num {
    font-size: 1.5em;
}

.prob-result-item.selected-for-analysis,
.prob-result-item.selected-from-result {
    box-shadow: inset 0 0 0 2px #FFC107, 0 0 8px rgba(255, 193, 7, 0.5);
    transform: scale(1);
}


/* --- 미디어 쿼리 (반응형) --- */
@media (max-width: 640px) {
    .container { padding: 10px; }
    h1 { font-size: 2em; } 
    .tab-button { font-size: 0.75em; padding: 10px 1px; }
    .setting-item { flex-direction: column; align-items: flex-start; gap: 10px; }
    .setting-item-inline { flex-direction: row; align-items: center; }
}

@media (max-width: 480px) {
    .controls-grid { grid-template-columns: repeat(2, 1fr); }
    .community-actions { flex-direction: column; gap: 10px; align-items: flex-end; }
}

/* 툴팁 아이콘 스타일 추가 */
.tooltip-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: #e0e0e0;
    color: #555;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
    line-height: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-left: 4px;
}