:root {
	--ld-muted: #888;
	--ld-line: rgba(255, 255, 255, 0.08);
	--ld-box-bg: rgba(0, 0, 0, 0.14);
	--ld-head-bg: rgba(0, 0, 0, 0.35);
}

body[data-page="live-draw"] .main-content {
	grid-template-columns: minmax(0, 1fr);
}

body[data-page="live-draw"] .cat-head {
	background: var(--surface);
}

body[data-page="live-draw"]:not([data-maintenance="1"]) .panel--sidebar {
	display: none;
}

.ld-board {
	background:
		radial-gradient(circle at 0% 0%, rgba(40, 90, 255, 0.18), transparent 42%),
		radial-gradient(circle at 100% 0%, rgba(255, 80, 140, 0.14), transparent 40%),
		radial-gradient(circle at 40% 120%, rgba(80, 255, 170, 0.10), transparent 45%),
		linear-gradient(180deg, #0b1223, #070a12);
	margin: 0 calc(-1 * var(--pad)) calc(-1 * var(--pad));
}

.ld-board h2 {
	color: var(--white);
	margin: 0;
	font-size: 22px;
	margin: 4px 0 var(--gap) 0;
}

.ld-layout {
	display: grid;
	grid-template-columns: 1fr 320px;
	gap: var(--gap);
	padding: var(--pad);
}

.ld-col-left {
	display: flex;
	flex-direction: column;
	gap: var(--gap);
	min-width: 0;
}

.ld-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--gap);
	align-items: stretch;
	min-width: 0;
}

.ld-row .ld-sec {
	display: flex;
	flex-direction: column;
}

.ld-row .ld-box {
	flex: 1;
}

.ld-col-right {
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.ld-sec {
	min-width: 0;
}

.ld-sec--other,
.ld-sec--latest,
.ld-sec--chat {
	border: 1px solid var(--ld-line);
	padding: 0 var(--pad) var(--pad);
}

.ld-sec--chat {
	height: 100%;
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
}

.ld-box {
	background: var(--ld-box-bg);
	border: 1px solid var(--ld-line);
	padding: var(--pad);
	min-width: 0;
}

.ld-sec--other .ld-box,
.ld-sec--latest .ld-box {
	background: transparent;
	border: 0;
	padding: 0;
}

.ld-sec--chat .ld-box {
	background: var(--ld-box-bg);
	border: 1px solid var(--ld-line);
	padding: var(--pad);
}

.ld-sec--main .ld-box {
	min-height: 210px;
}

.ld-row .ld-box {
	min-height: 350px;
}

.ld-box--chat {
	flex: 1;
	min-height: 0;
	overflow: hidden;
}

#ldMainFeature {
	display: flex;
	align-items: stretch;
	justify-content: space-between;
	gap: var(--gap);
	min-height: 200px;
}

.ld-mf-info {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: var(--gap);
	min-width: 0;
}

.ld-mf-balls {
	align-self: center;
}

.ld-mf-date,
.ld-mf-next {
	color: var(--ld-muted);
	font-size: 20px;
}

.ld-mf-next-mobile {
	display: none;
}

.ld-mf-name {
	font-size: 60px;
	line-height: 1;
	font-weight: 900;
	color: var(--white);
	text-transform: uppercase;
}

.ld-mf-next b {
	color: var(--white);
}

.ld-mf-balls {
	display: flex;
	gap: var(--gap);
	flex: 1;
	justify-content: flex-end;
	align-items: center;
	max-width: 55%;
}

.ld-ball {
	width: 100px;
	height: 100px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-size: 36px;
	font-weight: 900;
	color: var(--white);
	background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 60%), #232a3e;
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
}

.ld-ball--wait {
	position: relative;
	overflow: hidden;
	background: #1a2030;
}

.ld-shimmer {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		100deg,
		transparent 30%,
		rgba(255, 255, 255, 0.18) 50%,
		transparent 70%
	);
	transform: translateX(-100%);
	animation: ldShimmer 1.4s linear infinite;
}

@keyframes ldShimmer {
	to {
		transform: translateX(100%);
	}
}

