/* ========================================
   BITUP - UP/DOWN Crypto Betting Game
   Complete Redesign Based on Original
======================================== */

/* ========== Fonts ========== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@100..900&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

@font-face {
    font-family: 'Pretendard';
    src: url('../fonts/pretendard/Pretendard-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Pretendard';
    src: url('../fonts/pretendard/Pretendard-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Pretendard';
    src: url('../fonts/pretendard/Pretendard-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Pretendard';
    src: url('../fonts/pretendard/Pretendard-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}

/* ========== CSS Variables ========== */
:root {
    --primary: #40fab6;
    --secondary: #f23e5d;
    --warning: #F2833E;
    --text-high: #ffffff;
    --text-mid: #111111;
    --text-low: #b0b6be;
    --text-yellow: #ffe032;
    --container: rgba(255, 255, 255, 0.09);
    --invert-container: rgba(255, 255, 255, 0.04);
    --border-low: rgba(255, 255, 255, 0.15);
    --border-mid: rgba(255, 255, 255, 0.12);
    --border-high: #ffffff;
    --modal-bg: #1f1f1f;
    --modal-surface: rgba(255, 255, 255, 0.08);
    --btn-bg: rgba(255, 255, 255, 0.16);
    --btn-line: #e5e5e5;
    --table-th-bg: rgba(137, 137, 137, 0.2);
    --table-tb-bg: rgba(137, 137, 137, 0.04);
}

[data-theme="light"] {
    --primary: #00c980;
    --secondary: #ff4868;
    --text-high: #111111;
    --text-mid: #ffffff;
    --text-low: #666666;
    --text-yellow: #e03b3b;
    --container: rgba(255, 255, 255, 0.56);
    --invert-container: rgba(255, 255, 255, 0.24);
    --border-low: rgba(255, 255, 255, 1);
    --border-mid: rgba(255, 255, 255, 1);
    --modal-bg: #ffffff;
    --modal-surface: #eceff3;
    --btn-bg: #eceff3;
    --btn-line: #666666;
    --table-th-bg: #eceff3;
    --table-tb-bg: #fbfdff;
}

/* ========== Reset & Base ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 62.5%;
}

body {
    overflow: hidden;
    height: 100vh;
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
    font-size: 1.4rem;
    line-height: 2rem;
    font-weight: 400;
    color: var(--text-low);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

[data-theme="dark"] body {
    background: radial-gradient(ellipse at top left, #061f15 0%, #000000 12%, #110415 100%);
    background-attachment: fixed;
}

[data-theme="light"] body {
    background: radial-gradient(circle at top right, rgba(201, 255, 235, 1) 0%, rgba(217, 225, 234, 1) 15%, rgba(217, 225, 234, 1) 100%);
    background-attachment: fixed;
}

a {
    display: inline-block;
    text-decoration: none;
    color: var(--text-high);
}

ul, ol {
    list-style: none;
}

button {
    display: inline-block;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

input, textarea, select {
    font-family: inherit;
    outline: none;
}

img {
    vertical-align: middle;
    max-width: 100%;
}

.blind {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
}

/* ========== Typography ========== */
.h1, h1 { font-size: 3.2rem; line-height: 4.8rem; }
.h2, h2 { font-size: 2.4rem; line-height: 3.6rem; }
.h3, h3 { font-size: 2rem; line-height: 3rem; }
.h4, h4 { font-size: 1.6rem; line-height: 2.4rem; }
.p1 { font-size: 1.4rem; line-height: 2rem; }
.p2 { font-size: 1.2rem; line-height: 1.8rem; }

/* ========== Buttons ========== */
[class*="btn-"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0 1.6rem;
    height: 4rem;
    font-size: 1.4rem;
    font-weight: 600;
    border-radius: 0.8rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-sm {
    height: 3.2rem;
    padding: 0 1.2rem;
    font-size: 1.2rem;
}

.btn-lg {
    height: 4.8rem;
    padding: 0 2.4rem;
    font-size: 1.6rem;
}

.btn-primary {
    background: var(--primary);
    color: #111;
}

.btn-primary:hover {
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--secondary);
    color: #fff;
}

.btn-gray {
    background: var(--btn-bg);
    color: var(--text-high);
    border: 1px solid var(--border-low);
}

[data-theme="light"] .btn-gray {
    background: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-high);
    border: 1px solid var(--border-low);
}

.btn-ghost:hover {
    background: var(--invert-container);
}

.btn-blur {
    background: var(--container);
    color: var(--text-high);
    border: 1px solid var(--border-mid);
    backdrop-filter: blur(10rem);
}

.btn-up {
    background: rgba(64, 250, 182, 0.15);
    border: 1px solid rgba(64, 250, 182, 0.4);
    color: var(--primary);
}

.btn-up:hover, .btn-up.active {
    background: rgba(64, 250, 182, 0.25);
}

.btn-down {
    background: rgba(242, 62, 93, 0.15);
    border: 1px solid rgba(242, 62, 93, 0.4);
    color: var(--secondary);
}

.btn-down:hover, .btn-down.active {
    background: rgba(242, 62, 93, 0.25);
}

.btn-md {
    height: 3.6rem;
    padding: 0 1.4rem;
    font-size: 1.3rem;
}

.btn-blur.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary);
}

/* ========== Badge ========== */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.8rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 0.4rem;
}

.badge--up {
    background: rgba(64, 250, 182, 0.15);
    color: var(--primary);
}

.badge--down {
    background: rgba(242, 62, 93, 0.15);
    color: var(--secondary);
}

/* ========== Header ========== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 90;
    padding: 0 2.6rem 0 2.4rem;
    width: 100%;
    height: 8.6rem;
    background: transparent;
    transition: all 0.3s ease;
}

.header--active {
    backdrop-filter: blur(4rem);
}

[data-theme="dark"] .header--active {
    background-color: rgba(9, 9, 9, 0.2);
}

[data-theme="light"] .header--active {
    background-color: rgba(255, 255, 255, 0.08);
}

.header__logo a {
    display: block;
    width: 12.2rem;
    height: 4rem;
    background-image: url('../images/logo.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

[data-theme="light"] .header__logo a {
    background-image: url('../images/logo_light.svg');
}

.header__gnb {
    display: flex;
}

.header__gnb-list {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.header__gnb-item {
    position: relative;
    display: flex;
}

/* Credit Display */
.header__gnb-credit {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    position: relative;
    padding-left: 1.2rem;
    border-radius: 0.8rem;
    background-color: var(--container);
}

.header__gnb-credit::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: 0.8rem;
    background: linear-gradient(130deg, var(--primary) 0%, rgba(255, 255, 255, 0.15) 15%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

[data-theme="light"] .header__gnb-credit::before {
    background: linear-gradient(130deg, #07bf7c 0%, #fff 20%);
}

.header__gnb-credit-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.header__gnb-credit-info i {
    font-size: 1.6rem;
    color: var(--text-high);
}

.header__gnb-credit-info span {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-high);
}

/* Header Buttons */
.header__gnb [class*="btn-ghost"] {
    padding: 0 1rem;
    position: relative;
}

.header__gnb [class*="btn-sm"] {
    border-radius: 0.8rem;
}

/* Notification Badge */
.notification {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(25%, -25%);
    padding: 0 0.4rem;
    min-width: 1.6rem;
    height: 1.6rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    font-style: normal;
    border-radius: 10rem;
    color: var(--border-high);
    background-color: var(--secondary);
}

/* Theme Toggle */
.header__gnb-theme {
    display: flex;
    align-items: center;
    position: relative;
    gap: 0.4rem;
    padding: 0 !important;
}

.header__gnb-theme::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    width: calc(50% + 1px);
    height: calc(100% + 1px);
    background-color: var(--border-low);
    border-radius: 0.8rem;
    border: 1px solid var(--border-low);
    pointer-events: none;
    transition: all 0.2s ease;
}

.header__gnb-theme:has(.btn-light.active)::before {
    left: 50%;
}

.header__gnb-theme button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 100%;
    background: transparent;
    border: none;
}

/* User Menu */
.header__gnb-user {
    overflow: hidden;
    width: 4rem;
    height: 4rem;
    border-radius: 0.8rem;
}

