/* IMPORT FONT BALOO 2 LOKAL */
@font-face { font-family: 'Baloo 2'; src: url('assets/font/Baloo2-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'Baloo 2'; src: url('assets/font/Baloo2-Medium.ttf') format('truetype'); font-weight: 500; font-style: normal; }
@font-face { font-family: 'Baloo 2'; src: url('assets/font/Baloo2-SemiBold.ttf') format('truetype'); font-weight: 600; font-style: normal; }
@font-face { font-family: 'Baloo 2'; src: url('assets/font/Baloo2-Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; }
@font-face { font-family: 'Baloo 2'; src: url('assets/font/Baloo2-ExtraBold.ttf') format('truetype'); font-weight: 800; font-style: normal; }

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;800&display=swap');

* { 
    box-sizing: border-box; margin: 0; padding: 0; font-family: 'Baloo 2', 'Poppins', sans-serif; 
    -ms-overflow-style: none; scrollbar-width: none;
    -webkit-user-select: none; -ms-user-select: none; user-select: none;
}
input, textarea, select { -webkit-user-select: auto; -ms-user-select: auto; user-select: auto; }
img { -webkit-user-drag: none; -khtml-user-drag: none; -moz-user-drag: none; -o-user-drag: none; user-drag: none; }

body { background-color: #0f2027; margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; min-height: 100vh; overflow: hidden; position: relative; }

#app-container {
    width: 540px; height: 960px; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%); transform-origin: center center;
    background: url('assets/game/bg2.jpg') center top/cover no-repeat; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

.landing-logo { width: 85%; max-width: 450px; animation: pulseLogo 2.5s infinite ease-in-out; filter: drop-shadow(0 10px 15px rgba(0,0,0,0.5)); }

.footer-branding { position: absolute; bottom: 25px; left: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; z-index: 10; }
.footer-branding p, .footer-branding img { pointer-events: auto; margin: 0; }

.img-btn { width: 70%; max-width: 320px; cursor: pointer; transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.2s; filter: drop-shadow(0 5px 10px rgba(0,0,0,0.4)); }
.img-btn:active { transform: scale(0.92); filter: drop-shadow(0 2px 5px rgba(0,0,0,0.6)); }

@keyframes pulseLogo { 0% { transform: scale(1) translateY(0); } 50% { transform: scale(1.03) translateY(-10px); } 100% { transform: scale(1) translateY(0); } }

.login-header-text { width: 75%; max-width: 300px; margin-bottom: 25px; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4)); }

.custom-login-box { background: url('assets/game/login/loginbox2.png') center/100% 100% no-repeat; width: 85%; max-width: 360px; padding: 40px 25px 30px 25px; position: relative; display: flex; flex-direction: column; align-items: center; filter: drop-shadow(0 15px 25px rgba(0,0,0,0.6)); margin-top: -100px; }
.login-symbol { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); width: 45px; z-index: 2; }
.custom-login-box h2 { font-weight: 700; color: #ffffff; font-size: 24px; margin-bottom: 5px; text-shadow: none; }
.login-subtitle { font-weight: 500; color: #e0e0e0; font-size: 14px; margin-bottom: 25px; }

.input-wrapper { width: 100%; height: 48px; background-size: 100% 100%; background-position: center; background-repeat: no-repeat; margin-bottom: 10px; position: relative; display: flex; align-items: center; }
.input-icon-left { position: absolute; left: 12px; height: 65%; max-height: 40px; object-fit: contain; z-index: 2; pointer-events: none; }
.input-icon-right { position: absolute; right: 25px; height: 35%; max-height: 20px; object-fit: contain; cursor: pointer; z-index: 2; transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.input-icon-right:active { transform: scale(0.85); }

.input-wrapper input { width: 100%; height: 100%; background: transparent !important; border: none !important; box-shadow: none !important; padding: 0 50px 0 65px; font-family: 'Baloo 2', sans-serif; font-size: 16px; font-weight: 600; color: #333333; text-align: left; outline: none; position: relative; z-index: 1; }
.input-wrapper input:focus { background: transparent !important; box-shadow: none !important; outline: none !important; }
.input-wrapper input::placeholder { color: rgba(51, 51, 51, 0.5); font-weight: 500; }

.forgot-password-link { color: #f1c40f; font-size: 13px; font-weight: 700; text-decoration: none; align-self: flex-end; margin-top: -5px; margin-bottom: 15px; transition: filter 0.2s, transform 0.2s; text-shadow: 1px 1px 3px rgba(0,0,0,0.8); cursor: pointer; }
.forgot-password-link:active { transform: scale(0.95); filter: brightness(0.8); }
.forgot-password-link:hover { text-decoration: underline; filter: brightness(1.2); }

.glass-card { margin: auto; background: rgba(15, 32, 39, 0.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.15); padding: 25px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); text-align: center; width: 90%; max-width: 400px; color: #fff; }
.win-box-fill { background-color: #0f2027; background-image: none; border: 2px solid #f1c40f; border-radius: 12px; }

h2 { margin-bottom: 20px; text-shadow: 1px 1px 2px rgba(0,0,0,0.4); color: #fff; }

input:not([type="checkbox"]):not(#usernameInput):not(#passwordInput):not(.reg-input) { padding: 14px; width: 100%; border: none; border-radius: 8px; margin-bottom: 15px; font-size: 14px; background: rgba(255,255,255,0.9); box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); outline: none; transition: 0.3s; color: #333; }
input:focus:not([type="checkbox"]):not(#usernameInput):not(#passwordInput):not(.reg-input) { background: #fff; box-shadow: 0 0 10px rgba(52, 152, 219, 0.5); }

select, select.reg-input, .theme-select, .custom-pick-select { width: 100%; padding: 10px 30px 10px 15px !important; margin-bottom: 15px; font-size: 14px; font-family: 'Baloo 2', 'Poppins', sans-serif; background: #f5eedc url('data:image/svg+xml;utf8,<svg fill="%23d49a36" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>') no-repeat right 10px center !important; background-size: 24px !important; border: 2px solid #d49a36 !important; border-radius: 12px !important; color: #4a3b2c !important; font-weight: 800 !important; box-shadow: inset 0px 2px 0px rgba(255, 255, 255, 0.7), 0px 2px 4px rgba(0, 0, 0, 0.3) !important; appearance: none !important; -webkit-appearance: none !important; -moz-appearance: none !important; cursor: pointer; outline: none; transition: transform 0.2s, filter 0.2s; }
select:focus { filter: brightness(1.05); }
select:disabled { opacity: 0.6; cursor: not-allowed; }
select option { background: #f5eedc !important; color: #4a3b2c !important; font-weight: bold; }

.mode-select-wrapper { width: 100%; display: flex; align-items: center; justify-content: center; background: transparent !important; }
.custom-pick-select { width: 95%; font-size: 11.5px !important; margin-bottom: 0 !important; padding: 6px 25px 6px 10px !important; text-align: center; }

button { padding: 14px; font-weight: bold; border: none; border-radius: 8px; cursor: pointer; width: 100%; font-size: 15px; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); text-transform: uppercase; letter-spacing: 1px; }
.btn-primary { background: #3498db; color: white; box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4); }
.btn-primary:hover:not(:disabled) { background: #2980b9; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(52, 152, 219, 0.6); }
.btn-primary:active { transform: scale(0.95); }
.btn-success { background: #2ecc71; color: white; box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4); }
.btn-success:hover:not(:disabled) { background: #27ae60; transform: translateY(-2px); }
.btn-success:active { transform: scale(0.95); }
.btn-action { background: #e74c3c; color: white; margin-top: 10px; }
.btn-action:hover:not(:disabled) { background: #c0392b; transform: scale(1.05); }
.btn-action:active { transform: scale(0.95); }
button:disabled { background: rgba(255,255,255,0.2) !important; color: rgba(255,255,255,0.5) !important; cursor: not-allowed; box-shadow: none !important; transform: none !important; }
.header-controls { display: flex; gap: 10px; }
.btn-sm { padding: 8px 12px; font-size: 12px; width: auto; }
.btn-warning { background: #f39c12; color: white; box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4); }
.btn-warning:hover { background: #d35400; transform: translateY(-2px); }
.btn-danger { background: #c0392b; color: white; box-shadow: 0 4px 15px rgba(192, 57, 43, 0.4); }
.btn-danger:hover { background: #a93226; transform: translateY(-2px); }

.error { color: #ff7675; margin-top: 10px; font-weight: 600; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); text-align: center; }

#gameOverModal, #confirmModal, #customAlertModal, #joinRoomModal, #invalidCodeModal, #dkBankConfirmModal { animation: fadeInModal 0.3s ease-out forwards; z-index: 9999; }
#gameOverModal .glass-card, #confirmModal .custom-popup-box, #customAlertModal .custom-popup-box, #joinRoomModal .custom-popup-box, #invalidCodeModal .custom-popup-box, #dkBankConfirmModal .custom-popup-box { animation: popUpBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

@keyframes fadeInModal { from { background: rgba(0, 0, 0, 0); backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); } to { background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); } }
@keyframes popUpBounce { 0% { transform: scale(0.4) translateY(100px); opacity: 0; } 50% { transform: scale(1.05) translateY(-10px); opacity: 1; } 100% { transform: scale(1) translateY(0); opacity: 1; } }

::-webkit-scrollbar { width: 0px; display: none; }

.blur-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.reg-container-wrapper { position: relative; width: 90%; max-width: 420px; display: flex; flex-direction: column; align-items: center; }
.custom-reg-box { width: 100%; background: url('assets/game/register/boxbg.png') center/100% 100% no-repeat; padding: 35px 20px 20px 20px; display: flex; flex-direction: column; align-items: center; filter: drop-shadow(0 15px 25px rgba(0,0,0,0.6)); }
.custom-reg-box::-webkit-scrollbar { width: 0; display: none; }

.reg-title { width: 80%; margin-bottom: 5px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); }
.reg-divider { width: 100%; height: auto; margin: 2px 0 10px 0; }
.reg-input { background: url('assets/game/register/detail.png') center/100% 100% no-repeat !important; border: none !important; box-shadow: none !important; width: 100%; height: 40px; padding: 0 15px; margin-bottom: 6px; color: #4a3b2c; font-weight: 600; font-size: 13px; outline: none; transition: filter 0.2s; flex-shrink: 0; }
.reg-input::placeholder { color: #8c735d; font-weight: 500; }
.reg-input:focus { filter: brightness(1.05); }

.reg-tos-container { text-align: left; margin-bottom: 5px; font-size: 13px; display: flex; align-items: center; gap: 8px; width: 100%; padding: 0 5px; flex-shrink: 0; }
.reg-checkbox { width: 18px; height: 18px; margin: 0; cursor: pointer; accent-color: #f1c40f; }
.reg-tos-container label { color: #ffffff; font-weight: 500; }
.reg-link { color: #2ecc71; text-decoration: none; font-weight: bold; }
.error-floating { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); width: max-content; max-width: 100%; color: #ff7675; margin-top: 15px; font-weight: 700; font-size: 15px; text-shadow: 1px 1px 3px rgba(0,0,0,0.8); text-align: center; background: rgba(0, 0, 0, 0.6); padding: 8px 16px; border-radius: 8px; z-index: 100; }
.error-floating:empty { display: none; }

.fade-in-screen { animation: fadeInScreen 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards; }
@keyframes fadeInScreen { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popUpSlight { 0% { opacity: 0; transform: scale(0.9) translateY(20px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }

/* HOME / LOBBY STYLES REVISION */
.home-header { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 20px; padding-top: 10px; }
.header-left { display: flex; align-items: center; gap: 15px; }
.home-symbol { width: 45px; height: 45px; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5)); }
.home-welcome { display: flex; flex-direction: column; text-align: left; }
.welcome-label { color: #fff; font-size: 14px; font-weight: 500; line-height: 1; }
.welcome-name { color: #f1c40f; font-size: 20px; font-weight: 800; line-height: 1.2; text-transform: uppercase; text-shadow: 1px 1px 3px rgba(0,0,0,0.8); }

.header-logout-btn { width: 90px; object-fit: contain; cursor: pointer; transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3)); }
.header-logout-btn:active { transform: scale(0.92); }

.home-tourney-box { width: 100%; aspect-ratio: 932 / 396; position: relative;  background-size: 100% 100% !important; background-position: center !important; background-repeat: no-repeat !important; transition: background-image 0.4s ease-in-out; animation: popUpSlight 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
#tourneyFallback { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; opacity: 1; transform: scale(1); pointer-events: auto; transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.tourney-content { position: absolute; top: 0; left: 0; width: 100%; height: 100%; padding-left: 8%; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; opacity: 0; transform: scale(0.9) translateY(20px); pointer-events: none; transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

.live-badge { width: 80px; height: auto; object-fit: contain; margin-bottom: 5px; }
.tourney-title { color: #fff; font-size: 36px; line-height: 1.1; text-align: left; margin-bottom: 3px; text-shadow: 2px 2px 4px rgba(0,0,0,0.8); }
.tourney-info-row { display: flex; align-items: center; gap: 10px; margin-bottom: 0px; }
.tourney-icon { width: 30px; height: 30px; object-fit: contain;}
.tourney-info-text { display: flex; flex-direction: column; }
.info-label { font-size: 10px; color: #f1c40f; font-weight: 700; }
.info-value { font-size: 12px; color: #fff; font-weight: 600; }

.tourney-enter-btn { width: 220px; margin-top: 10px; cursor: pointer; transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.tourney-enter-btn:active { transform: scale(0.92); }

.home-actions { display: flex; justify-content: space-between; width: 100%; gap: 10px; margin-bottom: 2px; }
.home-action-btn { width: 48%; cursor: pointer; transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4)); }
.home-action-btn:active { transform: scale(0.95); }

.tourney-slide-item { min-width: 100%; height: 100%; position: relative; background-size: 100% 100%; background-position: center; background-repeat: no-repeat; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding-left: 8%; }
.tourney-slide-logo { width: 80px; height: 80px; object-fit: contain; margin-bottom: 10px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); }

.tourney-nav-btn { position: absolute; scale: 0.7; top: 50%; transform: translateY(-50%); background: rgba(0, 0, 0, 0.6); color: #f1c40f; border: 2px solid #f1c40f; cursor: pointer; font-size: 16px; font-weight: bold; border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; z-index: 10; transition: background 0.3s, transform 0.2s; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); box-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.tourney-nav-btn:hover { background: rgba(241, 196, 15, 0.2); }
.tourney-nav-btn.prev { left: 3px; }
.tourney-nav-btn.next { right: 3px; }

/* ================= TOURNAMENT DASHBOARD REVISED NEW STYLES ================= */
.td-main-box {
    width: 100%;
    aspect-ratio: 932 / 1029;
    background: url('assets/tourdashboard/bg.png') center/100% 100% no-repeat;
    /* Diberikan padding-bottom ekstra (85px) agar Sticky Bottom Box tidak menutupi item terakhir */
    padding: 25px 20px 85px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
}

.td-roadmap-item {
    width: 100%;
    aspect-ratio: 824 / 179;
    background: url('assets/tourdashboard/bgsc.png') center/100% 100% no-repeat;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5% 0 7%;
    position: relative;
    flex-shrink: 0;
}

.td-roadmap-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
}

.td-roadmap-right {
    width: 38%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding-left: 20px;
}

.td-standing-item {
    width: 100%;
    aspect-ratio: 760 / 148;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    flex-shrink: 0;
}

.btn-disabled-grey { background: rgba(255,255,255,0.2) !important; color: rgba(255,255,255,0.5) !important; cursor: not-allowed; box-shadow: none !important; }

/* -------------------------------------------------------------
   STYLE DINAMIS (ROADMAP & ANIMASI GLOW) YANG SEBELUMNYA DI JS
   ------------------------------------------------------------- */
@keyframes whiteGlowBreath {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.2)); }
    50% { filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.9)); }
}

.roadmap-grayscale {
    filter: grayscale(100%);
    opacity: 0.55;
    pointer-events: none;
}

.roadmap-active-glow {
    animation: whiteGlowBreath 2s infinite ease-in-out;
    z-index: 5;
    border-radius: 12px;

}

.eliminated-highlight { 
    border-left: 4px solid #e74c3c !important; 
    background: rgba(231, 76, 60, 0.15) !important; 
    animation: pulseRed 2s infinite ease-in-out; 
}

@keyframes pulseRed { 
    0% { box-shadow: 0 0 0px rgba(231,76,60,0); } 
    50% { box-shadow: 0 0 15px rgba(231,76,60,0.8); } 
    100% { box-shadow: 0 0 0px rgba(231,76,60,0); } 
}

.future-grayscale { 
    opacity: 0.4 !important; 
    filter: grayscale(100%) !important; 
    border-left: 4px solid #555 !important; 
}
/* ------------------------------------------------------------- */

/* ANNOUNCEMENT AREA */
.home-announcements { width: 500px; height: 180px ; position: relative; display: flex; flex-direction: column; justify-content: flex-start; background: url('assets/game/home/acbg.png'); background-size: 100%; background-repeat: no-repeat; border-radius: 12px; transition: box-shadow 0.5s ease-in-out; }
@keyframes announceGlow { 0% { box-shadow: 0 0 0px rgba(241, 196, 15, 0); } 50% { box-shadow: 0 0 20px rgba(241, 196, 15, 0.8), inset 0 0 15px rgba(241, 196, 15, 0.5); } 100% { box-shadow: 0 0 0px rgba(241, 196, 15, 0); } }
.glow-active { animation: announceGlow 1.5s ease-in-out 2; }
.ac-header { display: flex; justify-content: space-between; align-items: center; padding: 7% 5% 2% 32%; width: 100%; }
.ac-title-text { color: #f1c40f; font-size: 16px; font-weight: 800; margin: 0; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); }
.ac-list { list-style: none; padding: 0 5% 0 32%; margin: 0; max-height: 60%; overflow-y: auto; }
.ac-list li { display: flex; align-items: flex-start; margin-bottom: 12px; font-size: 12px; }
.ac-mark { width: 12px; height: 12px; margin-right: 8px; margin-top: 3px; flex-shrink: 0; }
.ac-text { color: #fff; flex-grow: 1; white-space: normal; line-height: 1.3; }
.ac-date { color: #f1c40f; font-weight: 600; margin-left: 10px; flex-shrink: 0; white-space: nowrap; }

/* AD BANNER SLIDER STYLES */
.home-ad-banner { width: 100%; aspect-ratio: 941 / 255; border-radius: 12px; box-shadow: 0 8px 15px rgba(0,0,0,0.4); position: relative; overflow: hidden; background: rgba(0,0,0,0.2);margin-top: 8px; }
.ad-slider-track { display: flex; width: 100%; height: 100%; transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); }
.ad-slide { min-width: 100%; height: 100%; background-size: 100% 100%; background-position: center; background-repeat: no-repeat; }
.ad-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0, 0, 0, 0.4); color: white; border: none; cursor: pointer; font-size: 14px; font-weight: bold; border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; z-index: 10; transition: background 0.3s, transform 0.2s; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.ad-nav-btn.prev { left: 8px; }
.ad-nav-btn.next { right: 8px; }

/* CUSTOM POPUP MODALS STYLES */
.custom-popup-box { background-size: 100% 100%; background-repeat: no-repeat; background-position: center; display: flex; flex-direction: column; align-items: center; justify-content: center; filter: drop-shadow(0 15px 25px rgba(0,0,0,0.6)); box-sizing: border-box; overflow: hidden; margin: 0 auto; }
.popup-type-join { width: 90%; max-width: 360px; aspect-ratio: 744 / 486; padding: 30px 20px; }
.popup-type-disconnect { width: 90%; max-width: 360px; aspect-ratio: 746 / 410; padding: 20px 20px 25px 20px; }
.popup-input-wrapper { width: 95%; height: 50px; background-size: 80%; background-repeat: no-repeat; background-position: center; margin-bottom: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.popup-input-wrapper input { width: 85%; height: 100%; background: transparent !important; border: none !important; box-shadow: none !important; text-align: center; font-weight: 800; font-size: 18px; letter-spacing: 2px; color: #333333; outline: none !important; padding: 0; margin-top: 15px; }
.popup-input-wrapper input::placeholder { color: rgba(51, 51, 51, 0.5); font-weight: 700; letter-spacing: 1px; }

/* IN-GAME UI OVERHAUL REDESIGN */
.game-top-bar { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 10px; height: 7%; }
.room-code-box { background: url('assets/game/game/room.png') center/100% 100% no-repeat; aspect-ratio: 428 / 100; width: 48%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; }
.player-count-box { background: url('assets/game/game/player.png') center/100% 100% no-repeat; aspect-ratio: 207 / 93; width: 25%; display: flex; justify-content: center; align-items: center; font-size: 30px; font-weight: 700; color: #fff; }
.game-exit-btn { aspect-ratio: 328 / 284; width: 12%; cursor: pointer; transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4)); }
.game-exit-btn:active { transform: scale(0.9); }
.board-frame { background: url('assets/game/game/board.png') center/100% 100% no-repeat; aspect-ratio: 1760 / 1757; width: 100%; display: flex; align-items: center; justify-content: center; padding: 0; position: relative; filter: drop-shadow(0 10px 15px rgba(0,0,0,0.6)); }
.board-inner { width: 100%; height: 100%; position: relative; }
.board-inner canvas { width: 100%; height: 100%; display: block; background: transparent !important; box-shadow: none; border-radius: 0; }
.game-bottom-section { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 15px; flex-grow: 1; }
.player-list-box { background: url('assets/game/game/playerlist.png') center/100% 100% no-repeat; aspect-ratio: 579 / 493; width: 53%; display: flex; flex-direction: column; justify-content: flex-start; align-items: center; padding: 3.5% 5%; }
.player-list-header { width: 100%; height: auto; display: flex; justify-content: center; align-items: center; font-size: 15px; font-weight: 800; color: #fff; margin-bottom: 4%; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); }
.player-slot { background-size: 100% 100%; background-repeat: no-repeat; background-position: center; width: 90%; aspect-ratio: 119 / 23; height: auto; margin-bottom: 2%; display: flex; align-items: center; padding-left: 20%; opacity: 0.6; filter: grayscale(100%); transition: all 0.4s ease; flex-shrink: 0; }
.player-slot.active-turn { opacity: 1 !important; transform: scale(1.05); }
.player-slot.active-turn.yellow { animation: breath-yellow 2s infinite ease-in-out; }
.player-slot.active-turn.blue   { animation: breath-blue 2s infinite ease-in-out; }
.player-slot.active-turn.green  { animation: breath-green 2s infinite ease-in-out; }
.player-slot.active-turn.red    { animation: breath-red 2s infinite ease-in-out; }

@keyframes breath-yellow { 0%, 100% { filter: grayscale(0%) drop-shadow(0 0 5px rgba(241, 196, 15, 0.5)); } 50% { filter: grayscale(0%) drop-shadow(0 0 20px rgba(241, 196, 15, 1)); } }
@keyframes breath-blue { 0%, 100% { filter: grayscale(0%) drop-shadow(0 0 5px rgba(52, 152, 219, 0.5)); } 50% { filter: grayscale(0%) drop-shadow(0 0 20px rgba(52, 152, 219, 1)); } }
@keyframes breath-green { 0%, 100% { filter: grayscale(0%) drop-shadow(0 0 5px rgba(46, 204, 113, 0.5)); } 50% { filter: grayscale(0%) drop-shadow(0 0 20px rgba(46, 204, 113, 1)); } }
@keyframes breath-red { 0%, 100% { filter: grayscale(0%) drop-shadow(0 0 5px rgba(231, 76, 60, 0.5)); } 50% { filter: grayscale(0%) drop-shadow(0 0 20px rgba(231, 76, 60, 1)); } }

.player-slot .slot-name { font-size: 13px; font-weight: 800; color: #fff; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); width: 90%; background: transparent; padding: 0; margin-top: 0; display: flex; align-items: center; justify-content: flex-start; gap: 4px; }
.dice-box { background: url('assets/game/game/dicebg.png') center/100% 100% no-repeat; aspect-ratio: 475 / 485; width: 44%; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 8% 0 7% 0; }
#diceTimerDisplay { opacity: 0; color: #f1c40f; font-size: 24px; font-weight: 900; text-shadow: 2px 2px 5px rgba(0,0,0,0.9); margin-bottom: -15px; z-index: 10; transition: all 0.2s ease-in-out; letter-spacing: 1px; }
.dice-display-area { width: 45%; aspect-ratio: 1; display: flex; justify-content: center; align-items: center; perspective: 600px; }
.dice-scene { width: 60px; height: 60px; transform-style: preserve-3d; }
.dice-cube { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.dice-face { position: absolute; width: 100%; height: 100%; background: #fdfdfd; border-radius: 12px; box-shadow: inset 0 0 10px rgba(0,0,0,0.1), 0 0 5px rgba(0,0,0,0.3); display: flex; justify-content: center; align-items: center; }
.dice-face img { width: 80%; height: 80%; object-fit: contain; }
.face-front  { transform: rotateY(0deg) translateZ(30px); }
.face-back   { transform: rotateX(180deg) translateZ(30px); }
.face-right  { transform: rotateY(90deg) translateZ(30px); }
.face-left   { transform: rotateY(-90deg) translateZ(30px); }
.face-top    { transform: rotateX(90deg) translateZ(30px); }
.face-bottom { transform: rotateX(-90deg) translateZ(30px); }

@keyframes dice-jump { 0% { transform: scale(0.5) translateY(40px); opacity: 0; } 30% { transform: scale(1.3) translateY(-30px); opacity: 1; } 60% { transform: scale(0.9) translateY(10px); } 100% { transform: scale(1) translateY(0); } }
.jump-anim { animation: dice-jump 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.roll-btn { aspect-ratio: 364 / 106; width: 76%; cursor: pointer; transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.2s; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4)); }
.roll-btn:active:not(.disabled) { transform: scale(0.9); filter: drop-shadow(0 2px 3px rgba(0,0,0,0.6)); }
.roll-btn.disabled { filter: grayscale(100%) opacity(0.5); pointer-events: none; }

.player-slot.yellow { background-image: url('assets/game/game/yellow.png'); }
.player-slot.blue { background-image: url('assets/game/game/blue.png'); }
.player-slot.green { background-image: url('assets/game/game/green.png'); }
.player-slot.red { background-image: url('assets/game/game/red.png'); }

/* MATCH ENDED OVERHAUL */
.match-end-box { background-size: contain; background-repeat: no-repeat; background-position: center; width: 85%; max-width: 380px; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; padding: 8% 0; filter: drop-shadow(0 15px 25px rgba(0,0,0,0.8)); transition: aspect-ratio 0.3s ease, background-image 0.3s ease; }
.match-end-box.solo { background-image: url('assets/game/matchend/bg.png'); aspect-ratio: 1 / 1.027; }
.match-end-box.top3 { background-image: url('assets/game/matchend/bg2.png'); aspect-ratio: 1 / 1.294; }
.match-end-title { width: 85%; object-fit: contain; margin-top: -10px; }
.match-end-line { width: 75%; object-fit: contain; margin-top: 20px; }
.match-end-line2 { width: 75%; object-fit: contain; margin-bottom: 20px; }
.match-end-btn { width: 70%; object-fit: contain; cursor: pointer; transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); margin-bottom: 10px; }
.match-end-btn:active { transform: scale(0.92); filter: brightness(0.9); }
.winner-list-container { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; flex-grow: 1; justify-content: center; }
.winner-rank-slot { width: 92%; aspect-ratio: 300 / 55; background-size: contain; background-repeat: no-repeat; background-position: center; display: flex; align-items: center; padding-left: 28%; }
.winner-rank-name { font-size: 16px; font-weight: 800; color: #fff; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 95%; }

/* PREGAME COLOR PICK & MODE STYLES */
.color-pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; width: 100%; max-width: 320px; }
.color-pick-btn { width: 100%; aspect-ratio: 1; background-size: contain; background-repeat: no-repeat; background-position: center; position: relative; cursor: pointer; transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.2s; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); }
.color-pick-btn:active { transform: scale(0.95); }
.color-pick-btn.taken { filter: grayscale(100%) opacity(0.5); cursor: not-allowed; }
.color-pick-btn.taken:active { transform: scale(1); }
.player-name-plate { position: absolute; top: 62%; left: 52%; transform: translate(-50%, -50%); width: 90%; text-align: center; color: #000; font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }

@keyframes pick-glow-yellow { 0%, 100% { filter: drop-shadow(0 0 5px rgba(241, 196, 15, 0.5)); } 50% { filter: drop-shadow(0 0 20px rgba(241, 196, 15, 1)); } }
@keyframes pick-glow-blue { 0%, 100% { filter: drop-shadow(0 0 5px rgba(52, 152, 219, 0.5)); } 50% { filter: drop-shadow(0 0 20px rgba(52, 152, 219, 1)); } }
@keyframes pick-glow-green { 0%, 100% { filter: drop-shadow(0 0 5px rgba(46, 204, 113, 0.5)); } 50% { filter: drop-shadow(0 0 20px rgba(46, 204, 113, 1)); } }
@keyframes pick-glow-red { 0%, 100% { filter: drop-shadow(0 0 5px rgba(231, 76, 60, 0.5)); } 50% { filter: drop-shadow(0 0 20px rgba(231, 76, 60, 1)); } }
@keyframes pick-glow-spec { 0%, 100% { filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3)); } 50% { filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.9)); } }

.color-pick-btn.mine.yellow { animation: pick-glow-yellow 1.5s infinite ease-in-out; transform: scale(1.05); z-index: 2; border-radius: 18px;}
.color-pick-btn.mine.blue { animation: pick-glow-blue 1.5s infinite ease-in-out; transform: scale(1.05); z-index: 2; border-radius: 18px;}
.color-pick-btn.mine.green { animation: pick-glow-green 1.5s infinite ease-in-out; transform: scale(1.05); z-index: 2; border-radius: 18px;}
.color-pick-btn.mine.red { animation: pick-glow-red 1.5s infinite ease-in-out; transform: scale(1.05); z-index: 2; border-radius: 18px;}
.spec-btn-img.mine { animation: pick-glow-spec 1.5s infinite ease-in-out; transform: scale(1.05); }

.mode-spec-container { width: 100%; max-width: 320px; aspect-ratio: 3.90 / 1; background-size: contain; background-repeat: no-repeat; background-position: center; display: flex; align-items: center; justify-content: space-evenly; padding: 0 10px; margin-bottom: 10px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); }
.mode-section { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 60%; height: 50%; }
.spec-btn-img { width: 25%; object-fit: contain; cursor: pointer; transition: transform 0.2s; }
.spec-btn-img:active { transform: scale(0.9); }
.start-btn-pick { width: 100%; max-width: 260px; object-fit: contain; cursor: pointer; transition: transform 0.2s, filter 0.2s; }
.start-btn-pick:active { transform: scale(0.95); filter: brightness(0.8); }

@media (max-height: 800px) {
    .reg-input { height: 38px !important; margin-bottom: 5px !important; font-size: 13px !important; }
    .custom-reg-box { padding: 35px 20px 20px 20px; }
    .reg-divider { margin: 5px 0 10px 0; }
    .reg-tos-container { font-size: 11px; margin-bottom: 2px; }
    .reg-title { width: 70%; margin-bottom: 5px; }
}

.besa-logo-small { width: 140px; height: auto; margin-top: 5px; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.6)); }
.logo-crossfade-container { position: relative; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; }
.logo-crossfade-container img { position: absolute; max-height: 80%; max-width: 80%; filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5)); animation: pulseLogo 2.5s infinite ease-in-out; transition: opacity 1s ease-in-out; }
.logo-hide { opacity: 0; pointer-events: none; }
.logo-show { opacity: 1; pointer-events: auto; }