@import url('https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Pattaya&family=Trirong:wght@400;600&display=swap');

* { 
    font-family: Kanit;
    box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  color: aliceblue;
  /* ค่าเริ่มต้น (ยังไม่ตั้งวิดีโอพื้นหลัง) ให้เป็นโทนขาวดำแทนสีขาวโล่ง ๆ */
  background: linear-gradient(160deg, #050505 0%, #3a3a3a 55%, #e8e8e8 100%);
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.usercontenter {
    position: fixed;
    inset: 0;
    margin: auto;

    padding: clamp(28px, 3.6vw, 48px) clamp(30px, 5vw, 64px);
    max-width: min(920px, calc(100vw - 64px));
    max-height: min(94vh, calc(100vh - 40px));
    width: min(860px, calc(100vw - 64px));
    height: fit-content;
    overflow: hidden auto;

    background: rgba(20, 20, 30, 0.7);
    backdrop-filter: blur(5px);

    border: 1px solid rgba(255,255,255,.15);
    border-radius: 15px;

    display: flex;
    justify-content: center;
    text-align: center;
    align-items: center;
    z-index: 1;
}
/* ถ้ารองรับ scrollbar hide ในภายใน card ก็ตามมา */
.usercontenter::-webkit-scrollbar { width: 0; height: 0; }

.usercontenter ul {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.usercontenter span {
    color: white;
    font-size: 40px;
    font-weight: 600;
}

h2 {
    justify-content: center;
    text-align: center;
    font-size: 1em; 
    white-space: nowrap;
}

h3 {
    justify-content: center;
    text-align: center;
    font-size: 0.8em; 
    white-space: nowrap;
}


img {
    justify-content: center;
    width: 130px;
    height: 130px;
    border-radius: 80%;
}


.social-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0px;
  background: none;
  padding: 8px 8px;
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(5px);
  min-width: 78px;
  min-height: 78px;
}

.social-btn img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.social-btn .social-link-name {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1.2em;
  font-weight: 600;
  margin-left: 0;
}

html:not(.touch-mode) .social-btn:hover, .social-btn.is-hovered{
  transform: scale(1.05);
  border-radius: 50px;
  padding: 8px 18px 8px 13px;
  min-width: auto;
  background: rgba(255,255,255,.1);
  gap: 10px;
}

html:not(.touch-mode) .social-btn:hover img , .social-btn.is-hovered img {
  width: 44px;
  height: 44px;
}

html:not(.touch-mode) .social-btn:hover .social-link-name , .social-btn.is-hovered .social-link-name {
  max-width: 300px;
  opacity: 1;
}

.social-btn:active {
  transform: scale(0.97);
}



.discord-status {
    display: flex;
    align-items: center;
    gap: 12px;
    width: auto;
    height: auto;
    padding: 10px 16px;
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    text-align: left;
    max-width: 100%;
}

.ds-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.ds-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.ds-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #80848e;
    border: 3px solid rgba(30, 28, 40, 0.9);
}

.ds-info {
    min-width: 0;
    flex: 1;
}

.ds-name {
    margin: 0;
    font-size: 0.95em;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ds-activity {
    margin: 2px 0 0;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.65);
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    line-height: 1.35;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.ds-activity-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.25);
}

.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: #0e0c16;
    transition: opacity 0.6s ease;
    opacity: 1;
}

.loading-screen--hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-ring {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #fff;
    animation: loading-spin 0.9s linear infinite;
}

.loading-text {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9em;
    letter-spacing: 0.1em;
}

@keyframes loading-spin {
    to { transform: rotate(360deg); }
}

.music-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(20, 20, 30, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 999px;
    padding: 6px 14px 6px 6px;
}

.music-toggle {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.music-toggle:hover {
    transform: scale(1.08);
}

.music-toggle:active {
    transform: scale(0.95);
}

.music-volume {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}

.music-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.music-volume::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border: none;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

    .floating-shapes {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
    }

    .floating-shape {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0);
    transform-origin: center center;
    animation: float-shape 12s linear infinite;
    padding: 0.5rem;
    animation-fill-mode: backwards;
    
    }

    .floating-shape:nth-child(1) { left: 10%; animation-duration: 10s; animation-delay: 0s; }
    .floating-shape:nth-child(2) { left: 30%; animation-duration: 12s; animation-delay: 3s; transform: scale(1.1); }
    .floating-shape:nth-child(3) { left: 50%; animation-duration: 13s; animation-delay: 6s; }
    .floating-shape:nth-child(4) { left: 70%; animation-duration: 11s; animation-delay: 1.5s; transform: scale(0.9); }
    .floating-shape:nth-child(5) { left: 88%; animation-duration: 14s; animation-delay: 4.5s; }

@keyframes float-shape {
  0% {
    transform: translate3d(0, 110vh, 0) rotate(0deg);
    opacity: 0;
    border-radius: 3%
  }

  10% {
    opacity: 1;
    border-radius: 10%;
  }

  50% {
    transform: translate3d(0, 50vh, 0) rotate(360deg);
    opacity: 1;
    border-radius: 25%;
  }

  100% {
    transform: translate3d(0, -20vh, 0) rotate(720deg);
    opacity: 0;
    border-radius: 30%;
  }
}