.header__gnb-user img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header__gnb-user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    transform: translateY(0.4rem);
    padding: 0.6rem 0;
    width: max-content;
    min-width: 14rem;
    background-color: var(--modal-bg);
    border-radius: 0.8rem;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.header__gnb-item:hover .header__gnb-user-menu,
.header__gnb-user-menu.show {
    opacity: 1;
    visibility: visible;
}

.header__gnb-user-menu-list {
    display: flex;
    flex-direction: column;
}

.header__gnb-user-menu-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.2rem;
    width: 100%;
    font-size: 1.4rem;
    color: var(--text-high);
    transition: background 0.2s ease;
}

.header__gnb-user-menu-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .header__gnb-user-menu-link:hover {
    background-color: #eef1f8;
}

.header__gnb-user-menu-link i {
    font-size: 1.6rem;
}

.header__gnb-user-menu-link--logout {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.4rem;
    padding-top: 1.2rem;
}

[data-theme="light"] .header__gnb-user-menu-link--logout {
    border-top-color: #eef1f8;
}

/* ========== Main Content Layout ========== */
.main-content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 2.4rem;
}

/* ========== Game Page Layout ========== */
.game-page {
    display: flex;
    position: relative;
    width: 100%;
    height: calc(100vh - 8.6rem);
    margin-top: 8.6rem;
    overflow: hidden;
}

.game-content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.2rem 0 2rem 0;
}

/* When chat is open, add padding for sidebar */
.game-page.chat-open .game-content {
    padding-right: 34.8rem;
}

.main__section {
    position: relative;
    padding: 0 2.4rem;
    min-width: 0;
}

.main__section--flex {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
}

.main__section + .main__section {
    margin-top: 1.2rem;
}

.main__section-wrapper {
    position: relative;
    z-index: 1;
    padding: 1.6rem;
    border-radius: 1.2rem;
    background-color: var(--container);
    border: 1px solid var(--border-low);
    backdrop-filter: blur(7.5rem);
}

.game-footer {
    padding: 2rem 2.4rem;
    text-align: center;
}

.game-footer__copyright {
    font-size: 1.2rem;
    color: var(--text-low);
    margin: 0;
}

/* ========== Chart Section ========== */
.chart {
    flex: 1 1 1401px;
}

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

.chart__header {
    overflow: hidden;
    position: relative;
}

.chart__header::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    transform: translate(-0.5rem, -50%);
    width: 5.2rem;
    height: 4rem;
    background-color: #f79b2b;
    border-radius: 100%;
}

.chart__header-row {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    position: relative;
    padding: 0 1.6rem;
    width: 100%;
    height: 4.8rem;
    background-color: var(--container);
    border: 1px solid var(--border-low);
    border-radius: 1.2rem;
    backdrop-filter: blur(7.5rem);
}

.chart__header-row::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translate(-0.1rem, -50%);
    width: 1px;
    height: 2.4rem;
    background: linear-gradient(to bottom, rgba(248, 152, 36, 0), rgba(248, 152, 36, 1) 50%, rgba(248, 152, 36, 0));
}

.chart__logo {
    width: 3rem;
    height: 3rem;
    object-fit: contain;
    flex-shrink: 0;
}

.chart__title {
    font-size: 2rem;
    line-height: 3rem;
    font-weight: 700;
    color: var(--text-high);
}

.chart__sub-title {
    font-size: 1.4rem;
    color: var(--text-low);
}

.chart__price {
    margin-left: auto;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Roboto', monospace;
}

.chart__round {
    margin-left: 1.2rem;
    margin-right: 0.8rem;
    padding: 0.4rem 0.8rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-low);
    background: var(--invert-container);
    border-radius: 0.4rem;
    font-family: 'Roboto', monospace;
}

.chart__btn-help {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 3.2rem;
    height: 3.2rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-low);
}

/* Chart Section Wrapper */
.chart__section-wrapper {
    overflow: hidden;
    position: relative;
}

.chart__section-wrapper::before,
.chart__section-wrapper::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 16rem;
    height: 7.4rem;
    border-radius: 100%;
}

.chart__section-wrapper::before {
    top: 5.6rem;
    left: 0;
    transform: translateX(-2.4rem);
    background-color: var(--primary);
}

.chart__section-wrapper::after {
    top: 50%;
    right: 0;
    transform: translate(2.4rem, -50%);
    background-color: var(--secondary);
}

.chart__section {
    position: relative;
    z-index: 1;
    padding: 1.6rem;
    border-radius: 1.2rem;
    background-color: var(--container);
    border: 1px solid var(--border-low);
    backdrop-filter: blur(7.5rem);
}

/* Stats Section */
.chart__stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.chart__stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
}

.chart__stat-card--up .chart__stat-value {
    color: var(--primary);
}

.chart__stat-card--down .chart__stat-value {
    color: var(--secondary);
}

.chart__stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.chart__stat-info dt {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-low);
}

.chart__stat-info dd {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.6rem;
    font-weight: 700;
}

.chart__stat-card--up dd {
    color: var(--primary);
}

.chart__stat-card--down dd {
    color: var(--secondary);
}

.chart__stat-value {
    font-size: 3.2rem;
    line-height: 4.8rem;
    font-weight: 800;
}

/* Timer */
.chart__timer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    position: relative;
}

.chart__timer svg {
    width: 100px;
    height: 100px;
}

.chart__timer-circle--bg {
    stroke-width: 6px;
    stroke: rgba(255, 255, 255, 0.08);
    fill: none;
}

.chart__timer-circle--fg {
    stroke-width: 8px;
    stroke-linecap: round;
    stroke: var(--primary);
    fill: none;
    transition: stroke 0.3s ease;
    transform: rotate(-90deg);
    transform-origin: center;
    will-change: stroke-dashoffset;
}

.chart__timer-circle--warning {
    stroke: #e88e34;
}

.chart__timer-circle--danger {
    stroke: var(--secondary);
}

.chart__timer-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    inset: 0;
    text-align: center;
    color: var(--primary);
    z-index: 10;
}

.chart__timer-text--warning {
    color: #e88e34;
}

.chart__timer-text--danger {
    color: var(--secondary);
}

.chart__timer-num {
    font-size: 3.2rem;
    line-height: 4.8rem;
    font-weight: 700;
}

.chart__timer-unit {
    font-size: 1.2rem;
    color: inherit;
}

/* Timer Loading Animation - Bounce Bars */
.loader5 {
    justify-content: center;
    align-items: flex-end;
    gap: 6px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 40px;
    z-index: 10;
}

.loader5 div {
    width: 6px;
    height: 100%;
    background: #c61108;
    animation: bounceBar 1s infinite ease-in-out;
}

.loader5 div:nth-child(1) {
    animation-delay: 0s;
}

.loader5 div:nth-child(2) {
    animation-delay: 0.1s;
}

.loader5 div:nth-child(3) {
    animation-delay: 0.2s;
}

.loader5 div:nth-child(4) {
    animation-delay: 0.3s;
}

.loader5 div:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes bounceBar {
    0%, 100% {
        transform: scaleY(0.4);
    }
    50% {
        transform: scaleY(1);
    }
}

/* Chart Canvas (lightweight-charts 기반) */
.chart__canvas {
    position: relative;
    width: 100%;
    height: 224px;
    border-radius: 0.5rem;
    overflow: hidden;
    /* dark mode: from-gray-800 to-gray-900 */
    background: linear-gradient(to bottom, #1f2937, #111827);
    transition: background-color 0.2s;
}

#bcChartContainer {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
}

/* TradingView lightweight-charts 스타일 조정 */
#bcChartContainer .tv-lightweight-charts {
    width: 100% !important;
    height: 100% !important;
}

#bcChartContainer canvas {
    display: block;
}

#tradingChart {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
}

/* SVG는 JavaScript에서 크기 설정 - CSS 오버라이드 금지 */
#tradingChart svg {
    display: block;
    overflow: visible;
}

.chart__canvas img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Live Price Indicator (ezywallets 100% 동일) */
.chart__live-price {
    position: absolute;
    right: 5px;
    bottom: 20px;
    top: auto !important;
    transform: none !important;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    z-index: 20;
    pointer-events: none;
    min-width: 85px;
}

.chart__live-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 6px;
    font-size: 10px;
    font-weight: 600;
    color: #1a1a1a;
    background: #D7ED47;
    border-radius: 4px 4px 0 0;
}

