/* R81 유저 공통 UI: 회원 헤더 · 고객센터 드롭다운 · 고객센터 모달 · 로그인 공지 팝업.
   기존 메인 테마(블랙 + 골드)와 같은 색을 쓰고, 프레임 화면은 /css/r81-frame.css 가 같은 토큰으로 맞춘다. */
:root {
	--r81-gold: #d8b45a;
	--r81-gold-strong: #b98d2c;
	--r81-gold-light: #f3d98b;
	--r81-ink: #1a1408;
	--r81-text: #ece7da;
	--r81-muted: #aaa392;
	--r81-panel: #18181b;
	--r81-panel-2: #212125;
	--r81-line: rgba(216, 180, 90, 0.35);
	--r81-line-soft: rgba(255, 255, 255, 0.1);
	--r81-radius: 12px;
	--r81-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}

html.r81-lock,
html.r81-lock body { overflow: hidden !important; }

/* ---------------- 공통 버튼 ---------------- */
.r81-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 40px;
	padding: 0 16px;
	border-radius: 10px;
	border: 1px solid transparent;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
	-webkit-tap-highlight-color: transparent;
}

.r81-btn:active { transform: translateY(1px); }

.r81-btn--gold {
	background: linear-gradient(180deg, #f0d47e, #c9993a);
	color: var(--r81-ink) !important;
}

.r81-btn--gold:hover { background: linear-gradient(180deg, #f6de96, #d4a646); }

.r81-btn--ghost {
	background: rgba(0, 0, 0, 0.35);
	border-color: rgba(255, 255, 255, 0.22);
	color: #e2dccd !important;
}

.r81-btn--ghost:hover { border-color: var(--r81-gold); color: var(--r81-gold-light) !important; }

/* ---------------- 헤더 ---------------- */
#header .header_wrap.r81-hd {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	width: 100%;
	max-width: 1500px;
	height: 80px;
	margin: 0 auto;
	padding: 0 24px;
	box-sizing: border-box;
}

#header .r81-hd__logo {
	position: static;
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
	line-height: 0;
	transform: none;
}

#header .r81-hd__logo a { display: inline-block; }

#header .r81-hd__logo-img {
	display: block;
	width: auto;
	height: auto;
	max-width: 220px;
	max-height: 56px;
	object-fit: contain;
}

#header .r81-hd__nav {
	flex: 1 1 auto;
	display: flex;
	justify-content: center;
	min-width: 0;
}

#header .r81-gnb {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

#header .r81-gnb li {
	width: auto;
	height: auto;
	min-width: 0;
	padding: 0;
	background: none;
	font-family: inherit;
}

#header .r81-gnb li:hover { background: none; }
#header .r81-gnb li::after { display: none; }

#header .r81-gnb li a {
	display: inline-flex;
	align-items: center;
	height: 40px;
	padding: 0 18px;
	border-radius: 999px;
	color: #eadfc2;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: -0.2px;
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
}

#header .r81-gnb li a:hover,
#header .r81-gnb li a.is-active {
	background: rgba(216, 180, 90, 0.16);
	color: var(--r81-gold-light);
}

#header .r81-hd__right {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
}

#header .r81-member {
	display: flex;
	align-items: center;
	gap: 14px;
	height: 44px;
	padding: 0 14px;
	border-radius: var(--r81-radius);
	border: 1px solid var(--r81-line);
	background: rgba(0, 0, 0, 0.5);
	color: var(--r81-text);
	white-space: nowrap;
}

#header .r81-member__nick {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: 160px;
	font-size: 14px;
}

#header .r81-member__nick i { color: var(--r81-gold); font-size: 18px; }
#header .r81-member__nick b { overflow: hidden; text-overflow: ellipsis; font-weight: 700; color: #fff; }
#header .r81-member__nick em { font-style: normal; color: var(--r81-muted); font-size: 12px; }

#header .r81-member__money {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	padding-left: 14px;
	border-left: 1px solid var(--r81-line-soft);
}

#header .r81-member__money em { font-style: normal; color: var(--r81-muted); font-size: 12px; }

#header .r81-member__money b.points_text {
	color: var(--r81-gold-light) !important;
	font-size: 16px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

/* 고객센터 드롭다운 */
#header .r81-cs { position: relative; }

#header .r81-cs__btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 40px;
	padding: 0 14px;
	border-radius: 10px;
	border: 1px solid rgba(216, 180, 90, 0.5);
	background: rgba(216, 180, 90, 0.1);
	color: var(--r81-gold-light);
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

#header .r81-cs__btn:hover,
#header .r81-cs.is-open .r81-cs__btn { background: rgba(216, 180, 90, 0.2); border-color: var(--r81-gold); }