#ldOtherList {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.ld-list-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 9px;
	background: var(--ld-box-bg);
	border: 1px solid var(--ld-line);
	min-width: 0;
}

.ld-li-info {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.ld-li-name {
	color: var(--white);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ld-li-time {
	color: var(--ld-muted);
}

.ld-li-balls {
	display: flex;
	gap: var(--gap);
	flex-shrink: 0;
}

.ld-li-ball {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-weight: bold;
	color: var(--white);
	background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 60%), #2a3146;
}

.ld-sec-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.ld-sec-time {
	color: var(--ld-muted);
}

.ld-table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid var(--ld-line);
}

.ld-table th {
	color: var(--ld-muted);
	text-transform: uppercase;
	font-weight: bold;
	text-align: left;
	padding: var(--pad);
	background: var(--ld-head-bg);
	border-bottom: 1px solid var(--ld-line);
}

.ld-table th.ld-td-time {
	text-align: right;
}

.ld-table td {
	padding: var(--pad);
	border-bottom: 1px solid var(--ld-line);
}

.ld-table tr:last-child td {
	border-bottom: 0;
}

.ld-td-name {
	color: var(--white);
	text-align: left;
}

.ld-td-result {
	width: 1%;
	white-space: nowrap;
}

.ld-td-balls {
	display: flex;
	gap: var(--gap);
}

.ld-td-time {
	color: var(--ld-muted);
	text-align: right;
	white-space: nowrap;
}

.ld-mini-ball {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-weight: bold;
	color: var(--white);
	background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0) 60%), #1e6bff;
}

.ld-tr-time {
	color: var(--ld-muted);
	white-space: nowrap;
}

.ld-running {
	overflow: hidden;
	white-space: nowrap;
	background: var(--ld-box-bg);
	border-top: 1px solid var(--ld-line);
	border-bottom: 1px solid var(--ld-line);
	padding: var(--pad) 0;
}

.running-text__inner {
	display: inline-block;
	padding-left: 100%;
	color: var(--ld-muted);
	font-weight: bold;
	animation: ldMarquee 28s linear infinite;
}

@keyframes ldMarquee {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(-100%);
	}
}

.ld-ball-b {
	position: relative;
	overflow: hidden;
}

.ld-ball-b .ld-ball-num {
	position: relative;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 60%;
	height: 60%;
	border-radius: 50%;
	background: var(--white);
	color: #111;
	font-weight: 900;
	font-size: 0;
	line-height: 1;
}

.ld-mini-ball .ld-ball-num {
	font-size: 15px;
}

.ld-li-ball .ld-ball-num {
	font-size: 17px;
}

.ld-ball .ld-ball-num {
	font-size: 32px;
}

.ld-ball-b {
	background-image: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 55%);
}