.chart__live-value {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    background: #D7ED47;
    padding: 6px 8px;
    border-radius: 0 0 4px 4px;
    font-family: monospace;
    text-align: center;
}

.chart__live-price.up .chart__live-label,
.chart__live-price.up .chart__live-value {
    background: rgb(46, 204, 113);
    color: #fff;
}

.chart__live-price.down .chart__live-label,
.chart__live-price.down .chart__live-value {
    background: rgb(255, 84, 73);
    color: #fff;
}

.chart__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    height: 100%;
    color: var(--text-low);
}

.chart__placeholder i {
    font-size: 4rem;
    color: var(--primary);
    opacity: 0.5;
}

.chart__placeholder span {
    font-size: 1.4rem;
}

/* Chart Meta */
.chart__meta {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    flex-wrap: wrap;
    margin-top: 1.6rem;
}

.chart__meta-stats {
    flex: 1;
    display: flex;
    gap: 4rem;
    align-items: center;
    padding: 0.6rem 0;
}

.chart__meta-info {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
}

.chart__meta-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-high);
}

.chart__meta-label {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-low);
}

/* History Dots */
.chart__history {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    gap: 0.8rem;
}

.chart__history-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 4rem;
    height: 4rem;
    border-radius: 0.8rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.chart__history-dot--up {
    background-color: rgba(64, 250, 182, 0.12);
    color: var(--primary);
}

.chart__history-dot--down {
    background-color: rgba(242, 62, 93, 0.12);
    color: var(--secondary);
}

.chart__history-dot--latest::after {
    content: "";
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
}

.chart__history-dot--up.chart__history-dot--latest::after {
    background-color: var(--primary);
}

.chart__history-dot--down.chart__history-dot--latest::after {
    background-color: var(--secondary);
}

/* Betting Controls */
.chart__section--betting {
    overflow: hidden;
    backdrop-filter: none;
}

.chart__section--betting::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    backdrop-filter: blur(4.5rem);
    pointer-events: none;
}

.chart__bet-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chart__bet-label {
    color: var(--text-low);
    font-weight: 700;
}

.chart__bet-total {
    color: var(--text-high);
    font-weight: 700;
}

.chart__input-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-top: 1.2rem;
    padding-left: 1.2rem;
    background-color: var(--invert-container);
    border-radius: 0.8rem;
    border: 1px solid var(--border-mid);
    backdrop-filter: blur(10rem);
    box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.04), 0 8px 30px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .chart__input-group {
    box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.04), 0 8px 24px rgba(0, 0, 0, 0.12);
}

.chart__amount-wrap {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 0.8rem;
}

.chart__amount-wrap i {
    font-size: 2rem;
    color: var(--text-high);
    flex-shrink: 0;
}

.chart__amount {
    flex: 1;
    background: transparent;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-high);
    border: none;
}

.chart__btn-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0 1.6rem;
    height: 4rem;
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-low);
    background: transparent;
    border: none;
    cursor: pointer;
}

.chart__btn-reset:hover {
    color: var(--text-high);
}

.chart__amount-prefix {
    font-size: 1.6rem;
    font-weight: 500;
    font-style: normal;
    color: var(--text-low);
}

.chart__control-group {
    display: flex;
    gap: 0.8rem;
    position: relative;
}

.chart__control-group + .chart__control-group {
    margin-top: 1.2rem;
}

.chart__control-group [class*="btn-"] {
    width: 100%;
}

.chart__controls {
    margin-top: 0.8rem;
}

.chart__btn-action {
    gap: 0.4rem;
}

/* ========== Betting Status ========== */
.betting-status {
    flex: 0 0 320px;
    display: flex;
    flex-direction: row;
    gap: 1.2rem;
    position: relative;
    padding: 1.6rem;
    min-width: 280px;
    max-width: 400px;
    height: fit-content;
    background-color: var(--container);
    border: 1px solid var(--border-low);
    border-radius: 1.2rem;
    backdrop-filter: blur(7.5rem);
}

.betting-status__list {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.betting-status__content {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    height: 100%;
}

.betting-status__title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.betting-status__list--up .betting-status__title {
    color: var(--primary);
}

.betting-status__list--down .betting-status__title {
    color: var(--secondary);
}

.betting-status__title-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: inherit;
}

.betting-status__title i {
    font-size: 1.4rem;
    color: inherit;
}

/* Divider between UP/DOWN */
.betting-status__list--up {
    border-right: 1px solid var(--border-low);
    padding-right: 1rem;
}

.betting-status__list--down {
    padding-left: 1rem;
}

.betting-status__info {
    width: 100%;
}

.betting-status__info-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.2rem;
    border-radius: 0.8rem;
}

.betting-status__list--up .betting-status__info-group {
    background-color: rgba(64, 250, 182, 0.12);
}

.betting-status__list--down .betting-status__info-group {
    background-color: rgba(242, 62, 93, 0.12);
}

.betting-status__info-text {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.betting-status__info-text i {
    font-size: 1.4rem;
}

.betting-status__list--up .betting-status__info-text {
    color: var(--primary);
}

.betting-status__list--down .betting-status__info-text {
    color: var(--secondary);
}

.betting-status__users {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 300px;
    overflow-y: auto;
}

.betting-status__item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.6rem;
    transition: background 0.2s ease;
}

.betting-status__item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.betting-status__item-thumb {
    flex-shrink: 0;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 0.6rem;
    object-fit: cover;
}

.betting-status__item-name {
    flex: 1;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-low);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.betting-status__item-amount {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-high);
}

/* ========== Chat Sidebar (Fixed Right) ========== */
.chat-sidebar {
    position: fixed;
    top: 8.6rem;
    right: 0;
    z-index: 85;
    display: flex;
    flex-direction: column;
    width: 34.8rem;
    height: calc(100vh - 8.6rem);
    background-color: var(--container);
    border-left: 1px solid var(--border-low);
    backdrop-filter: blur(6rem);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.chat-sidebar.chat-sidebar--open {
    transform: translateX(0);
}

.chat-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.6rem;
    border-bottom: 1px solid var(--border-low);
}

.chat-sidebar__header-left {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-high);
}

.chat-sidebar__header-left > i {
    font-size: 1.8rem;
}

.chat-sidebar__online {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.1rem;
    color: var(--text-low);
    font-weight: 400;
}

.online-dot {
    width: 0.6rem;
    height: 0.6rem;
    background-color: var(--primary);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-sidebar__header-right {
    display: flex;
    gap: 0.4rem;
}

.chat-sidebar__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    height: 3.2rem;
    font-size: 1.6rem;
    color: var(--text-low);
    background: transparent;
    border: none;
    border-radius: 0.6rem;
    transition: background 0.2s ease;
}

.chat-sidebar__btn:hover {
    background: var(--invert-container);
}

.chat-sidebar__btn-close {
    margin-right: 0.4rem;
}

/* 데스크톱에서는 닫기 버튼 숨김 (우측 고정 사이드바) */
@media (min-width: 993px) {
    .chat-sidebar__btn-close {
        display: none;
    }
}

.chat-sidebar__messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem;
}

.chat-sidebar__system {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    margin-bottom: 1.2rem;
    font-size: 1.2rem;
    color: var(--text-low);
    background-color: var(--invert-container);
    border-radius: 0.8rem;
}

.chat-sidebar__system i {
    font-size: 1.4rem;
    color: var(--primary);
}

.chat-sidebar__message {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.chat-sidebar__avatar {
    flex-shrink: 0;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 0.6rem;
    object-fit: cover;
}

.chat-sidebar__content {
    flex: 1;
    min-width: 0;
}

.chat-sidebar__meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.3rem;
}

.chat-sidebar__name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-high);
}

.chat-sidebar__time {
    font-size: 1rem;
    color: var(--text-low);
}

.chat-sidebar__text {
    font-size: 1.3rem;
    line-height: 1.5;
    color: var(--text-high);
    word-break: break-word;
}

/* Own message style */
.chat-sidebar__message--own {
    flex-direction: row-reverse;
}

.chat-sidebar__message--own .chat-sidebar__content {
    text-align: right;
}

.chat-sidebar__message--own .chat-sidebar__meta {
    flex-direction: row-reverse;
}

.chat-sidebar__message--own .chat-sidebar__text {
    display: inline-block;
    background: var(--primary);
    color: var(--text-mid);
    padding: 0.6rem 1rem;
    border-radius: 1.2rem 1.2rem 0.4rem 1.2rem;
}