#header .r81-cs__btn:focus-visible,
#header .r81-cs__menu a:focus-visible,
.r81-cs-modal button:focus-visible { outline: 2px solid var(--r81-gold-light); outline-offset: 2px; }

#header .r81-cs__caret { transition: transform 0.15s; }
#header .r81-cs.is-open .r81-cs__caret { transform: rotate(180deg); }

#header .r81-cs__menu {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 1300;
	min-width: 200px;
	margin: 0;
	padding: 6px;
	list-style: none;
	border-radius: var(--r81-radius);
	border: 1px solid var(--r81-line);
	background: #151517;
	box-shadow: var(--r81-shadow);
}

#header .r81-cs__menu[hidden] { display: none; }

#header .r81-cs__menu li { display: block; width: auto; height: auto; padding: 0; background: none; }

#header .r81-cs__menu a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 8px;
	color: #e7e1d2;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

#header .r81-cs__menu a i { width: 16px; text-align: center; color: var(--r81-gold); }
#header .r81-cs__menu a:hover { background: rgba(216, 180, 90, 0.12); color: var(--r81-gold-light); }
#header .r81-cs__menu .r81-only-m { display: none; }
#header .r81-cs__menu .r81-sep { height: 1px; margin: 5px 6px; background: var(--r81-line-soft); }

#header .r78-guest-btns { display: inline-flex; margin: 0; }

/* R82 상단 메뉴 아이콘(직접 그린 인라인 SVG, currentColor) + 활성·hover·키보드 포커스 */
#header .r81-gnb li a.r82-gnb-link { gap: 8px; border: 1px solid transparent; white-space: nowrap; }
#header .r81-gnb .r82-ico { flex: 0 0 auto; width: 20px; height: 20px; color: var(--r81-gold); transition: color 0.15s, transform 0.15s; }
#header .r81-gnb li a.r82-gnb-link:hover .r82-ico,
#header .r81-gnb li a.r82-gnb-link:focus-visible .r82-ico { color: var(--r81-gold-light); transform: translateY(-1px); }
#header .r81-gnb li a.r82-gnb-link:focus-visible { outline: 2px solid var(--r81-gold-light); outline-offset: 2px; background: rgba(216, 180, 90, 0.16); color: var(--r81-gold-light); }
#header .r81-gnb li a.r82-gnb-link:active { background: rgba(216, 180, 90, 0.26); }
#header .r81-gnb li a.r82-gnb-link.is-active { border-color: var(--r81-line); box-shadow: inset 0 -2px 0 var(--r81-gold); }
#header .r81-gnb li a.r82-gnb-link.is-active .r82-ico { color: var(--r81-gold-light); }

/* 모바일 왼쪽 패널의 카지노·슬롯 메뉴에도 같은 그림(mask) */
#header .site_gnb .gnb a[href*="casino_list_view"]::before,
#header .site_gnb .gnb a[href*="slot_list_view"]::before {
	content: '';
	display: inline-block;
	width: 18px;
	height: 18px;
	margin-right: 8px;
	vertical-align: -3px;
	background: var(--r81-gold);
	-webkit-mask: var(--r82-ico) center / contain no-repeat;
	mask: var(--r82-ico) center / contain no-repeat;
}
#header .site_gnb .gnb a[href*="casino_list_view"] { --r82-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='4.2' stroke-width='1.6'/%3E%3Cpath d='M12 3v3.2M12 17.8V21M3 12h3.2M17.8 12H21M5.6 5.6l2.3 2.3M16.1 16.1l2.3 2.3M18.4 5.6l-2.3 2.3M7.9 16.1l-2.3 2.3'/%3E%3C/svg%3E"); }
#header .site_gnb .gnb a[href*="slot_list_view"] { --r82-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='5' width='15' height='14' rx='2.5'/%3E%3Cpath d='M6.5 9.5v5M10 9.5v5M13.5 9.5v5M17.5 12h2.2V6.5'/%3E%3Ccircle cx='19.7' cy='5' r='1.7' fill='%23000'/%3E%3C/svg%3E"); }

/* PC: 새 헤더 메뉴가 기존 PC GNB 를 대신한다 (마우스오버 게임사 레이어는 .gnb li.has-sub-menu 로 그대로 동작) */
@media (min-width: 1031px) {
	#header .site_gnb { display: none; }
}

@media (max-width: 1260px) and (min-width: 1031px) {
	#header .r81-gnb li a { padding: 0 12px; font-size: 14px; }
	#header .r81-gnb li a.r82-gnb-link { gap: 6px; }
	#header .r81-gnb .r82-ico { width: 18px; height: 18px; }
	#header .r81-member__nick { max-width: 110px; }
}

