.market-game-container {
    margin: 0 0 0 5px;
    padding: 20px;
    font-family: 'Noto Sans KR', sans-serif;
    text-align: left;
}

/* ===== 공통 카드 스타일 ===== */
.card-box {
    flex: 1;
    width: 50%;
    border: none;
    border-radius: 16px;
    padding: 28px 32px;
    background: linear-gradient(145deg, #ffffff, #f3f6fa);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12),
    0 3px 6px rgba(0, 0, 0, 0.08);
    background: linear-gradient(145deg, #f9fbff, #eef2f8);
}

/* ===== 제목 ===== */
.market-game-container h2 {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    margin-bottom: 20px;
    border-left: 5px solid #4a90e2;
    padding-left: 10px;
}

/* ===== 좌우 배치 ===== */
.market-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

/* ===== 종목 카드 ===== */
.stock-card .stock-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 17px;
    margin: 14px 0;
    line-height: 1.6;
}
.stock-card .stock-label {
    font-weight: 600;
    color: #555;
    min-width: 120px;
    text-align: left;
}
.stock-card .stock-value {
    flex: 1;
    text-align: right;
    color: #2563eb;
    font-weight: 600;
}

/* ===== 트레이드 패널 ===== */
.trade-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #222;
}
.trade-userbox {
    margin-bottom: 16px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 12px;
}
.trade-username {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 4px;
}
.trade-balance {
    font-size: 14px;
    color: #2563eb;
    font-weight: 500;
}

/* 포인트 입력 */
.trade-inputbox { margin-bottom: 16px; }
.trade-input {
    width: 100%;
    background: #f9fafb;
    border: 1px solid #cbd5e1;
    color: #222;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 15px;
    outline: none;
    transition: 0.2s;
}
.trade-input:focus {
    border-color: #4a90e2;
    background: #fff;
}