.chat-sidebar__message--own .chat-sidebar__name {
    color: var(--primary);
}

/* Connection status */
.chat-status {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    display: inline-block;
    margin-left: 0.6rem;
}

.chat-status--connected {
    background: var(--primary);
    box-shadow: 0 0 6px var(--primary);
}

.chat-status--disconnected {
    background: var(--secondary);
    box-shadow: 0 0 6px var(--secondary);
}

/* Typing indicator */
.chat-sidebar__typing {
    font-size: 1.1rem;
    color: var(--text-low);
    padding: 0.4rem 1.2rem;
    font-style: italic;
    display: none;
}

.chat-sidebar__input-area {
    padding: 1.2rem;
    border-top: 1px solid var(--border-low);
    background: var(--container);
}

.chat-sidebar__tools {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
}

.chat-sidebar__tool {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    height: 3.2rem;
    font-size: 1.6rem;
    color: var(--text-low);
    background: transparent;
    border: none;
    border-radius: 0.6rem;
}

.chat-sidebar__tool:hover {
    background: var(--invert-container);
}

.chat-sidebar__input-wrap {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.2rem;
    background-color: var(--invert-container);
    border: 1px solid var(--border-mid);
    border-radius: 0.8rem;
}

.chat-sidebar__input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 1.3rem;
    color: var(--text-high);
    outline: none;
}

.chat-sidebar__input::placeholder {
    color: var(--text-low);
}

.chat-sidebar__input:disabled {
    cursor: not-allowed;
}

.chat-sidebar__send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    height: 3.2rem;
    background-color: var(--primary);
    border: none;
    border-radius: 0.6rem;
    color: #111;
    font-size: 1.4rem;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.chat-sidebar__send:hover {
    filter: brightness(1.1);
}

.chat-sidebar__send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== Tabs ========== */
.tab__list {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.2rem;
}

.tab__item {
    flex: 1;
}

.tab__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 4rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-low);
    background-color: transparent;
    border: 1px solid var(--border-low);
    border-radius: 0.8rem;
    transition: all 0.2s ease;
}

.tab__item--active .tab__btn {
    color: var(--text-high);
    background-color: var(--container);
    border-color: var(--primary);
}

/* ========== Table ========== */
.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1.2rem;
    font-size: 1.4rem;
    text-align: left;
    border-bottom: 1px solid var(--border-low);
}

.table th {
    font-weight: 600;
    color: var(--text-low);
    background-color: var(--table-th-bg);
}

.table td {
    color: var(--text-high);
}

.table tbody tr:hover {
    background-color: var(--table-tb-bg);
}

.text-up { color: var(--primary); }
.text-down { color: var(--secondary); }

/* ========== Mobile Navigation ========== */
.header__mobile-gnb {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 90;
    width: 100%;
    background-color: var(--container);
    border-radius: 1.2rem 1.2rem 0 0;
    backdrop-filter: blur(60px);
}

.header__mobile-gnb-list {
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.header__mobile-gnb-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 8rem;
}

.header__mobile-gnb-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    position: relative;
    padding: 0 1.2rem;
    width: 100%;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    background-color: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
}

[data-theme="light"] .header__mobile-gnb-btn {
    color: #111;
}

.header__mobile-gnb-btn:hover,
.header__mobile-gnb-btn.active {
    color: var(--primary);
}

.header__mobile-gnb-btn i {
    font-size: 2.4rem;
}

.header__mobile-gnb-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
}

.header__mobile-gnb-bar::before {
    content: "";
    width: 13.9rem;
    height: 0.5rem;
    background-color: var(--text-high);
    border-radius: 10rem;
}

/* ========== Footer ========== */
.footer {
    padding: 2.4rem;
    text-align: center;
    color: var(--text-low);
    font-size: 1.2rem;
}

/* ========== Auth Pages ========== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 42rem;
    padding: 4rem;
    background-color: var(--container);
    border: 1px solid var(--border-low);
    border-radius: 1.6rem;
    backdrop-filter: blur(6rem);
}

.auth-logo {
    text-align: center;
    margin-bottom: 3.2rem;
}

.auth-logo span {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--text-high);
}

.auth-title {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--text-high);
    text-align: center;
    margin-bottom: 0.8rem;
}

.auth-subtitle {
    font-size: 1.4rem;
    color: var(--text-low);
    text-align: center;
    margin-bottom: 3.2rem;
}

.form-group {
    margin-bottom: 2rem;
}

.form-label {
    display: block;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-high);
    margin-bottom: 0.8rem;
}

.form-control {
    width: 100%;
    padding: 1.2rem 1.6rem;
    font-size: 1.4rem;
    color: var(--text-high);
    background-color: var(--invert-container);
    border: 1px solid var(--border-mid);
    border-radius: 0.8rem;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
}

.form-control::placeholder {
    color: var(--text-low);
}

.btn-block {
    width: 100%;
}

.auth-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.6rem;
    margin-top: 2.4rem;
    font-size: 1.4rem;
}

.auth-links a {
    color: var(--text-low);
}

.auth-links a:hover {
    color: var(--primary);
}

.auth-footer {
    margin-top: 3.2rem;
    text-align: center;
}

.auth-footer a {
    color: var(--text-low);
    font-size: 1.4rem;
}

.auth-footer a:hover {
    color: var(--primary);
}

.alert {
    padding: 1.2rem 1.6rem;
    border-radius: 0.8rem;
    font-size: 1.4rem;
    margin-bottom: 2rem;
}

.alert-danger {
    background-color: rgba(242, 62, 93, 0.15);
    color: var(--secondary);
    border: 1px solid rgba(242, 62, 93, 0.3);
}

.alert-success {
    background-color: rgba(64, 250, 182, 0.15);
    color: var(--primary);
    border: 1px solid rgba(64, 250, 182, 0.3);
}

/* ========== MyPage Layout ========== */
.mypage-layout {
    display: flex;
    gap: 2.4rem;
    padding: 2.4rem;
}

.mypage-nav {
    flex-shrink: 0;
    width: 24rem;
}

.mypage-nav__list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1.6rem;
    background-color: var(--container);
    border: 1px solid var(--border-low);
    border-radius: 1.2rem;
    backdrop-filter: blur(6rem);
}

.mypage-nav__link {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.2rem 1.6rem;
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-low);
    border-radius: 0.8rem;
    transition: all 0.2s ease;
}

.mypage-nav__link:hover,
.mypage-nav__link.active {
    background-color: var(--invert-container);
    color: var(--text-high);
}

.mypage-nav__link.active {
    color: var(--primary);
}

.mypage-nav__link i {
    font-size: 2rem;
}

.mypage-content {
    flex: 1;
    min-width: 0;
}

.mypage-title {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--text-high);
    margin-bottom: 2.4rem;
}

/* ========== Cards ========== */
.card {
    background-color: var(--container);
    border: 1px solid var(--border-low);
    border-radius: 1.2rem;
    backdrop-filter: blur(6rem);
    overflow: hidden;
}

.card-header {
    padding: 1.6rem;
    border-bottom: 1px solid var(--border-low);
}

.card-title {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-high);
    margin: 0;
}

.card-body {
    padding: 1.6rem;
}

/* ========== Stats Grid ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.6rem;
    margin-bottom: 2.4rem;
}

.stat-card {
    padding: 2rem;
    background-color: var(--container);
    border: 1px solid var(--border-low);
    border-radius: 1.2rem;
    text-align: center;
}

.stat-card-label {
    font-size: 1.2rem;
    color: var(--text-low);
    margin-bottom: 0.8rem;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-high);
}

.stat-card-value.positive { color: var(--primary); }
.stat-card-value.negative { color: var(--secondary); }

/* ========== Intro Page ========== */
.intro-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
}

.intro-content {
    position: relative;
    z-index: 1;
}

.intro-logo {
    font-size: 1.2rem;
    color: var(--primary);
    letter-spacing: 4px;
    margin-bottom: 1.6rem;
    animation: fadeInUp 0.6s ease-out forwards;
}

.intro-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.6rem;
    animation: fadeInUp 0.6s ease-out 0.1s forwards;
    opacity: 0;
}

.intro-subtitle {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    color: var(--text-low);
    margin-bottom: 3.2rem;
    animation: fadeInUp 0.6s ease-out 0.2s forwards;
    opacity: 0;
}

