@font-face {
  font-family: "JustJoy Roboto";
  src: url("Font/Roboto-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ==========================================
   CSS Themes (Dark & Light)
   ========================================== */
:root,
:root[data-theme="dark"] {
  --bg: #0f1015;
  --surface: #16181f;
  --surface-raised: #1e212b;
  --ink: #ffffff;
  --muted: #94a3b8;
  --gold: #f59e0b;
  --gold-bright: #fbbf24;
  --line: rgba(255, 255, 255, 0.1);
  --header-bg: rgba(15, 16, 21, 0.88);
  --faint-text: rgba(255, 255, 255, 0.35);
  --pill-bg: #1c1f28;
  --pill-active-bg: #ea580c;
  --icon-color: #ffffff;
  --dropdown-bg: #1a1d26;
}

:root[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-raised: #f1f5f9;
  --ink: #0f172a;
  --muted: #64748b;
  --gold: #d97706;
  --gold-bright: #b45309;
  --line: #e2e8f0;
  --header-bg: rgba(248, 250, 252, 0.9);
  --faint-text: rgba(15, 23, 42, 0.38);
  --pill-bg: #e2e8f0;
  --pill-active-bg: #ea580c;
  --icon-color: #0f172a;
  --dropdown-bg: #ffffff;
}

/* ==========================================
   Anti-Drag & Anti-Selection Rules
   ========================================== */
*,
*::before,
*::after,
html,
body {
  box-sizing: border-box;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  -khtml-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
  -khtml-user-drag: none !important;
  -moz-user-drag: none !important;
  -o-user-drag: none !important;
  user-drag: none !important;
}

::selection {
  background: transparent !important;
  color: inherit !important;
}

::-moz-selection {
  background: transparent !important;
  color: inherit !important;
}

img,
svg,
a,
video,
canvas {
  -webkit-user-drag: none !important;
  -khtml-user-drag: none !important;
  -moz-user-drag: none !important;
  -o-user-drag: none !important;
  user-drag: none !important;
  -webkit-touch-callout: none !important;
}

img {
  pointer-events: none;
}

/* ==========================================
   Base Layout
   ========================================== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

html,
body {
  min-block-size: 100%;
  background: var(--bg);
  transition: background-color 250ms ease, color 250ms ease;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "JustJoy Roboto", "Leelawadee UI", Tahoma, sans-serif;
  cursor: default;
}

h1, h2, h3, h4, h5, h6, p, span, div, section, main, header, footer {
  cursor: default;
  -webkit-user-select: none !important;
  user-select: none !important;
}

a, button, select {
  cursor: pointer;
}

/* ==========================================
   Site Header & Navigation
   ========================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  min-block-size: 5rem;
  padding-inline: clamp(1.25rem, 5vw, 5rem);
  border-block-end: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color 250ms ease, border-color 250ms ease;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 180ms ease, transform 180ms ease;
  flex-shrink: 0;
}

.brand:hover {
  opacity: 0.92;
  transform: scale(1.02);
}

.brand-logo {
  display: block;
  height: clamp(2.5rem, 4vw, 3.25rem);
  width: auto;
  object-fit: contain;
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
  pointer-events: none;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  transition: all 180ms ease;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: var(--ink);
  background: var(--surface-raised);
  border-color: var(--line);
}

.nav-link:focus-visible {
  outline: none;
  border-color: var(--gold);
  color: var(--gold-bright);
}

.blog-link {
  color: var(--gold);
  border-color: rgba(217, 119, 6, 0.25);
  background: rgba(217, 119, 6, 0.08);
}

.blog-link:hover {
  background: rgba(217, 119, 6, 0.18);
  border-color: var(--gold);
  color: var(--gold-bright);
}

/* ==========================================
   Page Container & Hero Section
   ========================================== */
.page {
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
  inline-size: min(100% - 2.5rem, 72rem);
  margin-inline: auto;
  padding-block: clamp(2.5rem, 6vw, 5rem);
}

.welcome {
  max-inline-size: 46rem;
  padding-top: 1rem;
}

.eyebrow {
  margin: 0 0 1.25rem;
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.13em;
  line-height: 1;
}

h1, h2, p {
  margin-block-start: 0;
}

h1 {
  margin-block-end: 0;
  color: var(--ink);
  font-size: clamp(3.2rem, 8vw, 6rem);
  letter-spacing: -0.04em;
  line-height: 0.9;
  text-wrap: balance;
}

h1 span {
  color: var(--gold);
}

.welcome-copy {
  max-inline-size: 55ch;
  margin-block: 1.75rem 0;
  color: var(--muted);
  font-family: "Segoe UI", "Leelawadee UI", Tahoma, sans-serif;
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  font-weight: 600;
  line-height: 1.65;
  text-wrap: pretty;
}

/* Section Headings */
.section-heading {
  margin-bottom: 2rem;
}

.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.section-desc {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-family: "Segoe UI", "Leelawadee UI", Tahoma, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
}

/* ==========================================
   Studio Games Section (with 3D Background)
   ========================================== */
.studio-games {
  display: grid;
  gap: 1.5rem;
}

.games-status-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1.5rem, 4vw, 3rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: background-color 250ms ease, border-color 250ms ease;
}

.model-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  transition: opacity 250ms ease, filter 250ms ease;
}

