* { margin:0; padding:0; box-sizing:border-box; }
html, body { width:100%; height:100%; }
body {
    font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    font-size: 16px;
    color: #fff;
    line-height: 18px;
    background: #171a1c;
    user-select: none;
    -webkit-user-select: none;
}
ul, ol, li { list-style: none; }
button { font-family: inherit; outline: none; cursor: pointer; }
input { font-family: inherit; outline: none; }
.clear:after { content:" "; display:block; clear:both; height:0; visibility:hidden; }

/* Header */
#game-header { height: 82px; padding-top: 20px; }
.hash_line { position: relative; height: 16px; }
.hash_line span { display: inline-block; font-weight: 500; color: #d4d4d4; line-height: 16px; }
.hash_line .game_id .r_num { color: #727577; }
.hash_line .hash {
    position: absolute; top: 0; left: 17%; width: 60%; padding-left: 7%;
}
.hash_line .hash .tit { position: absolute; top: 0; left: 15px; }
.hash_line .hash .hash_result {
    overflow: hidden; width: 100%; padding-left: 20px;
    text-overflow: ellipsis; white-space: nowrap; color: #727577; cursor: pointer;
}
.hash_line .limit_money {
    position: absolute; top: -8px; right: 0; z-index: 991;
    padding: 8px 0 8px 29px; cursor: pointer;
    background: url(../images/ico_max.png) no-repeat 0 50%;
}
.hash_line .limit_money .money { color: #727577; }
.hash_line .limit_money .pop_max {
    display: none; position: absolute; top: 25px; right: 0; z-index: 9999;
    width: 222px; padding: 15px 20px;
    background: #191919; border: 1px solid #3f4040;
}
.hash_line .limit_money:hover .pop_max { display: block; }
.hash_line .limit_money .pop_max dl { display: flex; }
.hash_line .limit_money .pop_max dt {
    width: 60px; font-size: 14px; font-weight: 400; color: #fff; line-height: 18px;
}
.hash_line .limit_money .pop_max dd {
    width: calc(100% - 60px); font-size: 14px; font-weight: 400;
    color: #f4cd1a; line-height: 18px; white-space: nowrap;
}
.time_line { position: relative; width: 100%; height: 37px; margin-top: 9px; padding: 0 110px 0 0; }
.time_line > div { position: relative; width: 100%; height: 27px; background: #000; border: 1px solid #666; text-align: center; overflow: hidden; }
.time_line > div #status { display: inline-block; position: relative; z-index: 10; font-size: 13px; color: #fff; line-height: 25px; }
.time_line > div .time_bar { position: absolute; top: -1px; left: -1px; height: 27px; background: #db0d18; transition: width 0.1s linear; }
.time_line .graph_sound {
    position: absolute; right: 5px; top: 0; width: 22px; height: 27px;
    background: none; border: none; font-size: 18px; line-height: 27px; color: #888; cursor: pointer;
}

/* Main Layout */
#main-layout {
    position: absolute; top: 82px; bottom: 0; left: 0; right: 0;
    display: flex;
}
#left-col {
    width: 640px; min-width: 640px;
    height: 100%; overflow: hidden;
    display: flex; flex-direction: column;
}
#right-col {
    flex: 1; min-width: 280px;
    background: #1c1f23;
    display: flex; flex-direction: column;
}
#right-col .game_tit { overflow: hidden; }
#right-col .game_tit dt {
    float: left; width: 40%; height: 41px; padding-left: 15px;
    border-bottom: 2px solid #22272b; background: #1c1f23;
    color: #ccc; line-height: 39px;
}
#right-col .game_tit dd {
    float: left; width: 20%; height: 41px;
    border-bottom: 2px solid #22272b; background: #1c1f23;
    color: #ccc; line-height: 39px; text-align: center;
}
#right-col .game_tit dd.bet_money { width: 40%; }
#right-col .game_list_wrap { flex: 1; overflow-y: auto; }
#right-col .game_list_wrap::-webkit-scrollbar { width: 6px; }
#right-col .game_list_wrap::-webkit-scrollbar-track { background: transparent; }
#right-col .game_list_wrap::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
#right-col .game_list_wrap:hover::-webkit-scrollbar-thumb { background: #444; }
#right-col .list_area dl { overflow: hidden; }
#right-col .list_area dt {
    float: left; clear: left; overflow: hidden; width: 40%; height: 40px;
    padding-left: 15px; border-bottom: 1px solid #22272b;
    background: #1c1f23; color: #ccc; line-height: 39px;
    white-space: nowrap; text-overflow: ellipsis;
}
#right-col .list_area dd {
    overflow: hidden; float: left; width: 20%; height: 40px;
    border-bottom: 1px solid #22272b;
    background: #1c1f23; color: #ccc; line-height: 39px;
    text-align: center; white-space: nowrap; text-overflow: ellipsis;
}
#right-col .list_area dd.bet_money {
    width: 40%; padding-right: 15px; text-align: right;
}
#right-col .list_area dl:nth-of-type(even) dt,
#right-col .list_area dl:nth-of-type(even) dd { background: #1f2427; }
#right-col .list_area .green dt,
#right-col .list_area .green dd { color: #81bf39; }
#right-col .list_area .red dt,
#right-col .list_area .red dd { color: #ed3327; }