.intro-btn {
    padding: 1.6rem 4rem;
    font-size: 1.6rem;
    font-weight: 700;
    color: #111;
    background: var(--primary);
    border: none;
    border-radius: 1.2rem;
    cursor: pointer;
    animation: fadeInUp 0.6s ease-out 0.3s forwards;
    opacity: 0;
    transition: all 0.3s ease;
}

.intro-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(64, 250, 182, 0.3);
}

.intro-arrows {
    display: flex;
    gap: 2rem;
    margin-top: 4rem;
    animation: fadeInUp 0.6s ease-out 0.4s forwards;
    opacity: 0;
}

.arrow-up {
    font-size: 3rem;
    color: var(--primary);
    animation: bounce 1s ease-in-out infinite;
}

.arrow-down {
    font-size: 3rem;
    color: var(--secondary);
    animation: bounce 1s ease-in-out infinite 0.5s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ========== Toast Notification ========== */
#toastContainer {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.toast-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.2rem 1.6rem;
    background: rgba(17, 17, 17, 0.9);
    border-radius: 0.8rem;
    color: #fff;
    font-size: 1.4rem;
    animation: slideIn 0.3s ease;
}

.toast-item.hide {
    animation: slideOut 0.3s ease forwards;
}

.toast-item.success { border-left: 3px solid var(--primary); }
.toast-item.error { border-left: 3px solid var(--secondary); }
.toast-item.info { border-left: 3px solid #3b82f6; }
.toast-item.warning { border-left: 3px solid var(--warning); }

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-100%); opacity: 0; }
}

/* ========== Responsive ========== */
@media (max-width: 1400px) {
    .game-page.chat-open .game-content {
        padding-right: 30rem;
    }

    .chat-sidebar {
        width: 30rem;
    }

    .betting-status {
        flex: 0 0 260px;
        min-width: 240px;
    }
}

@media (max-width: 1200px) {
    .game-page.chat-open .game-content {
        padding-right: 0;
    }

    .chat-toggle {
        bottom: 12rem;
        right: 1.6rem;
    }
}

@media (max-width: 992px) {
    html {
        font-size: 56.25%;
    }

    .header {
        padding: 1.4rem 1.6rem;
        height: 6rem;
    }

    .game-page {
        height: calc(100vh - 6rem - 10rem);
        margin-top: 6rem;
        padding-bottom: 0;
    }

    .game-content {
        padding-right: 0;
    }

    .main__section {
        padding: 0 1.2rem;
    }

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

    .main__section + .main__section {
        margin-top: 0.8rem;
    }

    .chart {
        flex: none;
    }

    .chart__header-row {
        gap: 0.8rem;
        padding: 0 1.2rem;
        height: 4rem;
        border-radius: 0.6rem;
    }

    .chart__header-row img {
        width: 2rem;
        height: 2rem;
    }

    .chart__title {
        font-size: 1.4rem;
        line-height: 2.4rem;
    }

    .chart__section {
        padding: 1.2rem;
        border-radius: 0.8rem;
    }

    .chart__stats {
        gap: 0.8rem;
    }

    .chart__stat-info dt {
        font-size: 1.1rem;
    }

    .chart__stat-info dd {
        font-size: 1.3rem;
    }

    .chart__stat-value {
        font-size: 2rem;
    }

    .chart__timer svg {
        width: 70px;
        height: 70px;
    }

    .chart__timer-num {
        font-size: 2.4rem;
    }

    .chart__canvas {
        height: 18rem;
    }

    .chart__meta {
        margin-top: 1rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .chart__meta-stats {
        gap: 1.2rem;
        flex-wrap: wrap;
    }

    .chart__history {
        gap: 0.4rem;
        justify-content: flex-start;
        margin-top: 1rem;
    }

    .chart__history-dot {
        width: 2.8rem;
        height: 2.8rem;
        border-radius: 0.4rem;
        font-size: 1.2rem;
    }

    .chart__input-group {
        gap: 0.4rem;
        margin-top: 0.8rem;
        padding-left: 0.8rem;
    }

    .chart__control-group {
        gap: 0.4rem;
    }

    .chart__control-group + .chart__control-group {
        margin-top: 0.6rem;
    }

    .chart__btn-action {
        height: 4.4rem;
        font-size: 1.5rem;
    }

    /* Betting Status - Mobile */
    .betting-status {
        flex: none;
        flex-direction: row;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 1.2rem;
        border-radius: 0.8rem;
    }

    .betting-status__list {
        flex: 1;
    }

    .betting-status__content {
        gap: 0.8rem;
    }

    .betting-status__title-text {
        font-size: 1.4rem;
    }

    .betting-status__info-group {
        padding: 0.8rem;
    }

    .betting-status__info-text {
        font-size: 1.1rem;
    }

    .betting-status__users {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.3rem;
        max-height: 60px;
    }

    .betting-status__item {
        padding: 0;
        width: auto;
    }

    .betting-status__item-thumb {
        width: 2.4rem;
        height: 2.4rem;
        border-radius: 0.4rem;
    }

    .betting-status__item-name,
    .betting-status__item-amount {
        display: none;
    }

    /* Chat Sidebar - Mobile */
    .chat-sidebar {
        top: 6rem;
        width: 100%;
        height: calc(100vh - 6rem - 10rem);
    }

    .chat-sidebar__header {
        padding: 1rem 1.2rem;
    }

    /* Mypage */
    .mypage-layout {
        flex-direction: column;
        gap: 1.6rem;
        padding: 1.6rem;
    }

    .mypage-nav {
        width: 100%;
    }

    .mypage-nav__list {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.4rem;
        padding: 1.2rem;
    }

    .mypage-nav__link {
        flex: 1;
        min-width: calc(50% - 0.2rem);
        padding: 1rem;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }

    .stat-card {
        padding: 1.6rem;
    }

    /* Desktop only hide */
    .desktop-only {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .auth-card {
        padding: 2.4rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Chat Toggle Button */
.chat-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 2.4rem;
    right: 2.4rem;
    z-index: 80;
    width: 5.6rem;
    height: 5.6rem;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    color: #111;
    font-size: 2.4rem;
    box-shadow: 0 4px 16px rgba(64, 250, 182, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(64, 250, 182, 0.4);
}

.chat-toggle__badge {
    position: absolute;
    top: -0.4rem;
    right: -0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    height: 2.2rem;
    padding: 0 0.6rem;
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--secondary);
    color: #fff;
    border-radius: 10rem;
}

/* Mobile Chat Toggle - only shows on mobile */
.mobile-chat-toggle {
    display: none;
}

.mobile-chat-badge {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.4rem;
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--secondary);
    color: #fff;
    border-radius: 10rem;
}

/* ========== Timer Danger State ========== */
.chart__timer--danger .chart__timer-circle--fg {
    stroke: var(--secondary);
}

.chart__timer--danger .chart__timer-text {
    color: var(--secondary);
}

/* ========== History Dot Info Popup ========== */
.chart__history-info {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.8rem;
    padding: 1.2rem;
    min-width: 16rem;
    background-color: var(--modal-bg);
    border: 1px solid var(--border-low);
    border-radius: 0.8rem;
    z-index: 10;
}

.chart__history-info-value {
    display: flex;
    justify-content: space-between;
    gap: 1.2rem;
    font-size: 1.2rem;
}

.chart__history-info-value + .chart__history-info-value {
    margin-top: 0.4rem;
}

.chart__history-info-value span {
    color: var(--text-low);
}

.chart__history-info-value strong {
    color: var(--text-high);
}

/* ========== Betting Action Buttons ========== */
.chart__btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    flex: 1;
    height: 5.2rem;
    font-size: 1.8rem;
    font-weight: 700;
    border: none;
    border-radius: 0.8rem;
    transition: all 0.2s ease;
}

.chart__btn-action--up {
    background: linear-gradient(135deg, var(--primary) 0%, #2ed89a 100%);
    color: #111;
}

.chart__btn-action--up:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.chart__btn-action--down {
    background: linear-gradient(135deg, var(--secondary) 0%, #e02850 100%);
    color: #fff;
}

.chart__btn-action--down:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* ========== Chart Decorations ========== */
.chart__decorations {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(8rem);
    opacity: 0.4;
}

.blob--green {
    top: -5rem;
    left: -5rem;
    width: 20rem;
    height: 20rem;
    background: var(--primary);
}

.blob--red {
    bottom: -5rem;
    right: -5rem;
    width: 20rem;
    height: 20rem;
    background: var(--secondary);
}

/* ========== Betting Success Toast ========== */
.betting-success {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 1.2rem 2rem;
    background: rgba(17, 17, 17, 0.95);
    border: 1px solid var(--primary);
    border-radius: 1.2rem;
    animation: slideUp 0.3s ease;
}

.betting-success i {
    font-size: 2rem;
    color: var(--primary);
}

.betting-success p {
    font-size: 1.4rem;
    color: var(--text-high);
    margin: 0;
}

.betting-success button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    background: transparent;
    border: none;
    color: var(--text-low);
    font-size: 1.6rem;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* ========== Toast Item Types ========== */
.toast-item--success {
    border-left: 3px solid var(--primary);
}

.toast-item--success i {
    color: var(--primary);
}

.toast-item--error {
    border-left: 3px solid var(--secondary);
}

.toast-item--error i {
    color: var(--secondary);
}

.toast-item--info {
    border-left: 3px solid #3b82f6;
}

.toast-item--info i {
    color: #3b82f6;
}

.toast-item--warning {
    border-left: 3px solid var(--warning);
}

.toast-item--warning i {
    color: var(--warning);
}

.toast-item--hide {
    animation: slideOut 0.3s ease forwards;
}

/* ========== Table Styles (New) ========== */
.table__inner {
    overflow: hidden;
}

.table__wrap {
    overflow-x: auto;
}

.table--a {
    width: 100%;
    border-collapse: collapse;
}

.table__head {
    background-color: var(--table-th-bg);
}

.table__row--th {
    border-bottom: 1px solid var(--border-low);
}

.table__cell--th {
    padding: 1.2rem 1.6rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-low);
    text-align: center;
    white-space: nowrap;
}

.table__row--td {
    border-bottom: 1px solid var(--border-low);
    transition: background 0.2s ease;
}

.table__row--td:hover {
    background-color: var(--table-tb-bg);
}

.table__cell--td {
    padding: 1.2rem 1.6rem;
    font-size: 1.4rem;
    color: var(--text-high);
    text-align: center;
    white-space: nowrap;
}

.table__cell--primary {
    color: var(--primary);
}

.table__cell--secondary {
    color: var(--secondary);
}

.table__cell-date {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.table__cell-date span:last-child {
    font-size: 1.2rem;
    color: var(--text-low);
}

.table__cell-profit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    font-weight: 600;
}

.table__cell-user {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.table__cell-avatar {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 0.6rem;
    object-fit: cover;
}

.table__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    padding: 4rem 2rem;
    color: var(--text-low);
}

.table__empty i {
    font-size: 3.2rem;
}

/* ========== Rank Badge ========== */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    font-size: 1.4rem;
    font-weight: 700;
    border-radius: 0.4rem;
}

.rank-badge--1 {
    color: #ffd700;
}

.rank-badge--2 {
    color: #c0c0c0;
}

.rank-badge--3 {
    color: #cd7f32;
}

.table__row--rank-1 .table__cell--td:first-child {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1) 0%, transparent 100%);
}