/* 모바일·태블릿: 로고 · 회원정보 · 보유머니 · 메뉴 버튼(왼쪽, 기존 패널) · 고객센터 */
@media (max-width: 1030px) {
	#header .header_wrap.r81-hd {
		height: 70px;
		gap: 8px;
		padding: 0 10px 0 52px;
	}

	#header .r81-hd__nav { display: none; }
	#header .r81-hd__logo { flex: 0 1 auto; min-width: 0; }
	#header .r81-hd__logo-img { max-width: 140px; max-height: 46px; }
	#header .r81-hd__right { gap: 6px; min-width: 0; }

	#header .r81-member {
		flex-direction: column;
		align-items: flex-end;
		justify-content: center;
		gap: 1px;
		height: 46px;
		padding: 0 10px;
		min-width: 0;
	}

	#header .r81-member__nick { max-width: 110px; font-size: 11px; gap: 4px; }
	#header .r81-member__nick i { font-size: 12px; }
	#header .r81-member__nick em { display: none; }
	#header .r81-member__money { padding-left: 0; border-left: 0; gap: 4px; }
	#header .r81-member__money em { font-size: 10px; }
	#header .r81-member__money b.points_text { font-size: 14px; }

	#header .r81-cs__btn { width: 42px; height: 42px; padding: 0; justify-content: center; }
	#header .r81-cs__btn i.fa-headphones { font-size: 18px; }
	#header .r81-cs__label,
	#header .r81-cs__caret { display: none; }
	#header .r81-hd__logout { display: none; }
	#header .r81-cs__menu .r81-only-m { display: block; }
	#header .r81-cs__menu { position: fixed; top: 76px; right: 8px; left: auto; max-width: calc(100vw - 16px); }
	#header .r78-guest-btns .r81-btn { height: 38px; padding: 0 14px; font-size: 13px; }
}

@media (max-width: 400px) {
	#header .header_wrap.r81-hd { padding-right: 6px; }
	#header .r81-hd__logo-img { max-width: 96px; max-height: 40px; }
	#header .r81-member__nick { max-width: 92px; }
	#header .r81-member__nick i { display: none; }
	#header .r81-member { height: 40px; padding: 0 8px; }
}

/* ---------------- 고객센터 모달 ---------------- */
.r81-cs-modal {
	position: fixed;
	inset: 0;
	z-index: 3000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	box-sizing: border-box;
}

.r81-cs-modal[hidden] { display: none; }

.r81-cs-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.74);
	opacity: 0;
	transition: opacity 0.18s;
}

.r81-cs-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(1000px, 100%);
	height: min(780px, calc(100vh - 48px));
	border-radius: 16px;
	border: 1px solid var(--r81-line);
	background: var(--r81-panel);
	box-shadow: var(--r81-shadow);
	overflow: hidden;
	opacity: 0;
	transform: translateY(12px) scale(0.985);
	transition: opacity 0.18s, transform 0.18s;
	color: var(--r81-text);
	font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

.r81-cs-modal.is-open .r81-cs-modal__backdrop { opacity: 1; }
.r81-cs-modal.is-open .r81-cs-modal__dialog { opacity: 1; transform: none; }

.r81-cs-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px 14px 20px;
	border-bottom: 1px solid var(--r81-line-soft);
	background: linear-gradient(180deg, #221e16, var(--r81-panel));
}

.r81-cs-modal__brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.r81-cs-modal__brand i { color: var(--r81-gold); font-size: 18px; }

.r81-cs-modal__brand h2 {
	margin: 0;
	font-size: 17px;
	font-weight: 800;
	color: var(--r81-gold-light);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.r81-cs-modal__close {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	background: rgba(0, 0, 0, 0.3);
	color: #ddd6c6;
	font-size: 18px;
	cursor: pointer;
}

.r81-cs-modal__close:hover { color: var(--r81-gold-light); border-color: var(--r81-gold); }

.r81-cs-modal__tabs {
	display: flex;
	gap: 6px;
	padding: 10px 16px;
	overflow-x: auto;
	border-bottom: 1px solid var(--r81-line-soft);
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}

.r81-cs-modal__tab {
	flex: 0 0 auto;
	height: 34px;
	padding: 0 14px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: transparent;
	color: #d3ccbc;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
}

.r81-cs-modal__tab:hover { border-color: var(--r81-gold); color: var(--r81-gold-light); }

.r81-cs-modal__tab.is-active {
	background: var(--r81-gold);
	border-color: var(--r81-gold);
	color: var(--r81-ink);
}

.r81-cs-modal__body {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	background: var(--r81-panel);
}

.r81-cs-modal__body iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	background: var(--r81-panel);
}