/* โทนมืด: ตัวละครสว่างกำลังดี ไม่สว่างจ้าเกินไป */
:root[data-theme="dark"] .model-canvas {
  opacity: 0.65;
  filter: brightness(1.15) contrast(1.05) drop-shadow(0 8px 30px rgba(0, 0, 0, 0.6));
}

/* โทนขาว: ตัวละครโทนมืดคมชัด ตัดกับพื้นหลังสีขาว */
:root[data-theme="light"] .model-canvas {
  opacity: 0.88;
  filter: brightness(0.56) contrast(1.25) saturate(1.1) drop-shadow(0 14px 28px rgba(0, 0, 0, 0.25));
}

.games-status-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-raised);
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.lock-icon {
  width: 1.1rem;
  height: 1.1rem;
  stroke: var(--gold);
}

.status-pill {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.games-status-text {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
}

:root[data-theme="dark"] .games-status-text {
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
}

.games-status-desc {
  margin: 0;
  color: var(--muted);
  font-family: "Segoe UI", "Leelawadee UI", Tahoma, sans-serif;
  font-size: 1.05rem;
  max-width: 48ch;
  line-height: 1.6;
  font-weight: 600;
}

/* ==========================================
   Our Team Section (with bg.png avatars)
   ========================================== */
.team-section {
  display: grid;
  gap: 1.5rem;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.5rem;
}

.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: transform 200ms ease, border-color 200ms ease, background-color 200ms ease;
}

.team-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  background: var(--surface-raised);
}

.team-avatar-wrapper {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  overflow: hidden;
  background: url("Images/bg.png") center/cover no-repeat;
  border: 2.5px solid var(--line);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  position: relative;
}

.team-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.team-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
}

.team-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}

.team-role {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
}

.role-owner {
  background: rgba(255, 215, 0, 0.12);
  color: var(--gold-bright);
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.role-dev {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.role-consultant {
  background: rgba(168, 85, 247, 0.12);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.role-tester {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.team-handle {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-top: 0.35rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 160ms ease;
}

.team-handle:hover {
  color: var(--gold);
}

.handle-icon {
  color: var(--gold);
  font-weight: 700;
}

/* ==========================================
   Social & Community Section (Fixed Icons for Light Mode)
   ========================================== */
.community {
  display: grid;
  grid-template-columns: minmax(12rem, 0.72fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: center;
  padding: clamp(1.5rem, 4vw, 3.25rem);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: background-color 250ms ease, border-color 250ms ease;
}

.community-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.25rem, 4.5vw, 4.25rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  text-wrap: balance;
}

.community-heading > p:last-child {
  max-inline-size: 30ch;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-family: "Segoe UI", "Leelawadee UI", Tahoma, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.55;
}

.community-links {
  display: grid;
  gap: 0.85rem;
}

.community-link {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-block-size: 5.75rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface-raised);
  text-decoration: none;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.community-link:hover,
.community-link:focus-visible {
  border-color: var(--gold);
  background: var(--surface);
  outline: none;
  transform: translateY(-0.15rem);
}

.community-link:focus-visible {
  box-shadow: 0 0 0 3px oklch(0.84 0.16 88 / 0.25);
}

/* Fix icon color: Adapt to dark / light theme */
.community-icon {
  display: block;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  object-fit: contain;
  fill: var(--icon-color) !important;
}

.community-link-copy {
  display: grid;
  gap: 0.3rem;
}

.community-platform {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
}

.community-action {
  color: var(--muted);
  font-family: "Segoe UI", "Leelawadee UI", Tahoma, sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
}

.community-arrow {
  color: var(--gold);
  font-size: 1.5rem;
  line-height: 1;
}

/* ==========================================
   BIG GAMES Inspired Footer Style
   ========================================== */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 4.5rem clamp(1.25rem, 5vw, 5rem) 4rem;
  margin-top: 4rem;
  transition: background-color 250ms ease, border-color 250ms ease;
}

.footer-container {
  max-width: 72rem;
  margin: 0 auto;
  width: 100%;
}

.footer-main-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.8fr) minmax(130px, 0.8fr) minmax(130px, 0.8fr);
  gap: 3rem;
  align-items: start;
}

.footer-col-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

.footer-brand {
  display: inline-block;
  text-decoration: none;
  transition: transform 180ms ease;
}

.footer-brand:hover {
  transform: scale(1.03);
}

.footer-logo {
  height: clamp(2.5rem, 4vw, 3.25rem);
  width: auto;
  object-fit: contain;
}

/* Contact Us Button (Pill shaped with chat icon) */
.btn-contact-us {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.6rem;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 9999px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.btn-contact-us:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.5);
  filter: brightness(1.08);
}