.table__row--rank-2 .table__cell--td:first-child {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.1) 0%, transparent 100%);
}

.table__row--rank-3 .table__cell--td:first-child {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.1) 0%, transparent 100%);
}

/* ========== Login Required Message ========== */
.login-required-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    padding: 3.2rem;
    text-align: center;
}

.login-required-message i {
    font-size: 4rem;
    color: var(--text-low);
}

.login-required-message p {
    font-size: 1.6rem;
    color: var(--text-low);
    margin: 0;
}

.chart__section--login-required {
    background: rgba(0, 0, 0, 0.3);
}

/* ========== Chart Placeholder ========== */
.chart__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    width: 100%;
    height: 100%;
    color: var(--text-low);
}

.chart__placeholder i {
    font-size: 4rem;
}

/* ========== Point Colors ========== */
.point-primary {
    color: var(--primary);
}

.point-secondary {
    color: var(--secondary);
}

/* ========== Main Footer ========== */
.main__footer {
    padding: 2.4rem;
    text-align: center;
}

.footer__inner {
    padding: 2rem;
}

.footer__copyright {
    font-size: 1.2rem;
    color: var(--text-low);
    margin: 0;
}

/* ========== Desktop Only ========== */
.desktop-only {
    display: block;
}

/* ========== Wrapper ========== */
.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ========== Header Legacy Styles ========== */
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-icon {
    font-size: 2.4rem;
    color: #f7931a;
}

.logo-text {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-high);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.header-balance {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.2rem;
    background: var(--container);
    border: 1px solid var(--border-low);
    border-radius: 0.8rem;
}

.header-balance i {
    font-size: 1.6rem;
    color: var(--primary);
}

.balance-value {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-high);
    transition: transform 0.3s ease, color 0.3s ease;
}

/* 잔액 증가 애니메이션 */
.header-balance.balance-increase {
    animation: balancePulse 0.5s ease;
}

.header-balance.balance-increase .balance-value {
    color: var(--primary);
    transform: scale(1.1);
}

/* 잔액 감소 애니메이션 */
.header-balance.balance-decrease {
    animation: balanceShake 0.5s ease;
}

.header-balance.balance-decrease .balance-value {
    color: var(--secondary);
}

@keyframes balancePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px rgba(64, 250, 182, 0.5); }
    100% { transform: scale(1); }
}

@keyframes balanceShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-3px); }
    40%, 80% { transform: translateX(3px); }
}

.charge-btn {
    height: 3.6rem;
}

.header-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.6rem;
    height: 3.6rem;
    font-size: 1.8rem;
    color: var(--text-high);
    background: transparent;
    border: none;
}

.header-badge {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    height: 1.6rem;
    padding: 0 0.4rem;
    font-size: 1rem;
    font-weight: 700;
    background: var(--secondary);
    color: #fff;
    border-radius: 10rem;
}

.header-dropdown {
    position: relative;
}

.header-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.8rem;
    min-width: 28rem;
    background: var(--modal-bg);
    border: 1px solid var(--border-low);
    border-radius: 1.2rem;
    z-index: 100;
}

.header-dropdown.show .header-dropdown-menu {
    display: block;
}

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.6rem;
    border-bottom: 1px solid var(--border-low);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-high);
}

.dropdown-body {
    max-height: 32rem;
    overflow-y: auto;
    padding: 0.8rem;
}

.dropdown-footer {
    padding: 1.2rem 1.6rem;
    border-top: 1px solid var(--border-low);
    text-align: center;
}

.dropdown-footer a {
    font-size: 1.3rem;
    color: var(--text-low);
}

.text-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.2rem;
    cursor: pointer;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.4rem;
    background: var(--container);
    border: 1px solid var(--border-low);
    border-radius: 0.8rem;
}

.user-avatar {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 0.6rem;
    object-fit: cover;
}

.user-name {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-high);
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu {
    min-width: 22rem;
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.6rem;
    border-bottom: 1px solid var(--border-low);
}

.user-menu-avatar {
    width: 4.8rem;
    height: 4.8rem;
    border-radius: 0.8rem;
    object-fit: cover;
}

.user-menu-info {
    flex: 1;
}

.user-menu-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-high);
}

.user-menu-balance {
    font-size: 1.3rem;
    color: var(--primary);
    margin-top: 0.2rem;
}

.user-menu-body {
    padding: 0.8rem;
}

.user-menu-body a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.2rem;
    font-size: 1.4rem;
    color: var(--text-high);
    border-radius: 0.6rem;
    transition: background 0.2s ease;
}

.user-menu-body a:hover {
    background: var(--invert-container);
}

.user-menu-body a i {
    font-size: 1.8rem;
    color: var(--text-low);
}

.menu-divider {
    height: 1px;
    background: var(--border-low);
    margin: 0.8rem 0;
}

.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    font-size: 2.4rem;
    color: var(--text-high);
    background: transparent;
    border: none;
}

.btn-outline {
    background: transparent;
    color: var(--text-high);
    border: 1px solid var(--border-low);
}

