/*
 * Trang /play theo landing public/landing/assets/play/index.html (psdcut, bản
 * 1920x1000, đơn vị --u co theo cả chiều cao lẫn chiều ngang màn hình).
 * Đi kèm /landing/assets/play/css/wkit.css (cmp-popup / cmp-side / cmp-input...)
 * và /landing/assets/play/script/wh5.js (thu gọn sidebar, chuyển popup, đóng).
 */
@font-face { font-family: 'Lexend'; src: url('../play/fonts/Lexend-Regular.woff2') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; }

body { margin: 0; font-family: 'Lexend', sans-serif; }
.page { container-type: inline-size; width: 100%; overflow: hidden; }
.screen { position: relative; width: 100%; overflow: hidden; overflow: clip; }
.l { position: absolute; box-sizing: border-box; }
img.l { display: block; }
.screen .l { pointer-events: none; }
.screen :is(a, button, label, input).l, .screen .l :is(a, button, input) { pointer-events: auto; }
[data-align] { white-space: pre; }
[data-align=center] { text-align: center; }
.screen-play { --u: min(100vh / 1000, 100vw / 1440); height: 100vh; height: 100dvh; background: #000; display: block; }
.hidden { display: none !important; }

/* hiệu ứng nút (lấy từ landing) */
.fx { transition: filter .25s ease; }
a.fx { display: block; color: inherit; }
.fx-inner { position: relative; width: 100%; height: 100%; }
.fx-hover-bright:hover { filter: brightness(1.25); }
.fx .fx-hl { opacity: 0; transition: opacity .25s ease; }
.fx:hover .fx-hl, .cmp-h5btn:hover .fx-hl { opacity: 1; }
.np-bling { animation: play-bling 2.4s ease-in-out infinite; }
@keyframes play-bling { 50% { filter: brightness(1.18) drop-shadow(0 0 calc(10 * var(--u)) rgba(255, 200, 90, .8)); } }
@media (prefers-reduced-motion: reduce) {
  .fx, .np-bling { animation: none !important; transition: none !important; }
}

/* ---- khung game (đã đăng nhập): phần màn hình bên phải sidebar ---- */
.play-ingame {
  position: absolute; top: 0; right: 0; bottom: 0;
  left: calc(301 * var(--u));
  z-index: 10;
  transition: left .3s ease;
}
html.play-sidebar-collapsed .play-ingame { left: calc(14 * var(--u)); }
.game-frame { display: block; width: 100%; height: 100%; border: 0; background: #000; }

/* ---- popup đăng nhập / đăng ký ---- */
.play-terms a { color: #d54019; text-decoration: underline; }
.play-alert {
  position: absolute; left: calc(49 * var(--u)); top: calc(583 * var(--u)); width: calc(306 * var(--u));
  margin: 0; text-align: center; color: #d0021b;
  font-size: max(11px, calc(14 * var(--u))); line-height: 1.3;
}
.play-social { padding: 0; border: 0; background: none; cursor: pointer; }

/* ---- sidebar: ô thông tin tài khoản ---- */
.play-info-text {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  color: #fff; text-align: center; line-height: 1.25;
  font-size: calc(18 * var(--u));
}
.play-info-text b { font-weight: 600; max-width: 92%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-info-text .play-logout {
  margin-top: calc(4 * var(--u)); padding: 0; border: 0; background: none; cursor: pointer;
  color: #ffb35c; font: inherit; font-size: calc(14 * var(--u)); text-decoration: underline;
}

/* ---- modal (đăng xuất, loading) ---- */
.wmodal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 12, 25, .55); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.wmodal.show { opacity: 1; visibility: visible; }
.wmodal-content {
  position: relative; width: min(26em, calc(100vw - 2em)); padding: 1.6em 1.5em 1.4em;
  background: #fff; border-radius: .9em; box-shadow: 0 1em 3em rgba(0, 0, 0, .35);
  border-top: .3em solid #d54019; text-align: center; color: #333; font-size: 15px;
}
.wmodal-content .title { margin: 0 0 .6em; font-size: 1.25em; font-weight: 600; color: #d54019; text-transform: uppercase; }
.wmodal-content .actions { display: grid; grid-auto-flow: column; gap: .8em; width: 80%; margin: 1.1em auto 0; }
.wmodal-content .actions button { padding: .6em; border: 0; border-radius: .4em; color: #fff; font: inherit; cursor: pointer; }
.wmodal-content .actions .no { background: #4a4a4a; }
.wmodal-content .actions .yes { background: linear-gradient(90deg, #b8270b, #ef6d1f); }
.wmodal-content .alert { margin-top: .8em; color: #d0021b; font-size: .9em; }
.btn-close-modal {
  position: absolute; right: -.7em; top: -.7em; width: 2.2em; height: 2.2em; padding: 0; border: 0; cursor: pointer;
  background: url('../play/assets/btn-close.png') center / contain no-repeat;
}

#modal-loading .play-loading-panel {
  width: min(18em, calc(100vw - 2em)); min-height: 12em;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1em;
  padding: 2em 1.5em; box-sizing: border-box; color: #fff; text-align: center;
  background: linear-gradient(180deg, rgba(150, 38, 12, .94), rgba(60, 16, 8, .96));
  border: 1px solid rgba(255, 170, 90, .7); border-radius: .75em;
  box-shadow: 0 1em 3em rgba(0, 0, 0, .35), 0 0 2em rgba(255, 120, 40, .25);
}
#modal-loading .play-loading-spinner {
  width: 4em; height: 4em; border-radius: 999px;
  border: .35em solid rgba(255, 255, 255, .22); border-top-color: #fff; border-right-color: #ffb35c;
  animation: playLoadingSpin .8s linear infinite;
}
#modal-loading .play-loading-title { font-size: 1.05em; font-weight: 700; line-height: 1.3; }
#modal-loading .play-loading-note { max-width: 16em; font-size: .82em; line-height: 1.45; color: rgba(255, 255, 255, .78); }
@keyframes playLoadingSpin { to { transform: rotate(360deg); } }

/* ---- màn dọc (điện thoại): game chỉ có bản ngang, nhưng form đăng nhập vẫn
 * phải dùng được. Co --u theo bề ngang, popup chỉ giữ nửa form (bỏ nửa ảnh)
 * và căn giữa; sidebar mặc định thu gọn (play.blade.php). ---- */
@media (orientation: portrait) and (max-width: 900px) {
  .screen-play { --u: min(100vh / 1000, 100vw / 430); }
  .screen-play .cmp-popup { left: calc(50% - 201 * var(--u)) !important; width: calc(403 * var(--u)) !important; }
  .screen-play .cmp-popup .play-art, .screen-play .cmp-popup .btn-close { display: none; }
  /* QR chỉ có ích khi quét từ một màn khác, trên chính điện thoại thì không */
  .screen-play .play-qr { display: none; }
}