.contact-icon {
  width: 1.15rem;
  height: 1.15rem;
  fill: #ffffff;
}

/* Footer Copyright (Left Aligned & Faint) */
.footer-copyright {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left;
}

.faint-text {
  color: var(--faint-text) !important;
}

.copyright-text {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.copyright-sub {
  margin: 0;
  font-size: 0.82rem;
}

/* Footer Controls Row: Theme Segmented Pill + Custom Flag Dropdown */
.footer-controls-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* 3-Segment Theme Pill: [ ☀️ | 💻 | 🌙 ] */
.theme-segmented-pill {
  display: inline-flex;
  align-items: center;
  background: var(--pill-bg);
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: 9999px;
  gap: 2px;
}

.theme-seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: all 180ms ease;
}

.theme-seg-btn svg {
  width: 16px;
  height: 16px;
}

.theme-seg-btn:hover {
  color: var(--ink);
}

.theme-seg-btn.active {
  background: var(--pill-active-bg);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.45);
}

/* Custom Sleek Language Dropdown */
.custom-lang-dropdown {
  position: relative;
}

.lang-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--pill-bg);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  transition: all 180ms ease;
}

.lang-dropdown-btn:hover {
  border-color: var(--gold);
  background: var(--surface-raised);
}

.active-flag {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.flag-svg {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  display: block;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.chevron-icon {
  width: 14px;
  height: 14px;
  stroke: var(--muted);
  transition: transform 180ms ease;
}

.lang-dropdown-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 160px;
  background: var(--dropdown-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.4rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 200;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lang-dropdown-menu.open {
  display: flex;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.lang-option:hover {
  background: var(--surface-raised);
  color: var(--ink);
}

.lang-option.active {
  background: rgba(234, 88, 12, 0.12);
  color: #ea580c;
  font-weight: 700;
}

.lang-option .flag-icon {
  display: inline-flex;
  align-items: center;
}

/* Footer Columns: Site & Connect */
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.footer-heading {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.footer-links-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links-list a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: color 160ms ease, transform 160ms ease;
  display: inline-block;
}

.footer-links-list a:hover {
  color: var(--ink);
  transform: translateX(2px);
}

/* ==========================================
   Responsive Breakpoints
   ========================================== */
@media (max-width: 56rem) {
  .header-container {
    flex-direction: row;
  }

  .footer-main-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 48rem) {
  .site-header {
    min-block-size: auto;
    padding-block: 1rem;
  }

  .header-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .nav-menu {
    width: 100%;
    justify-content: flex-start;
    gap: 0.25rem;
  }

  .nav-link {
    font-size: 0.85rem;
    padding: 0.4rem 0.65rem;
  }

  .page {
    inline-size: min(100% - 2rem, 72rem);
    padding-block: 2rem;
  }

  .community {
    grid-template-columns: 1fr;
  }

  .team-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}