.btn-outline:hover {
    background: var(--invert-container);
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.spinner {
    width: 2.4rem;
    height: 2.4rem;
    border: 2px solid var(--border-low);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== Responsive Additions ========== */
@media (max-width: 992px) {
    .chat-sidebar {
        transform: translateX(100%);
    }

    .chat-sidebar--open {
        transform: translateX(0);
    }

    .mobile-chat-toggle {
        display: flex;
    }

    .desktop-only {
        display: none !important;
    }

    .header-balance {
        padding: 0.6rem 0.8rem;
    }

    .balance-value {
        font-size: 1.2rem;
    }

    .user-name {
        display: none;
    }

    .user-menu-btn i {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }
}

/* ========== Utilities ========== */
.mb-4 { margin-bottom: 1.6rem; }
.mt-4 { margin-top: 1.6rem; }
.p-0 { padding: 0; }
.text-center { text-align: center; }
.text-success { color: var(--primary); }
.text-danger { color: var(--secondary); }
.fw-bold { font-weight: 700; }
.fw-600 { font-weight: 600; }

/* ========== Dropdown Active State ========== */
.header-dropdown.active .header-dropdown-menu,
.header-dropdown.show .header-dropdown-menu {
    display: block;
}

/* ========== Mobile Navigation (Bottom) ========== */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: var(--container);
    border-top: 1px solid var(--border-low);
    backdrop-filter: blur(6rem);
    padding: 0.8rem 0 calc(0.8rem + env(safe-area-inset-bottom));
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 0.4rem;
    padding: 0.8rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-low);
    text-decoration: none;
}

.mobile-nav-item i {
    font-size: 2rem;
}

.mobile-nav-item.active {
    color: var(--primary);
}

.mobile-nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4.8rem;
    height: 4.8rem;
    background: var(--primary);
    border-radius: 50%;
    color: #111;
    font-size: 2rem;
    margin-top: -2.4rem;
}

.center-btn {
    position: relative;
}

.center-btn span {
    margin-top: -0.8rem;
}

/* ========== Modal Styles ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 101;
    width: 90%;
    max-width: 48rem;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--modal-bg);
    border: 1px solid var(--border-low);
    border-radius: 1.6rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-container.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.6rem 2rem;
    border-bottom: 1px solid var(--border-low);
}

.modal-header h5 {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-high);
    margin: 0;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    height: 3.2rem;
    font-size: 2.4rem;
    color: var(--text-low);
    background: transparent;
    border: none;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1.2rem;
    padding: 1.6rem 2rem;
    border-top: 1px solid var(--border-low);
}

/* Jackpot Modal Specific */
.jackpot-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.jackpot-card {
    padding: 1.6rem;
    background: var(--invert-container);
    border: 1px solid var(--border-low);
    border-radius: 1.2rem;
    text-align: center;
}

.jackpot-card.highlight {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 180, 0, 0.05) 100%);
    border-color: rgba(255, 215, 0, 0.3);
}

.jackpot-card-label {
    font-size: 1.2rem;
    color: var(--text-low);
    margin-bottom: 0.8rem;
}

.jackpot-card-value {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--text-high);
}

.jackpot-card-value.gold {
    color: #ffd700;
}

.jackpot-card-change {
    font-size: 1.2rem;
    margin-top: 0.4rem;
}

.jackpot-card-change.positive {
    color: var(--primary);
}

.jackpot-card-change.negative {
    color: var(--secondary);
}

.jackpot-progress {
    margin-bottom: 2rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    color: var(--text-low);
    margin-bottom: 0.8rem;
}

.progress-track {
    height: 0.8rem;
    background: var(--invert-container);
    border-radius: 10rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #ffd700 100%);
    border-radius: 10rem;
    transition: width 0.3s ease;
}

.progress-hint {
    font-size: 1.2rem;
    color: var(--text-low);
    text-align: center;
    margin-top: 0.8rem;
}

.jackpot-rules {
    padding: 1.6rem;
    background: var(--invert-container);
    border-radius: 1.2rem;
}

.jackpot-rules h6 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-high);
    margin-bottom: 1.2rem;
}

.jackpot-rules ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.jackpot-rules li {
    position: relative;
    padding-left: 1.6rem;
    font-size: 1.3rem;
    color: var(--text-low);
    margin-bottom: 0.6rem;
}

.jackpot-rules li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* Notification Item Styles */
.notification-item {
    display: flex;
    gap: 1.2rem;
    padding: 1.2rem;
    border-radius: 0.8rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: var(--invert-container);
}

.notification-item.unread {
    background: rgba(64, 250, 182, 0.05);
}

.notification-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 4rem;
    height: 4rem;
    border-radius: 0.8rem;
    font-size: 1.8rem;
}

.notification-icon.jackpot {
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
}

.notification-icon.win {
    background: rgba(64, 250, 182, 0.15);
    color: var(--primary);
}

.notification-icon.bonus {
    background: rgba(242, 131, 62, 0.15);
    color: var(--warning);
}

.notification-icon.system {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-high);
    margin-bottom: 0.2rem;
}