/* ===== Responsive (User profile page) ===== */
/* ปรับค่าตายตัวให้ชัดเจนก่อน breakpoint */
#user-avatar { width: 168px; height: 168px; }
#user-name {
  margin: 14px 0 0;
  font-size: clamp(26px, 3.8vw, 42px);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80vw;
}
#user-title {
  margin: 6px 0 0;
  font-size: clamp(15px, 2.2vw, 20px);
  font-weight: 500;
  max-width: 80vw;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* หน้าจอกว้าง ≤ 960px (แล็ปท็อปเล็ก / แบ่งครึ่งจอใหญ่) */
@media (max-width: 960px) {
  .usercontenter {
    min-width: unset !important;
    width: min(560px, calc(100vw - 56px));
    padding: 34px 28px;
  }
  #user-avatar { width: 110px; height: 110px; }
  .ds-avatar { width: 40px; height: 40px; }
  .ds-dot { width: 12px; height: 12px; border-width: 2.5px; }
}

/* หน้าจอ ≤ 640px (แท็บเล็ตเล็ก / แบ่งครึ่งจอ 13″ เหมือนในภาพ ~700px) */
@media (max-width: 640px) {
  .usercontenter {
    width: min(calc(100vw - 36px), 520px);
    padding: 26px 22px;
    border-radius: 14px;
  }
  #user-avatar { width: 92px; height: 92px; }
  h2, h3 { white-space: normal !important; }
  .social-btn { min-width: 56px; min-height: 56px; padding: 7px 7px; }
  .social-btn img { width: 34px; height: 34px; }
  html:not(.touch-mode) .social-btn:hover img , .social-btn.is-hovered img { width: 38px; height: 38px; }
  html:not(.touch-mode) .social-btn:hover, .social-btn.is-hovered{
    padding: 7px 16px 7px 11px;
    gap: 8px;
  }
  .social-btn .social-link-name { font-size: 1.08em; }

  .discord-status { padding: 9px 13px; gap: 10px; margin-top: 8px; border-radius: 11px; }
  .ds-avatar { width: 36px; height: 36px; }
  .ds-dot { width: 11px; height: 11px; border-width: 2px; bottom: 0; right: 0; }
  .ds-name { font-size: 0.9em; }
  .ds-activity { font-size: 0.72em; margin-top: 1px; }
  .ds-activity-icon { width: 34px; height: 34px; border-radius: 8px; }

  .music-controls { top: 14px; right: 14px; gap: 8px; padding: 5px 13px 5px 5px; }
  .music-toggle { width: 30px; height: 30px; }
  .music-volume { width: 70px; }

  #footer-signature { right: 14px !important; bottom: 10px !important; font-size: 12.5px !important; }
}

/* หน้าจอ ≤ 440px (มือถือแนวตั้ง, จอเล็กมาก) */
@media (max-width: 440px) {
  .usercontenter {
    width: calc(100vw - 24px);
    padding: 22px 16px;
    border-radius: 13px;
  }
  #user-avatar { width: 76px; height: 76px; }
  #user-name { max-width: 100%; font-size: clamp(20px, 6.4vw, 28px); }
  #user-title { max-width: 100%; font-size: clamp(13px, 4.3vw, 15px); }

  .social-links { gap: 6px; }
  .social-btn { min-width: 50px; min-height: 50px; padding: 6px; border-radius: 14px; }
  .social-btn img { width: 30px; height: 30px; }
  html:not(.touch-mode) .social-btn:hover, .social-btn.is-hovered{ padding: 6px 14px 6px 9px; gap: 7px; border-radius: 36px; min-width: auto; }
  html:not(.touch-mode) .social-btn:hover img , .social-btn.is-hovered img { width: 32px; height: 32px; }
  .social-btn .social-link-name { font-size: 1em; }

  .discord-status { padding: 8px 10px; gap: 8px; border-radius: 10px; }
  .ds-avatar { width: 32px; height: 32px; }
  .ds-dot { width: 10px; height: 10px; border-width: 2px; }
  .ds-name { font-size: 0.84em; }
  .ds-activity { font-size: 0.7em; }
  .ds-activity-icon { width: 30px; height: 30px; border-radius: 7px; }

  .music-controls { top: 10px; right: 10px; gap: 6px; padding: 5px 12px 5px 5px; }
  .music-toggle { width: 28px; height: 28px; }
  .music-toggle svg { width: 19px !important; height: 19px !important; }
  .music-volume { width: 58px; }
  .music-volume::-webkit-slider-thumb { width: 11px; height: 11px; }
  .music-volume::-moz-range-thumb { width: 11px; height: 11px; }

  #footer-signature { right: 10px !important; bottom: 8px !important; font-size: 11.5px !important; }
}