/* History Bar */
.game_history {
    width: 100%; height: 66px; padding: 6px 0;
    background: #323336; border: 1px solid #383d43;
    text-align: center; overflow: hidden;
}
.game_history_list {
    height: 52px; display: inline-flex; float: left;
    flex-wrap: wrap; overflow: hidden; width: auto;
}
.game_history_list li {
    display: inline-block; position: relative;
    width: 36px; height: 52px; margin-left: 6px; padding-top: 3px;
    background: #fff; border-radius: 2px; text-align: center;
    transition: 400ms all;
}
.game_history_list li:first-child { margin-left: 0; }
.game_history_list li span { display: block; font-size: 30px; font-weight: bold; line-height: 20px; }
.game_history_list li span:first-child {
    display: inline-block; width: 14px; height: 17px; line-height: 17px;
    text-indent: -9999px;
}
.game_history_list li .ico_his_c { background: url(../images/ico_his_c.png) no-repeat 50% 2px; }
.game_history_list li .ico_his_d { background: url(../images/ico_his_d.png) no-repeat 50% 0; }
.game_history_list li .ico_his_h { background: url(../images/ico_his_h.png) no-repeat 50% 2px; }
.game_history_list li .ico_his_s { background: url(../images/ico_his_s.png) no-repeat 50% 2px; }
.game_history_list li.red { color: #b42b2d; }
.game_history_list li.black { color: #252424; }
.game_history_list li.joker {
    background: url(../images/ico_joker_s.png) no-repeat 50% 50%;
    background-color: #45b5da; text-indent: -9999px;
}
.game_history_list li.high:before {
    content: ""; position: absolute; top: 50%; right: -13px;
    z-index: 10; width: 20px; height: 20px; margin-top: -10px;
    background: url(../images/ico_high.png) no-repeat 0 0;
}
.game_history_list li.low:before {
    content: ""; position: absolute; top: 50%; right: -13px;
    z-index: 10; width: 20px; height: 20px; margin-top: -10px;
    background: url(../images/ico_low.png) no-repeat 0 0;
}
.game_history_list li.mid:before {
    content: ""; position: absolute; top: 50%; right: -13px;
    z-index: 10; width: 20px; height: 20px; margin-top: -10px;
    background: url(../images/ico_mid.png) no-repeat 0 0;
}

/* Card Area */
.hilo_card_wrap { position: relative; width: 100%; height: 312px; margin-top: 10px; }
.card_wrap {
    position: absolute; top: 0; left: 50%; width: 200px; height: 312px;
    margin-left: -100px; perspective: 800px;
}
.card_inner {
    position: relative; width: 200px; height: 307px;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}
.card_inner.flipped { transform: rotateY(180deg); }

/* 카드 오픈 애니메이션: 오른쪽으로 열리며 공개 */
.card_inner.card-opening {
    animation: cardOpenRight 0.7s ease-out forwards;
}
@keyframes cardOpenRight {
    0% {
        transform: rotateY(0deg) scale(1);
    }
    30% {
        transform: rotateY(-20deg) scale(1.03);
    }
    100% {
        transform: rotateY(180deg) scale(1);
    }
}

/* 다음 라운드 시 카드 축소 후 사라짐 */
.card_inner.slide-to-history {
    transition: all 0.4s ease-in;
    transform: rotateY(180deg) scale(0.3);
    opacity: 0;
}
.card_face {
    position: absolute; top: 0; left: 0; width: 200px; height: 307px;
    backface-visibility: hidden; border-radius: 10px;
    font-weight: bold;
    overflow: hidden;
}

/* Card Front (back of card - face down) */
.card_front {
    background: #1a5276;
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.03) 10px, rgba(255,255,255,0.03) 20px),
        repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,0.03) 10px, rgba(255,255,255,0.03) 20px);
    border: 3px solid #2c3e50;
    display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.card_front .card-front-pattern { font-size: 60px; color: #45b5da; opacity: 0.3; }
.card_front .card-front-text { font-size: 16px; color: #45b5da; margin-top: 10px; }

/* Card Back (face up - actual card) */
.card_back {
    transform: rotateY(180deg);
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.15);
}

/* Corner - Top Left */
.card-top-left {
    position: absolute; top: 10px; left: 12px;
    text-align: center; line-height: 1;
}
.card-top-left .card-corner-number {
    display: block; font-size: 40px; font-weight: 800; line-height: 1;
}
.card-top-left .card-corner-suit {
    display: block; font-size: 36px; line-height: 1; margin-top: 4px;
}

/* Corner - Bottom Right (upside down) */
.card-bottom-right {
    position: absolute; bottom: 10px; right: 12px;
    text-align: center; line-height: 1;
    transform: rotate(180deg);
}
.card-bottom-right .card-corner-number {
    display: block; font-size: 40px; font-weight: 800; line-height: 1;
}
.card-bottom-right .card-corner-suit {
    display: block; font-size: 36px; line-height: 1; margin-top: 4px;
}

/* Center Suit */
.card-center-suit {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 70px; line-height: 1;
}

/* Suit colors */
.card_back.suit-heart, .card_back.suit-diamond { color: #b42b2d; }
.card_back.suit-spade, .card_back.suit-clover { color: #2d2d2d; }

/* Joker card */
.card_back.suit-joker {
    background: linear-gradient(160deg, #e8f4f8 0%, #d4eef7 50%, #b8e2f0 100%);
    color: #1a8bb3; border: 1px solid #89c4dc;
}
.card_back.suit-joker .card-center-suit { font-size: 50px; }
.card_back.suit-joker .card-top-left .card-corner-number,
.card_back.suit-joker .card-bottom-right .card-corner-number { font-size: 16px; }
.card_back.suit-joker .card-top-left .card-corner-suit,
.card_back.suit-joker .card-bottom-right .card-corner-suit { font-size: 14px; }

/* Buttons */
.btn_wrap { position: relative; }
.btn_wrap .left_area { float: left; width: 31.875%; }
.btn_wrap .right_area { float: right; width: 31.875%; }
.btn_wrap .left_area .inner_btn_wrap { width: 100%; height: 152px; margin-top: 8px; }
.btn_wrap .left_area div:first-child { margin-top: 0; }
.btn_wrap .right_area .inner_btn_wrap { float: left; width: 49%; height: 100px; margin-left: 2%; margin-top: 6px; }
.btn_wrap .right_area .inner_btn_wrap.w_100 { width: 100%; }
.btn_wrap .right_area div:nth-child(2n+1) { margin-left: 0; }
.btn_wrap .right_area div:first-child,
.btn_wrap .right_area div:nth-child(2) { margin-top: 0; }

.btn_wrap button {
    display: block; position: relative; width: 100%; height: 100%;
    border: 2px solid; border-radius: 5px;
    box-shadow: 0px 4px 9px 0px rgba(0,0,0,1);
    transition: all 0.2s;
}
.btn_wrap button:hover { filter: brightness(1.15); }
.btn_wrap button:active { transform: scale(0.97); }

.btn_action_high {
    background: #ceb56d url('../images/bg_btn_high.png') no-repeat center center;
    background-size: cover;
    border-color: #ceb56d !important;
    border-top-color: #d8c48a !important;
}
.btn_action_low {
    background: #50505d url('../images/bg_btn_low.png') no-repeat center center;
    background-size: cover;
    border-color: #50505d !important;
    border-top-color: #73737d !important;
}
.btn_wrap .left_area button span {
    display: block; width: 100%; position: absolute;
    font-weight: bold; text-align: center;
}
.btn_wrap .left_area button .btn_tit_1 { top: 30px; font-size: 25px; line-height: 25px; }
.btn_wrap .left_area button .btn_tit_2 { top: 60px; font-size: 17px; line-height: 17px; }
.btn_wrap .left_area button .btn_tit_3 { top: 85px; font-size: 17px; color: #fff; line-height: 17px; }
.btn_action_high .btn_tit_1 { color: #191919; }
.btn_action_high .btn_tit_2 { color: #322f30; }
.btn_action_low .btn_tit_1 { color: #e0bf61; }
.btn_action_low .btn_tit_2 { color: #e0bf61; }
.btn_wrap .left_area .btn_action_low .btn_tit_1 { top: 28px; }
.btn_wrap .left_area .btn_action_low .btn_tit_2 { top: 58px; }
.btn_wrap .left_area .btn_action_low .btn_tit_3 { top: 82px; }

.btn_wrap .right_area button {
    background-color: #454648; border-color: #454648 !important;
    border-top-color: #6a6b6d !important;
}
.btn_wrap .right_area button span {
    display: block; width: 100%; position: absolute;
    font-size: 14px; font-weight: bold; color: #fff; text-align: center;
}
.btn_wrap .right_area button .btn_tit_1 { top: 26px; font-size: 18px; line-height: 24px; }
.btn_wrap .right_area button .btn_tit_2 { top: 50px; font-size: 17px; line-height: 17px; }
.btn_wrap .right_area .btn_red .btn_tit_1 { color: #e94237; }
.btn_wrap .right_area .btn_green .btn_tit_1 { color: #81bf39; }
.btn_wrap .right_area .btn_joker .btn_tit_1 { color: #45b5da; }

.btn_wrap button .bet_money {
    top: 72px; font-size: 14px !important; color: #fffc01 !important;
}
.btn_wrap .btn_action_high .bet_money { top: 110px; }
.btn_wrap .btn_action_low .bet_money { top: 108px; }

.btn_wrap button.btn_disabled {
    opacity: 0.4; cursor: not-allowed; pointer-events: none;
}
.btn_wrap button.result_win { border-color: #ab3730 !important; }
.btn_wrap button.result_win:before { content: ""; display: none; }
.btn_wrap button.result_lose:before {
    content: ""; position: absolute; top: -2px; left: -2px; z-index: 100;
    width: calc(100% + 4px); height: 106%;
    background: rgba(0,0,0,0.57); border-radius: 5px;
}
.btn_wrap button.result_ing:before {
    content: ""; position: absolute; top: -2px; left: -2px; z-index: 100;
    width: calc(100% + 4px); height: 106%;
    background: rgba(0,0,0,0.57); border-radius: 5px;
}
.btn_wrap button.my_bet { border-color: #fff !important; }
.btn_wrap button.my_bet:before { content: ""; display: none; }

/* Betting Cart */
.betting_cart_wrap { margin-top: 10px; padding: 16px 10px 10px; background: #323336; }
.betting_cart { position: relative; height: 100%; }
.betting_cart .money_info { float: left; width: 38.5%; margin-left: 2.5%; padding-top: 4px; }
.betting_cart dl:first-of-type { margin-left: 0; }
.betting_cart .money_info dt {
    float: left; font-size: 16px; font-weight: 500;
    color: #c6b273; line-height: 42px;
}
.betting_cart .money_info dd {
    float: right; position: relative; width: 60%;
    height: 42px; background: #1b1b1b; border-radius: 5px;
    box-shadow: 0 1px 0 0 rgba(0,0,0,0.75) inset;
}
.betting_cart .money_info dd p {
    padding-right: 9px; font-size: 16px; font-weight: 500;
    color: #fff; line-height: 42px; text-align: right;
}
.betting_cart .money_info dd input {
    width: 100%; height: 100%; padding-right: 9px;
    background: none; border: 0; font-size: 16px; font-weight: 500;
    color: #fff; text-align: right;
}
.betting_cart .btn_reset {
    float: right; width: 18%; height: 50px;
    background: #393c41; border: 1px solid #4d4d4d;
    font-size: 16px; font-weight: 500; color: #81bf39;
    box-shadow: 1px 1px 0px 0px rgba(0,0,0,1);
}
.betting_cart .btn_reset:hover { border-color: #81bf39; }
.betting_cart .btn_reset:active { background: #81bf39; color: #fff; }
.betting_cart .btn_area { clear: both; padding-top: 8px; }
.betting_cart .btn_area .btn_betting {
    float: left; width: 18%; height: 50px; margin-left: 2.5%;
    background: #393c41; border: 1px solid #4d4d4d;
    font-size: 16px; font-weight: 500; color: #fff;
    box-shadow: 1px 1px 0px 0px rgba(0,0,0,1);
}
.betting_cart .btn_area .btn_betting:hover { border-color: #45b5da; }
.betting_cart .btn_area .btn_betting:active { background: #45b5da; color: #fff; }
.betting_cart .btn_area button:first-child { margin-left: 0; }

/* Round History */
.round_wrap { width: 100%; padding-top: 14px; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.round_wrap .hash_tit dt {
    float: left; width: 12%; height: 41px;
    border-bottom: 2px solid #323336; color: #ccc; line-height: 39px; text-align: center;
}
.round_wrap .hash_tit dd {
    float: left; width: 80%; height: 41px;
    border-bottom: 2px solid #323336; color: #ccc; line-height: 39px; text-align: center;
}
.round_wrap .hash_tit dd.hash_result_dd { width: 8%; }
.round_wrap .round_hash_wrap { flex: 1; overflow-y: auto; min-height: 0; }
.round_wrap .round_hash_wrap::-webkit-scrollbar { width: 6px; }
.round_wrap .round_hash_wrap::-webkit-scrollbar-track { background: transparent; }
.round_wrap .round_hash_wrap::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.round_wrap .round_hash_wrap:hover::-webkit-scrollbar-thumb { background: #444; }
.round_wrap .hash_list dl { overflow: hidden; }
.round_wrap .hash_list dt {
    float: left; width: 12%; height: 40px; padding-left: 1%;
    border-bottom: 1px solid #323336; color: #ccc; line-height: 39px; text-align: center;
}
.round_wrap .hash_list dd {
    float: left; position: relative; height: 40px;
    border-bottom: 1px solid #323336; color: #ccc; line-height: 39px;
}
.round_wrap .hash_list dd.hash_val {
    width: 80%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 12px; padding-left: 4px;
}
.round_wrap .hash_list dd.hash_result_dd {
    width: 8%; padding: 5px 2px; text-align: center;
}
.round_wrap .hash_list dd.hash_result_dd .result_card {
    display: inline-block; width: 28px; height: 30px;
    background: #fff; border-radius: 3px;
    text-align: center; line-height: 1;
    padding-top: 2px;
}
.round_wrap .hash_list dd.hash_result_dd .result_card .card_num {
    display: block; font-size: 13px; font-weight: bold; line-height: 14px;
}
.round_wrap .hash_list dd.hash_result_dd .result_card .card_suit {
    display: block; font-size: 11px; line-height: 14px;
}
.round_wrap .hash_list dd.hash_result_dd .result_card.result_red { color: #b42b2d; }
.round_wrap .hash_list dd.hash_result_dd .result_card.result_black { color: #252424; }
.round_wrap .hash_list dd.hash_result_dd .result_card.result_joker {
    background: #45b5da; color: #fff; font-size: 10px;
    line-height: 30px; padding-top: 0;
}

/* Header Buttons */
.time_line .btn_history {
    position: absolute; top: 0; right: 30px;
    width: 70px; height: 27px; padding: 0 5px 0 0;
    background: url(../images/btn_history.png) no-repeat 5px 50%;
    background-color: #45b5da; border: 0;
    font-size: 12px; font-weight: 500; color: #22272b;
    line-height: 27px; text-align: right; cursor: pointer;
}

/* 배팅내역 팝업 */
#betHistoryPopup {
    position: fixed; top: 82px; right: 0;
    z-index: 99998; width: 680px;
}
.betting_history_cont {
    position: relative; width: 100%;
    max-height: calc(100vh - 100px); overflow-y: auto;
    padding: 20px 20px 40px;
    background: #22272b; border: 1px solid #45b5da;
}
.bet_his_header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid #333;
}
.bet_his_header span { font-size: 16px; font-weight: bold; color: #45b5da; }
.btn_his_close {
    position: absolute; top: 15px; right: 15px;
    background: none; border: none; font-size: 18px; color: #888; cursor: pointer;
}
.btn_his_close:hover { color: #fff; }
.btn_his_close_bottom {
    display: block; width: 100%; margin-top: 15px; padding: 8px 0;
    background: #393c41; border: 1px solid #4d4d4d;
    font-size: 14px; color: #ccc; cursor: pointer; text-align: center;
}
.btn_his_close_bottom:hover { border-color: #45b5da; color: #fff; }
.tbl_bet_history {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.tbl_bet_history thead th {
    padding: 10px 6px; background: #1a1d20; color: #ccc;
    border-bottom: 1px solid #333; text-align: center; font-weight: 500;
}
.tbl_bet_history tbody { overflow-y: auto; display: block; max-height: 400px; }
.tbl_bet_history thead, .tbl_bet_history tbody tr {
    display: table; width: 100%; table-layout: fixed;
}
.tbl_bet_history tbody td {
    padding: 8px 6px; border-bottom: 1px solid #2a2d30;
    color: #ccc; text-align: center;
}
.tbl_bet_history tbody tr:nth-child(even) td { background: #1f2225; }
.tbl_bet_history .win { color: #81bf39; }
.tbl_bet_history .lose { color: #ed3327; }

@media screen and (max-width: 767px) {
    .betting_history_cont { width: 95%; }
}

/* Hash Popup */
#hashPopup {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 99999; background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
}
.hash_popup {
    position: relative; width: 480px; padding: 24px 28px;
    background: #22272b; border: 1px solid #45b5da; border-radius: 8px;
}
.hash_popup .popup_title {
    margin-top: 14px; font-size: 14px; color: #ccc; word-break: break-all;
}
.hash_popup .popup_title:first-child { margin-top: 0; }
.hash_popup .popup_title .titles {
    display: inline-block; font-size: 13px; font-weight: bold; color: #45b5da;
    margin-bottom: 4px;
}
.hash_popup .popup_title .text_success {
    display: inline-block; font-size: 13px; color: #81bf39; word-break: break-all;
}
.hash_popup .popup_btn {
    text-align: center; margin-top: 16px;
}
.hash_popup .popup_btn button {
    width: 120px; height: 32px; background: #45b5da; border: 0; border-radius: 3px;
    font-size: 14px; font-weight: bold; color: #22272b; cursor: pointer;
}
.hash_popup .popup_btn button:hover { background: #5cc5e8; }
.hash_popup .popup_close {
    position: absolute; top: 10px; right: 14px;
    background: none; border: none; font-size: 18px; color: #888; cursor: pointer;
}
.hash_popup .popup_close:hover { color: #fff; }

/* Toast */
.toast-msg {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    z-index: 999999; padding: 12px 24px; background: rgba(0,0,0,0.85);
    border: 1px solid #45b5da; border-radius: 6px;
    font-size: 14px; color: #fff; white-space: nowrap;
    animation: toastFade 2s forwards;
}
@keyframes toastFade {
    0% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; }
}

/* Result overlay */
.result_overlay {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    z-index: 9999; padding: 20px 40px; border-radius: 10px;
    font-size: 32px; font-weight: bold; text-align: center;
    animation: resultPop 0.3s ease-out;
}
.result_overlay.win { background: rgba(129,191,57,0.9); color: #fff; }
.result_overlay.lose { background: rgba(219,13,24,0.9); color: #fff; }
@keyframes resultPop {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Responsive - Mobile */
@media screen and (max-width: 767px) {
    /* 레이아웃: 세로 배치 */
    #main-layout {
        position: relative; top: auto; bottom: auto;
        flex-direction: column; height: auto;
    }
    #left-col {
        width: 100%; min-width: auto;
        height: auto; overflow: visible;
        display: block;
    }
    #right-col {
        width: 100%; min-width: auto;
        height: auto; display: block;
    }
    #right-col .game_list_wrap { max-height: 300px; overflow-y: auto; }

    /* 헤더 */
    #game-header { height: auto; padding: 10px 8px; }
    .hash_line .hash { display: none; }
    .hash_line .limit_money { position: relative; top: 0; padding-left: 22px; background-size: 14px; }
    .hash_line .limit_money .pop_max { right: auto; left: 0; }

    /* 히스토리 바 */
    .game_history { height: 33px; padding: 3px 0; }
    .game_history_list li { width: 20px; height: 25px; margin-left: 3px; padding-top: 1px; }
    .game_history_list li span { font-size: 15px; line-height: 10px; margin-top: -4px; }
    .game_history_list li span:first-child { width: 7px; height: 8px; }
    .game_history_list li .ico_his_h,
    .game_history_list li .ico_his_d,
    .game_history_list li .ico_his_c,
    .game_history_list li .ico_his_s { background-size: 6px 7px; background-position: 50% 1px; }
    .game_history_list li.high:before,
    .game_history_list li.low:before,
    .game_history_list li.mid:before { right: -9px; width: 14px; height: 14px; margin-top: -7px; background-size: 100% 100%; }
    .game_history_list li.joker { background-size: 60% 60%; }

    /* 카드 */
    .hilo_card_wrap { height: 156px; margin-top: 5px; }
    .card_wrap { width: 100px; height: 156px; margin-left: -50px; }
    .card_face { width: 100px; height: 154px; }
    .card_inner { width: 100px; height: 154px; }
    .card-top-left { top: 5px; left: 6px; }
    .card-top-left .card-corner-number { font-size: 18px; }
    .card-top-left .card-corner-suit { font-size: 14px; }
    .card-bottom-right { bottom: 5px; right: 6px; }
    .card-bottom-right .card-corner-number { font-size: 18px; }
    .card-bottom-right .card-corner-suit { font-size: 14px; }
    .card-center-suit { font-size: 40px; }
    .card_front .card-front-pattern { font-size: 30px; }
    .card_back.suit-joker .card-center-suit { font-size: 22px; }

    /* 버튼 */
    .btn_wrap .left_area { width: calc(50% - 58px); }
    .btn_wrap .left_area .inner_btn_wrap { height: 76px; margin-top: 4px; }
    .btn_wrap .left_area button .btn_tit_1 { top: 14px; font-size: 13px; line-height: 13px; }
    .btn_wrap .left_area button .btn_tit_2 { top: 30px; font-size: 10px; line-height: 10px; }
    .btn_wrap .left_area button .btn_tit_3 { top: 42px; font-size: 10px; line-height: 10px; }
    .btn_wrap .btn_action_high .bet_money { top: 56px; font-size: 10px !important; }
    .btn_wrap .btn_action_low .bet_money { top: 56px; font-size: 10px !important; }
    .btn_wrap .right_area { width: calc(50% - 58px); }
    .btn_wrap .right_area .inner_btn_wrap { height: 50px; margin-top: 3px; }
    .btn_wrap .right_area button .btn_tit_1 { top: 6px; font-size: 12px; line-height: 12px; }
    .btn_wrap .right_area button .btn_tit_2 { top: 20px; font-size: 10px; line-height: 10px; }
    .btn_wrap button .bet_money { top: 32px; font-size: 10px !important; }

    /* 배팅 카트 */
    .betting_cart_wrap { margin-top: 5px; padding: 10px 8px 8px; }
    .betting_cart .money_info dt { font-size: 12px; line-height: 28px; }
    .betting_cart .money_info dd { height: 28px; }
    .betting_cart .money_info dd p { font-size: 12px; line-height: 28px; }
    .betting_cart .money_info dd input { font-size: 12px; }
    .betting_cart .btn_reset { height: 30px; font-size: 12px; }
    .betting_cart .btn_area .btn_betting { height: 30px; font-size: 12px; }

    /* 라운드 히스토리 */
    .round_wrap { padding-top: 8px; flex: none; min-height: 0; }
    .round_wrap .round_hash_wrap { max-height: 250px; flex: none; }
    .round_wrap .hash_tit dt,
    .round_wrap .hash_list dt { width: 18%; }
    .round_wrap .hash_tit dd.hash_result_dd,
    .round_wrap .hash_list dd.hash_result_dd { width: 10%; }
    .round_wrap .hash_tit dd:last-child { width: 72%; }
    .round_wrap .hash_list dd.hash_val { width: 72%; font-size: 10px; }

    /* 유저 배팅 리스트 */
    #right-col .game_tit dt { padding-left: 10px; font-size: 13px; }
    #right-col .game_tit dd { font-size: 13px; }
    #right-col .list_area dt { padding-left: 10px; font-size: 13px; }
    #right-col .list_area dd { font-size: 13px; }
    #right-col .list_area dd.bet_money { padding-right: 10px; }

    /* 해시 팝업 */
    .hash_popup { width: 90%; padding: 16px; }

    /* 슬라이드 애니메이션 모바일 */
    .card_inner.slide-to-history {
        transform: rotateY(180deg) scale(0.2);
    }
}