.notification-desc {
    font-size: 1.3rem;
    color: var(--text-low);
    margin-bottom: 0.4rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-time {
    font-size: 1.1rem;
    color: var(--text-low);
}

.empty-state {
    padding: 3.2rem 2rem;
    text-align: center;
    font-size: 1.4rem;
    color: var(--text-low);
}

/* ========== Mobile Responsive for Modal & Nav ========== */
@media (max-width: 992px) {
    .mobile-nav {
        display: flex;
    }

    .main {
        padding-bottom: 10rem;
    }

    .header-nav.show {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0.8rem;
        padding: 1.6rem;
        background: var(--modal-bg);
        border-top: 1px solid var(--border-low);
    }

    .modal-container {
        width: 95%;
        max-height: 85vh;
    }
}

@media (max-width: 576px) {
    .jackpot-cards {
        grid-template-columns: 1fr;
    }

    .modal-body {
        padding: 1.6rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* ========== Comprehensive Mobile Responsive ========== */

/* Tablet & Small Desktop (max-width: 992px) */
@media (max-width: 992px) {
    /* Chat sidebar - make it fullscreen on mobile */
    .chat-sidebar {
        width: 100%;
        max-width: 100%;
        top: 0;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile Safari */
        height: -webkit-fill-available; /* Fallback for older Safari */
        z-index: 200;
    }

    .chat-sidebar--open {
        transform: translateX(0);
    }

    /* 채팅 입력창 - iOS safe area 대응 */
    .chat-sidebar__input-area {
        padding-bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
    }

    /* Game page adjustments */
    .game-page {
        padding-right: 0;
    }

    .game-page.chat-open {
        overflow: hidden;
    }

    /* Betting status sidebar - horizontal on tablet */
    .betting-status {
        flex-direction: row;
        width: 100%;
        min-width: auto;
    }

    .betting-status__list {
        flex: 1;
    }

    /* Chart controls */
    .chart__controls {
        flex-direction: column;
        gap: 1.2rem;
    }

    .chart__control-group {
        width: 100%;
    }

    /* Stats section */
    .chart__stats {
        gap: 1.6rem;
    }

    .chart__stat-value {
        font-size: 2.4rem;
        line-height: 3.2rem;
    }

    /* Timer size */
    .chart__timer svg {
        width: 8rem;
        height: 8rem;
    }

    .chart__timer-num {
        font-size: 2.4rem;
    }
}

/* Mobile devices (max-width: 768px) */
@media (max-width: 768px) {
    /* Main layout */
    .main__section--flex {
        flex-direction: column;
    }

    /* Betting status - stack vertically on mobile */
    .betting-status {
        flex-direction: column;
        max-height: 20rem;
        overflow-y: auto;
    }

    .betting-status__list {
        min-height: auto;
    }

    .betting-status__users {
        max-height: 12rem;
    }

    /* Chart stats - compact */
    .chart__stat-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .chart__stat-card--down {
        align-items: flex-end;
    }

    .chart__stat-info dt,
    .chart__stat-info dd {
        font-size: 1.2rem;
    }

    .chart__stat-value {
        font-size: 2rem;
        line-height: 2.8rem;
    }

    /* Table responsive */
    .table__cell--th,
    .table__cell--td {
        padding: 0.8rem;
        font-size: 1.2rem;
    }

    /* Tab section */
    .tab__list {
        gap: 0.4rem;
    }

    .tab__btn {
        padding: 0.8rem 1.2rem;
        font-size: 1.3rem;
    }

    /* Chat toggle position */
    .chat-toggle {
        bottom: 8rem;
        right: 1.6rem;
        width: 5rem;
        height: 5rem;
        font-size: 2rem;
    }
}

/* Small mobile devices (max-width: 576px) */
@media (max-width: 576px) {
    /* Header adjustments */
    .header-balance {
        padding: 0.4rem 0.6rem;
    }

    .balance-value {
        font-size: 1.1rem;
    }

    /* Chart section */
    .chart__section {
        padding: 1.2rem;
    }

    /* Stats section - vertical stack */
    .chart__stats {
        flex-direction: column;
        gap: 1.2rem;
    }

    .chart__stat-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .chart__stat-card--down {
        align-items: center;
    }

    .chart__timer {
        order: -1;
        margin-bottom: 1.2rem;
    }

    .chart__timer svg {
        width: 7rem;
        height: 7rem;
    }

    /* Betting controls */
    .chart__control-group {
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .chart__control-group .btn {
        flex: 1 1 calc(33.333% - 0.4rem);
        min-width: 0;
        padding: 0.8rem 0.4rem;
        font-size: 1.2rem;
    }

    /* UP/DOWN buttons */
    .chart__btn-action {
        padding: 1.2rem 1.6rem;
        font-size: 1.4rem;
    }

    .chart__btn-action--up,
    .chart__btn-action--down {
        flex: 1;
        min-width: 0;
    }

    /* Input group */
    .chart__input-group {
        flex-direction: column;
        gap: 0.8rem;
    }

    .chart__amount-wrap {
        width: 100%;
    }

    .chart__btn-reset {
        width: 100%;
    }

    /* Bet summary */
    .chart__bet-summary {
        flex-direction: column;
        gap: 0.4rem;
        text-align: center;
    }

    .chart__bet-total {
        font-size: 2rem;
    }

    /* History dots - smaller */
    .chart__history-dot {
        width: 2rem;
        height: 2rem;
        font-size: 0.9rem;
    }

    /* History info popup - prevent cutoff on mobile */
    .chart__history-info {
        min-width: 14rem;
        max-width: calc(100vw - 3rem);
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    /* Adjust position for left-side dots (first 5 dots) */
    .chart__history-dot:nth-child(-n+5) .chart__history-info {
        left: 0;
        transform: translateX(0);
    }

    /* Adjust position for right-side dots (last 5 dots) */
    .chart__history-dot:nth-last-child(-n+5) .chart__history-info {
        left: auto;
        right: 0;
        transform: translateX(0);
    }

    /* Betting status users */
    .betting-status__item {
        padding: 0.6rem;
    }

    .betting-status__item-thumb {
        width: 2.4rem;
        height: 2.4rem;
    }

    .betting-status__item-name {
        font-size: 1.1rem;
    }

    .betting-status__item-amount {
        font-size: 1rem;
    }

    /* Table - horizontal scroll with fixed columns */
    .table__wrap {
        margin: 0 -1.2rem;
        padding: 0 1.2rem;
    }

    .table--a {
        min-width: 60rem;
    }

    /* Chat sidebar */
    .chat-sidebar__header {
        padding: 1rem 1.2rem;
    }

    .chat-sidebar__header-left {
        font-size: 1.3rem;
        gap: 0.6rem;
    }

    .chat-sidebar__online {
        font-size: 1rem;
    }

    .chat-sidebar__input-wrap {
        padding: 0.6rem;
    }

    .chat-sidebar__input {
        font-size: 1.3rem;
    }

    /* Footer */
    .game-footer {
        padding: 1.6rem 1.2rem;
    }

    .game-footer__copyright {
        font-size: 1.1rem;
    }
}

/* Extra small devices (max-width: 400px) */
@media (max-width: 400px) {
    html {
        font-size: 55%;
    }

    .chart__control-group .btn {
        flex: 1 1 calc(50% - 0.3rem);
        font-size: 1.1rem;
    }

    .chart__stat-value {
        font-size: 1.8rem;
    }

    .chart__timer svg {
        width: 6rem;
        height: 6rem;
    }

    .chart__timer-num {
        font-size: 2rem;
    }
}

/* ========== Table Theme Fixes ========== */
/* Ensure table works in both dark and light mode */
.table--a {
    background-color: transparent;
}

.table__head {
    background-color: var(--table-th-bg);
}

.table__row--td {
    background-color: transparent;
}

.table__row--td:nth-child(even) {
    background-color: var(--table-tb-bg);
}

.table__row--td:hover {
    background-color: var(--invert-container);
}

.table__cell--th {
    color: var(--text-low);
    border-bottom: 1px solid var(--border-low);
}

.table__cell--td {
    color: var(--text-high);
    border-bottom: 1px solid var(--border-low);
}

/* Tab section background fix for theme */
.main__section-wrapper {
    background-color: var(--container);
    border: 1px solid var(--border-low);
    border-radius: 1.2rem;
    overflow: hidden;
}

.tab__list {
    background-color: var(--table-th-bg);
    border-bottom: 1px solid var(--border-low);
}

.betting-history,
.ranking-history {
    background-color: transparent;
}

/* ========== Light Mode Table Overrides (Bootstrap Override) ========== */
[data-theme="light"] .table.table--a {
    --bs-table-bg: transparent !important;
    --bs-table-color: #111111 !important;
}

[data-theme="light"] .table.table--a th,
[data-theme="light"] .table.table--a td,
[data-theme="light"] .table.table--a .table__cell--td {
    color: #111111 !important;
    background-color: transparent !important;
}

[data-theme="light"] .table.table--a .table__cell--th {
    color: #666666 !important;
}

[data-theme="light"] .main__section-wrapper {
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .table__head {
    background-color: #f5f7fa !important;
}

[data-theme="light"] .table.table--a tbody tr {
    background-color: transparent !important;
}

[data-theme="light"] .table.table--a tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02) !important;
}

[data-theme="light"] .table.table--a tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .table__cell--primary {
    color: #00c980 !important;
}

[data-theme="light"] .table__cell--secondary {
    color: #ff4868 !important;
}

[data-theme="light"] .tab__list {
    background-color: #f5f7fa !important;
    border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .tab__btn {
    color: #666666 !important;
}

[data-theme="light"] .tab__item--active .tab__btn {
    color: #111111 !important;
}

/* ========== Dark Mode Table Overrides (Bootstrap Override) ========== */
[data-theme="dark"] .table.table--a {
    --bs-table-bg: transparent !important;
    --bs-table-color: #ffffff !important;
}

[data-theme="dark"] .table.table--a th,
[data-theme="dark"] .table.table--a td,
[data-theme="dark"] .table.table--a .table__cell--td {
    color: #ffffff !important;
    background-color: transparent !important;
}

[data-theme="dark"] .table.table--a .table__cell--th {
    color: #b0b6be !important;
}

[data-theme="dark"] .main__section-wrapper {
    background-color: rgba(20, 20, 30, 0.9) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .table__head {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .table.table--a tbody tr {
    background-color: transparent !important;
}

[data-theme="dark"] .table.table--a tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

[data-theme="dark"] .table.table--a tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
}

[data-theme="dark"] .tab__list {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .tab__btn {
    color: #b0b6be !important;
}

[data-theme="dark"] .tab__item--active .tab__btn {
    color: #ffffff !important;
}

/* ========== Utility Classes ========== */
.me-1 { margin-right: 0.4rem; }
.me-2 { margin-right: 0.8rem; }
.ms-1 { margin-left: 0.4rem; }
.ms-2 { margin-left: 0.8rem; }
.gap-2 { gap: 0.8rem; }
.gap-3 { gap: 1.2rem; }

/* ========== Betting History New Row Animation ========== */
.table__row--new {
    animation: newRowHighlight 2s ease-out;
}

@keyframes newRowHighlight {
    0% {
        background-color: rgba(59, 130, 246, 0.3);
    }
    100% {
        background-color: transparent;
    }
}

.table__cell--pending {
    color: #f59e0b;
    font-weight: 500;
}

/* 배팅/승인 금액 표시 */
.table__cell-amount {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.2;
}

.table__cell-amount span:first-child {
    font-weight: 500;
}

.table__cell-approved {
    font-size: 0.85em;
    color: #10b981;
    opacity: 0.9;
}

.table__cell-approved::before {
    content: '→ ';
}