/* ===== Responsive ตาม HEIGHT (สำหรับจอสูงน้อย / แบ่งครึ่ง / เปิด DevTools) ===== */
/* ความสูงหน้าจอ ≤ 720px (แล็ปท็อป 13″ แบ่งครึ่ง / DevTools กินครึ่งจอ) */
@media (max-height: 720px) {
  .usercontenter {
    padding: 22px 28px;
    max-height: min(94vh, calc(100vh - 24px));
  }
  #user-avatar { width: 96px; height: 96px; }
  #user-name { margin-top: 4px; }
  .social-btn { min-width: 56px; min-height: 56px; padding: 6px 6px; }
  .social-btn img { width: 32px; height: 32px; }
  html:not(.touch-mode) .social-btn:hover img , .social-btn.is-hovered img { width: 35px; height: 35px; }
  .discord-status { padding: 8px 12px; margin-top: 6px; gap: 10px; }
  .ds-avatar { width: 36px; height: 36px; }
  .ds-dot { width: 11px; height: 11px; border-width: 2px; }
}

/* ความสูงหน้าจอ ≤ 620px (เหมือนภาพที่คุณส่งมา — half-window + DevTools) */
@media (max-height: 620px) {
  .usercontenter {
    padding: 16px 22px;
    border-radius: 13px;
  }
  #user-avatar { width: 78px; height: 78px; }
  #user-name { margin-top: 2px; font-size: clamp(19px, 3.2vw, 26px); }
  #user-title { font-size: clamp(12px, 1.9vw, 14px); }
  .social-links { gap: 6px; margin-top: 0; }
  .social-btn { min-width: 48px; min-height: 48px; padding: 5px; border-radius: 12px; }
  .social-btn img { width: 27px; height: 27px; }
  html:not(.touch-mode) .social-btn:hover, .social-btn.is-hovered{ padding: 5px 12px 5px 8px; gap: 6px; border-radius: 30px; }
  html:not(.touch-mode) .social-btn:hover img , .social-btn.is-hovered img { width: 29px; height: 29px; }
  .social-btn .social-link-name { font-size: 0.95em; }
  .discord-status { padding: 7px 10px; margin-top: 4px; gap: 8px; border-radius: 10px; }
  .ds-avatar { width: 32px; height: 32px; }
  .ds-dot { width: 10px; height: 10px; border-width: 2px; bottom: 0; right: 0; }
  .ds-name { font-size: 0.86em; }
  .ds-activity { font-size: 0.68em; }
  .ds-activity-icon { width: 28px; height: 28px; border-radius: 7px; }
}

/* ความสูงหน้าจอ ≤ 520px (จอสูงน้อยมาก) */
@media (max-height: 520px) {
  .usercontenter {
    padding: 12px 18px;
    border-radius: 12px;
  }
  #user-avatar { width: 62px; height: 62px; }
  #user-name { font-size: clamp(17px, 3vw, 22px); }
  #user-title { font-size: clamp(11px, 1.8vw, 13px); }
  .social-btn { min-width: 42px; min-height: 42px; padding: 4px; border-radius: 10px; }
  .social-btn img { width: 23px; height: 23px; }
  html:not(.touch-mode) .social-btn:hover img , .social-btn.is-hovered img { width: 25px; height: 25px; }
  html:not(.touch-mode) .social-btn:hover, .social-btn.is-hovered{ padding: 4px 11px 4px 7px; gap: 5px; border-radius: 26px; }
  .discord-status { padding: 6px 9px; margin-top: 4px; gap: 7px; }
  .ds-avatar { width: 28px; height: 28px; }
  .ds-dot { width: 9px; height: 9px; border-width: 2px; }
  .ds-name { font-size: 0.82em; }
  .ds-activity { font-size: 0.65em; }
  .ds-activity-icon { width: 26px; height: 26px; border-radius: 6px; }
}
/* เดิมจุดนี้แก้บัค label ค้างด้วย @media (hover:none),(pointer:coarse) แต่ไม่แม่นยำ
   เพราะอุปกรณ์ hybrid (มีทั้งจอสัมผัส+เมาส์/แทร็กแพด เช่นโน้ตบุ๊ก Windows) เบราว์เซอร์มักรายงาน
   primary pointer เป็น fine/hover:hover แม้จะแตะจอ ทำให้เงื่อนไขนี้ไม่ทำงานและ label ยังค้างอยู่
   ย้ายไปคุมสถานะ hover ด้วย JS (class .is-hovered ผ่าน pointerenter/leave + reset หลัง tap) แทนแล้ว
   ดู social-btn.is-hovered ด้านบนแทน ไม่ต้องพึ่ง media feature detection ที่ไม่น่าเชื่อถือนี้อีก */

/* มือถือ: ไม่ต้องโชว์ชื่อปุ่ม (WEB/IG) เลย ไอคอนอย่างเดียวพอ ตัดปัญหาเรื่อง touch/hover ไปเลย */
@media (max-width: 768px) {
  .social-btn .social-link-name {
    display: none !important;
  }
  .social-btn:hover,
  .social-btn.is-hovered {
    padding: 8px !important;
    gap: 0 !important;
    border-radius: 50% !important;
    min-width: auto !important;
  }
}