.r81-cs-modal__body.is-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 30px;
	height: 30px;
	margin: -15px 0 0 -15px;
	border-radius: 50%;
	border: 3px solid rgba(216, 180, 90, 0.25);
	border-top-color: var(--r81-gold);
	animation: r81-spin 0.8s linear infinite;
}

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

@media (max-width: 767px) {
	.r81-cs-modal { padding: 0; }
	.r81-cs-modal__dialog {
		width: 100%;
		height: 100vh;
		height: 100dvh;
		border-radius: 0;
		border: 0;
	}
	.r81-cs-modal__head { padding: 10px 10px 10px 14px; }
	.r81-cs-modal__tabs { padding: 8px 10px; }
}

/* ---------------- 공지 팝업 (R81.1) ----------------
   기존 하드코딩 멀티팝업(main/middle_default.html #multiPopupContainer)의 값을 그대로 쓴다.
   PC: 위 80px, 폭 90%(최대 1920px), 가운데 flex-wrap, 간격 2px, 칸 340px → 화면 폭에 따라 열 수 자동.
   모바일(768px 이하): 헤더 바로 아래 한자리에 겹친다. 우선순위가 앞선 칸만 보이고, 길면 칸 안에서 스크롤한다. */
.r81-mp {
	position: fixed;
	top: 80px;
	left: 50%;
	transform: translateX(-50%);
	width: 90%;
	max-width: 1920px;
	max-height: calc(100vh - 90px);
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	display: flex;
	flex-wrap: wrap;
	align-content: flex-start;
	gap: 2px;
	justify-content: center;
	z-index: 5000;
	pointer-events: none;
	scrollbar-width: thin;
}

.r81-mp[hidden] { display: none; }

.r81-mp .ksp-item {
	flex: 0 0 auto;
	position: relative;
	width: 340px;
	pointer-events: auto;
}

.r81-mp .ksp {
	border-radius: 0;
	background-color: #fff;
}

.r81-mp .ksp--plain {
	background: linear-gradient(160deg, #2b2416 0%, #17140e 55%, #0d0d0d 100%);
}

.r81-mp .ksp-item__btn:focus-visible,
.r81-mp .ksp-item__today input:focus-visible { outline: 2px solid #014e02; outline-offset: 1px; }

@media (max-width: 768px) {
	.r81-mp {
		top: 70px;
		left: 0;
		right: 0;
		transform: none;
		width: auto;
		max-width: 100%;
		height: auto;
		max-height: none;
		overflow: visible;
		display: block;
		padding: 8px;
		padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
		box-sizing: border-box;
		z-index: 5000;
	}
	.r81-mp .ksp-item {
		display: none;
		position: relative;
		left: auto !important;
		top: auto !important;
		right: auto !important;
		bottom: auto !important;
		transform: none !important;
		width: 100%;
		max-width: 100%;
		min-width: 0;
		margin: 0;
		max-height: calc(var(--r81-mp-max, calc(100vh - 78px)) - env(safe-area-inset-bottom, 0px));
		max-height: calc(var(--r81-mp-max, calc(100dvh - 78px)) - env(safe-area-inset-bottom, 0px));
		flex-direction: column;
		overflow: hidden;
	}
	.r81-mp .ksp-item:first-child { display: flex; }
	.r81-mp .ksp {
		width: 100% !important;
		max-width: 100%;
		min-width: 0;
		min-height: 0;
		flex: 1 1 auto;
		overflow-x: hidden;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}
	.r81-mp .ksp:not(.ksp--plain) { height: auto !important; }
	.r81-mp .ksp img,
	.r81-mp .ksp__bg {
		display: block;
		width: 100% !important;
		max-width: 100% !important;
		height: auto !important;
		object-fit: contain;
	}
	.r81-mp .ksp__txt {
		max-width: 100%;
		max-height: none !important;
		overflow: visible !important;
	}
	.r81-mp .ksp-item__close {
		flex: 0 0 auto;
		min-height: 44px;
		padding: 8px 10px !important;
		background: #fff;
	}
	.r81-mp .ksp-item__today {
		min-height: 32px;
		padding: 4px 0 !important;
	}
	.r81-mp .ksp-item__today input {
		width: 18px !important;
		height: 18px !important;
	}
	.r81-mp .ksp-item__btn {
		min-height: 32px;
		min-width: 44px;
		padding: 8px 12px !important;
	}
}

/* 하단 업체 로고(관리자 설정 이미지). 기존 .footer_top .logo img 높이 60px 안에서 비율 유지 */
.footer_top .logo img.r811-footer-logo {
	width: auto;
	max-width: min(400px, 90vw);
	object-fit: contain;
}