/* 상승 / 하락 버튼 */
.trade-btnbox {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.trade-up,
.trade-down {
    flex: 1;
    border: none;
    border-radius: 6px;
    padding: 10px 0;
    font-weight: 600;
    cursor: pointer;
    font-size: 15px;
    transition: 0.2s;
    color: #fff;
}
.trade-up { background: #16a34a; }
.trade-up:hover { background: #22c55e; }
.trade-down { background: #dc2626; }
.trade-down:hover { background: #ef4444; }

/* 금액 표시 */
.trade-amount {
    margin-top: 16px;
    font-size: 20px;
    font-weight: 700;
    text-align: right;
    color: #2563eb;
}

/* ===== 🌙 다크모드 ===== */
body.dark-mode .market-game-container {
    color: #f1f1f1;
}

/* 카드 공통 */
body.dark-mode .card-box {
    background: linear-gradient(145deg, #2a2a2a, #1e1e1e);
    border: 1px solid #333;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6),
    0 2px 4px rgba(0, 0, 0, 0.4);
}
body.dark-mode .card-box:hover {
    background: linear-gradient(145deg, #2f2f2f, #232323);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.7),
    0 3px 6px rgba(0, 0, 0, 0.5);
}

/* 텍스트 */
body.dark-mode .market-game-container h2 {
    color: #e4e4e4;
    border-left-color: #4a90e2;
}
body.dark-mode .stock-label,
body.dark-mode .trade-username { color: #ccc; }
body.dark-mode .stock-value,
body.dark-mode .trade-balance,
body.dark-mode .trade-amount { color: #6fa8ff; }

/* 입력 */
body.dark-mode .trade-input {
    background: #1e293b;
    border: 1px solid #334155;
    color: #f8fafc;
}
body.dark-mode .trade-input:focus {
    background: #273549;
    border-color: #60a5fa;
}

/* 버튼 */
body.dark-mode .trade-up { background: #15803d; }
body.dark-mode .trade-up:hover { background: #22c55e; }
body.dark-mode .trade-down { background: #b91c1c; }
body.dark-mode .trade-down:hover { background: #ef4444; }

.trade-preset {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.preset-btn {
    flex: 1;
    padding: 6px 0;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f1f5f9;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
}

.preset-btn:hover {
    background: #e2e8f0;
}

/* 다크모드 */
body.dark-mode .preset-btn {
    background: #1e293b;
    border: 1px solid #334155;
    color: #f8fafc;
}
body.dark-mode .preset-btn:hover {
    background: #334155;
}

/* 포인트 입력 + 버튼 그룹 */
.trade-inputbox {
    margin-bottom: 16px;
}

/* 포인트 입력칸 */
.trade-input {
    width: 100%;
    background: #f9fafb;
    border: 1px solid #cbd5e1;
    color: #222;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 15px;
    outline: none;
    transition: 0.2s;
    box-sizing: border-box;
}
.trade-input:focus {
    border-color: #4a90e2;
    background: #fff;
}

/* preset 버튼 영역 */
.trade-preset {
    margin-top: -7px;
    margin-bottom: 11px;
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* ✅ 입력칸과 동일폭에 5등분 */
    gap: 6px;
}

/* preset 버튼 */
.preset-btn {
    padding: 8px 0;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f1f5f9;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
    text-align: center;
}

.preset-btn:hover {
    background: #e2e8f0;
}

/* ✅ 다크모드 대응 */
body.dark-mode .preset-btn {
    background: #1e293b;
    border: 1px solid #334155;
    color: #f8fafc;
}
body.dark-mode .preset-btn:hover {
    background: #334155;
}

.trade-icon {
    width: 18px;
    height: 18px;
    margin-right: 6px;
    vertical-align: middle;
}

/* 버튼 안의 텍스트와 아이콘 정렬 */
.trade-up, .trade-down {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px; /* 아이콘과 글자 간격 */
}

.trade-guide strong {
    color: #2563eb;
    font-weight: 700;
}

/* 다크모드 강조 */
body.dark-mode .trade-guide strong {
    color: #60a5fa;
}

.tooltip {
    pointer-events: none;
    transition: opacity 0.2s;
}

body.dark-mode img.trade-icon,
body.dark-mode img[src$="경고.png"] {
    filter: brightness(0) invert(1);
}

body.dark-mode img.trade-icon,
body.dark-mode img[src$="상승.png"] {
    filter: brightness(0) invert(1);
}

body.dark-mode img.trade-icon,
body.dark-mode img[src$="하락.png"] {
    filter: brightness(0) invert(1);
}

/*모바일*/
@media screen and (max-width: 768px) {

    /* ✅ 컨테이너 전체 폭 맞춤 */
    .market-game-container {
        width: 100%;
        margin: 0;
        padding: 12px 10px 30px;
        box-sizing: border-box;
    }

    /* ✅ 좌우 배치 → 세로 배치 */
    .market-flex {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }

    /* ✅ 종목 카드 */
    .stock-card {
        width: 100%;
        box-sizing: border-box;
        padding: 16px 18px;
    }
    .stock-card .stock-info {
        font-size: 14px;
    }

    /* ✅ 트레이드 패널 */
    .trade-panel {
        width: 100%;
        box-sizing: border-box;
        padding: 16px;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    }
    body.dark-mode .trade-panel {
        background: #1e1e1e;
        border: 1px solid #333;
    }

    /* ✅ 입력칸 */
    .trade-input {
        font-size: 14px;
        padding: 8px 10px;
    }

    /* ✅ 버튼 그룹 */
    .trade-preset {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .trade-btnbox {
        flex-direction: column;
        gap: 10px;
    }

    /* ✅ 댓글 영역 */
    .comment-wrap {
        width: 100%;
        padding: 0 5px;
        box-sizing: border-box;
    }
    .comment-item {
        /*flex-direction: column;*/
        /*align-items: flex-start;*/
        /*width: 100%;*/
    }
    .comment-content {
        font-size: 14px;
        line-height: 1.5;
    }

    /* ✅ 그래프 반응형 */
    #bubbleArea svg {
        width: 100% !important;
        height: auto !important;
    }

    /* ✅ 폰트 & 간격 축소 */
    .market-game-container h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    .trade-guide ul li {
        font-size: 13px;
        line-height: 1.4;
    }
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
    justify-content: flex-start;
}

.comment-profile-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.nickname {
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.comment-date {
    font-size: 13px;
    color: #888;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .comment-header {
        gap: 6px;
        flex-wrap: nowrap;
    }

    .comment-profile-img {
        width: 24px;
        height: 24px;
    }

    .nickname {
        font-size: 13px;
        /*max-width: 50%;*/
    }

    .comment-date {
        font-size: 12px;
    }
}