.ld-ball-c0 { background-color: #5b6477; }
.ld-ball-c1 { background-color: #f6cb3e; }
.ld-ball-c2 { background-color: #3b73e0; }
.ld-ball-c3 { background-color: #e24b43; }
.ld-ball-c4 { background-color: #8159c8; }
.ld-ball-c5 { background-color: #ef8c3a; }
.ld-ball-c6 { background-color: #36ab63; }
.ld-ball-c7 { background-color: #a23c4a; }
.ld-ball-c8 { background-color: #2c2c2c; }
.ld-ball-c9 { background-color: #d4af3c; }

#ldChatBox {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: var(--gap);
	overflow: hidden;
	height: 805px;
	flex: none;
}

.ld-chat-item {
	display: flex;
	gap: var(--gap);
	align-items: flex-start;
}

.ld-chat-ava {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	flex-shrink: 0;
	display: grid;
	place-items: center;
	background: rgba(255, 255, 255, 0.1);
	color: var(--white);
	font-weight: bold;
}

.ld-chat-body {
	min-width: 0;
	line-height: 1.4;
}

.ld-chat-user {
	color: var(--white);
	font-weight: bold;
}

.ld-chat-text {
	color: var(--ld-muted);
	font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.ld-chat-at {
	color: var(--orange);
}

.ld-chat-handle {
	display: none;
}

.ld-chat-backdrop {
	display: none;
}

.ld-latest-mobile {
	display: none;
}

@media (max-width: 768px) {
	.ld-layout {
		grid-template-columns: 1fr;
	}

	.ld-row {
		grid-template-columns: 1fr;
	}
    
    .ld-mf-date,
    .ld-mf-next{
        font-size: 15px;
    }

	.ld-row .ld-box {
		min-height: auto;
	}

	.ld-board h2 {
		font-size: 18px;
	}

	#ldMainFeature {
		flex-direction: column;
		align-items: stretch;
	}

	.ld-mf-info {
		align-items: center;
		text-align: center;
	}

	.ld-mf-name {
		font-size: 32px;
	}

	.ld-mf-balls {
		max-width: 100%;
		justify-content: center;
	}

	.ld-ball {
		width: 68px;
		height: 68px;
		font-size: 26px;
	}

	.ld-ball .ld-ball-num {
		font-size: 24px;
	}

	.ld-mf-next-desktop {
		display: none;
	}

	.ld-mf-next-mobile {
		display: block;
		text-align: center;
	}
	
	.ld-td-balls,
	.ld-li-balls {
		gap: 4px;
	}
	
	.ld-latest-desktop {
		display: none;
	}

	.ld-latest-mobile {
		display: flex;
		flex-direction: column;
	}
	
	.ld-latest-item {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: var(--pad);
		border: 1px solid var(--ld-line);
	}

	.ld-latest-info {
		display: flex;
		flex-direction: column;
		min-width: 0;
	}

	.ld-latest-name {
		color: var(--white);
	}

	.ld-latest-time {
		color: var(--ld-muted);
	}

	.ld-latest-balls {
		display: flex;
		gap: 4px;
		flex-shrink: 0;
	}
	
	.ld-latest-head {
		display: flex;
		justify-content: space-between;
		padding: var(--pad);
		background: var(--ld-head-bg);
		border: 1px solid var(--ld-line);
		color: var(--ld-muted);
		text-transform: uppercase;
		font-weight: bold;
	}
	
	.ld-sec--chat {
		position: fixed;
		top: calc(var(--header-float-h) + var(--headline-float-h) + 41px + var(--mg));
		bottom: calc(90px + var(--mg));
		height: auto;
		right: 0;
		width: 80vw;
		background: var(--black);
		overflow: visible;
		transform: translateX(100%);
		transition: transform 0.3s ease;
		box-shadow: -4px 0 16px rgba(0, 0, 0, 0.5);
		z-index: 10001;
	}

	body.ld-chat-open .ld-sec--chat {
		transform: translateX(0);
		top: calc(var(--header-float-h) + var(--headline-float-h) + 41px + var(--mg) + 15px);
	}

	#ldChatBox {
		flex: 1;
		height: auto;
		min-height: 0;
	}

	.ld-chat-handle {
		display: flex;
		position: absolute;
		top: 15px;
		left: -41px;
		width: 41px;
		height: 41px;
		align-items: center;
		justify-content: center;
		padding: 0;
		border: 0;
		background: var(--orange);
		color: var(--white);
		cursor: pointer;
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.3s ease;
	}

	body.ld-chat-ready .ld-chat-handle,
	body.ld-chat-open .ld-chat-handle {
		opacity: 1;
		pointer-events: auto;
	}

	body.ld-chat-open .ld-chat-handle {
		top: -1px;
	}

	.ld-chat-ico {
		width: 24px;
		height: 24px;
	}

	.ld-chat-arrow {
		display: none;
		width: 25px;
		height: 25px;
	}

	body.ld-chat-open .ld-chat-ico {
		display: none;
	}

	body.ld-chat-open .ld-chat-arrow {
		display: block;
	}

	.ld-chat-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.5);
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.3s ease;
		z-index: 10000;
	}

	body.ld-chat-open .ld-chat-backdrop {
		opacity: 1;
		pointer-events: auto;
	}

	body.ld-chat-open {
		overflow: hidden;
	}
}