/* Shared v2 theme for static pages (dark neon).
   Keep this file lightweight: pages may have large inline CSS already. */

:root{
  --bg:#050607;
  --bg2:#07090a;
  --ink: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.72);
  --muted2: rgba(255,255,255,0.55);
  --line: rgba(255,255,255,0.10);
  --line2: rgba(255,255,255,0.07);
  --brand:#00ff88;
  --brand2:#00cc6a;
  --shadow: 0 28px 90px rgba(0,0,0,0.62);
  --r-xl: 28px;
  --r-lg: 18px;
  --r-md: 14px;
  --max: min(1720px, max(1120px, 90vw));
  --nav-font: "Exo 2", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-main: "Exo 2", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-thai: "LINE Seed Sans TH", "LINE Seed Sans", "Noto Sans Thai", "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

@font-face {
  font-family: "LINE Seed Sans TH";
  src: url("https://seed.line.me/webfont/LINESeedSansTH/LINESeedSansTH-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "LINE Seed Sans TH";
  src: url("https://seed.line.me/webfont/LINESeedSansTH/LINESeedSansTH-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

html{
  background: var(--bg);
  overflow-x:hidden;
  overflow-y:auto;
}
body{
  background: linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--ink);
  font-family: var(--font-main);
  margin:0;
  min-height:100vh;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transition: opacity .22s ease;
  will-change: opacity;
  animation: pageEnter .22s ease both;
}

body.site-lang-th,
body.site-lang-th *{
  font-family: var(--font-thai);
}

.sticky-header{
  position: sticky;
  top: 0;
  z-index: 60;
  width: 100%;
}

html.is-navigating body{
  opacity: 0;
}

@keyframes pageEnter{
  from{opacity:0}
  to{opacity:1}
}

@media (prefers-reduced-motion: reduce){
  body{transition:none !important; animation:none !important}
}

/* Top nav (matches index.html) */
.topnav{
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(0,0,0,0.38);
  border-bottom: 1px solid var(--line2);
  backdrop-filter: saturate(1.1);
  font-family: var(--nav-font);
}
.wrap{
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 max(18px, env(safe-area-inset-right, 0px)) 0 max(18px, env(safe-area-inset-left, 0px));
}
.topnav-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 12px 0;
}
.wordmark{
  display:inline-flex;
  align-items:center;
  justify-content:flex-start;
  padding: 6px 10px;
  border-radius: 16px;
  border: 1px solid rgba(0,255,136,0.22);
  background: rgba(255,255,255,0.03);
  box-shadow:
    0 16px 50px rgba(0,255,136,0.10),
    inset 0 1px 0 rgba(255,255,255,0.08);
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
  color: rgba(255,255,255,0.92);
  text-decoration:none;
}
.wordmark:hover{
  border-color: rgba(0,255,136,0.34);
  background: rgba(0,255,136,0.06);
  box-shadow:
    0 18px 60px rgba(0,255,136,0.14),
    inset 0 1px 0 rgba(255,255,255,0.10);
}
.wordmark:focus-visible{
  outline: 2px solid rgba(0,255,136,0.55);
  outline-offset: 2px;
}
.wordmark-logo{
  width: 34px;
  height: 34px;
  object-fit: contain;
  display:block;
  filter: drop-shadow(0 0 18px rgba(0,255,136,0.26));
}

@media (max-width: 560px){
  .wordmark{
    padding: 5px 9px;
    border-radius: 14px;
  }
  .wordmark-logo{
    width: 30px;
    height: 30px;
  }
}
.nav-center{
  display:flex;
  align-items:center;
  gap: 18px;
  flex-wrap: nowrap;
}
.nav-center a{
  color: rgba(255,255,255,0.70);
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 10px 0;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
  white-space: nowrap;
  text-decoration:none;
}
.nav-center a:hover{
  color: rgba(255,255,255,0.92);
  border-bottom-color: rgba(0,255,136,0.42);
}

/* Primary nav dropdowns (Browse / About / Help) */
details.nav-dd{
  position: relative;
}
details.nav-dd > summary.nav-dd-summary{
  list-style: none;
  cursor: pointer;
  color: rgba(255,255,255,0.70);
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 10px 2px 10px 0;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: inherit;
  background: none;
}
details.nav-dd > summary.nav-dd-summary::-webkit-details-marker{display:none}
details.nav-dd > summary.nav-dd-summary::after{
  content: "";
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(255,255,255,0.42);
  transition: transform .15s ease;
}
details.nav-dd[open] > summary.nav-dd-summary::after{
  transform: rotate(180deg);
}
details.nav-dd > summary.nav-dd-summary:hover{
  color: rgba(255,255,255,0.92);
  border-bottom-color: rgba(0,255,136,0.42);
}
.nav-dd-panel{
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  min-width: 232px;
  max-width: min(320px, calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  padding: 8px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.94);
  box-shadow: 0 20px 70px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 60;
}
.nav-dd-panel a{
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  color: rgba(255,255,255,0.88);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.nav-dd-panel a:hover{
  background: rgba(0,255,136,0.08);
  border-color: rgba(0,255,136,0.22);
  color: #fff;
}

.nav-actions{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content:flex-end;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  padding: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.language-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.62);
  padding: 4px 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
}

.language-toggle-btn:hover {
  color: rgba(255,255,255,0.88);
}

.language-toggle-btn.is-active {
  color: #021208;
  background: linear-gradient(180deg, #00ff88 0%, #00d970 100%);
  box-shadow: 0 0 12px rgba(0,255,136,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}

.language-toggle-btn .language-flag {
  font-size: 11px;
}

.btn{
  appearance:none;
  border:1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,0.90);
  height:38px;
  padding:0 14px;
  border-radius: 16px;
  font-weight: 900;
  letter-spacing: 0.02em;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  text-decoration:none;
}
.btn:active{transform: translateY(1px)}
.btn.ghost{
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.03);
}
.btn.ghost:hover{border-color: rgba(0,255,136,0.32); background: rgba(0,255,136,0.06)}
.btn.primary{
  border-color: rgba(0,255,136,0.25);
  background: linear-gradient(135deg, rgba(0,255,136,1), rgba(0,204,106,1));
  color:#00140b;
  box-shadow: 0 18px 56px rgba(0,255,136,0.14);
}
.btn.primary:hover{box-shadow: 0 22px 70px rgba(0,255,136,0.20)}
.btn.sm{height:34px;padding:0 12px;border-radius: 14px;font-size:13px}
.btn.icon{
  width: 34px;
  padding: 0;
  border-radius: 12px;
  gap: 0;
}
.btn.icon svg{width:18px;height:18px;display:block}
.btn.icon.discord{
  color: rgba(255,255,255,0.92);
}
.btn.icon.discord svg{
  display:block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.btn.icon.admin-login{
  color: rgba(255,255,255,0.88);
}
.btn.icon.admin-login:hover{
  color: var(--brand, #00ff88);
  border-color: rgba(0,255,136,0.32);
}
.btn.staff{min-width: 124px}

details.menu{position:relative}
details.menu summary{list-style:none;cursor:pointer}
details.menu summary::-webkit-details-marker{display:none}
.menu-panel{
  position:absolute;
  right: max(0px, env(safe-area-inset-right, 0px));
  top: calc(100% + 10px);
  width: min(
    calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)),
    360px
  );
  max-height: min(70vh, calc(100dvh - 120px));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-xl);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.90);
  box-shadow: 0 20px 70px rgba(0,0,0,0.45);
}
.menu-grid{
  padding: 12px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.menu-grid a{
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  height:44px;
  padding:0 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.88);
  font-weight: 900;
  letter-spacing: 0.01em;
  text-decoration:none;
}
.menu-grid a:hover{border-color: rgba(0,255,136,0.28); background: rgba(0,255,136,0.06)}

/* Extra links that only appear when center nav is hidden */
.menu-grid a[data-only-mobile="1"]{display:none}

@media (max-width: 980px){
  .nav-center{display:none}
  .menu-grid a[data-only-mobile="1"]{display:flex}
}

@media (max-width: 560px){
  /* Keep actions from overflowing on tiny screens */
  .nav-actions .btn.staff{display:none}
  .language-toggle-btn{padding:4px 8px;font-size:10px}
}

@media (max-width: 420px){
  .menu-grid{
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }
  .menu-grid a{
    min-height: 46px;
    justify-content: flex-start;
    padding: 0 14px;
    text-align: left;
  }
}

/* =========================================================
   Loading screen (classic "test tube")
   ========================================================= */
:root{
  --tube-percentage: 0%;
  --tube-color: #00ff88;
}

body.loading-active{
  overflow: hidden !important;
}

.loading-screen{
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  background: #000000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 99999 !important;
  transition: opacity 0.5s ease;
  text-align: center;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}
.loading-screen.done,
.loading-screen.hidden{
  opacity: 0;
  pointer-events: none;
}

.loading-content{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 18px;
  padding: 18px;
  width: min(560px, 92vw);
}

.loading-text{
  font-family: var(--nav-font);
  font-size: 1.5rem;
  color: #ffffff;
  font-weight: 600;
}

/* Test tube */
.loading-bar{
  position: relative;
  height: 200px;
  width: 50px;
  border: 3px solid #272822;
  border-radius: 0 0 50rem 50rem;
  background-color: #272822;
  margin: 0 auto;
}
.loading-bar::after{
  content:"";
  position:absolute;
  left: -10px;
  top: -3px;
  width: calc(100% + 20px);
  height: 8px;
  border-radius: 50rem;
  background-color: #272822;
}
.loading-bar .body{
  position:absolute;
  border-radius: inherit;
  height: 100%;
  width: 100%;
  bottom: 0;
  overflow: hidden;
  z-index: 5;
}
.loading-bar .shine{
  position:absolute;
  left: 10%;
  top: 0;
  width: 10%;
  height: 100%;
  z-index: 90;
  opacity: 0.2;
}
.loading-bar .shine::before,
.loading-bar .shine::after{
  content:"";
  position:absolute;
  background-color:#fff;
  border-radius: 50rem;
  top: 10%;
  height: 40%;
  width: 100%;
}
.loading-bar .shine::after{
  height: 15%;
  top: 60%;
}
@keyframes liquid{
  0%{transform: translateX(-50%) rotate(0deg)}
  100%{transform: translateX(-50%) rotate(360deg)}
}
.loading-bar .liquid{
  position:absolute;
  height: 80%;
  width: 100%;
  bottom: 0;
}
.loading-bar .liquid .percentage{
  position:absolute;
  height: var(--tube-percentage);
  width: 100%;
  bottom: 0;
  left: 0;
  z-index: 80;
  background: linear-gradient(to top, var(--tube-color), rgba(0, 255, 136, 0.8));
  transition: height 0.3s ease;
}
.loading-bar .liquid .percentage::before,
.loading-bar .liquid .percentage::after{
  position:absolute;
  content:"";
  width: 200px;
  height: 200px;
  border-radius: 75px;
  animation: liquid 4s infinite linear;
  transform: translateX(-50%);
  left: 50%;
  top: 0;
  background: var(--tube-color);
}
.loading-bar .liquid .percentage::after{
  opacity: 0.4;
  animation-direction: reverse;
  border-radius: 60px;
}
@keyframes bubble{
  from{background:#272822; transform: scale(0.3) rotate(50deg); margin-left:0}
  10%{margin-left:1px}
  20%{margin-left:-1px}
  30%{margin-left:1px}
  40%{margin-left:-1px}
  50%{margin-left:1px; background: var(--tube-color); transform: scale(0.85) rotate(50deg); opacity: .75}
  60%{margin-left:-1px}
  70%{margin-left:1px}
  80%{margin-left:-1px}
  90%{margin-left:1px}
  to{margin-left:-1px; bottom:135%; opacity:0; transform: scale(1) rotate(50deg)}
}
.loading-bar .bubbles{
  position:absolute;
  left:0;
  bottom:0;
  width:100%;
  height: calc(var(--tube-percentage) + calc(100% - var(--tube-percentage)));
  z-index: 10;
}
.loading-bar .bubbles div{
  position:absolute;
  left:30%;
  border-radius: 50% 50% 0 50%;
  background: var(--tube-color);
  width: 10px;
  height: 10px;
  opacity: 0.8;
  bottom: calc(var(--tube-percentage) / 3);
  animation: bubble 3s infinite linear;
  transform: scale(0.3) rotate(50deg);
}
.loading-bar .bubbles div:nth-child(2){left:40%;opacity:0.7;animation-delay:100ms;animation-duration:2.5s}
.loading-bar .bubbles div:nth-child(3){left:40%;opacity:0.6;animation-delay:200ms}
.loading-bar .bubbles div:nth-child(4){left:60%;animation-delay:250ms;animation-duration:1.75s}
.loading-bar .bubbles div:nth-child(5){left:50%;opacity:0.8;animation-delay:150ms;animation-duration:2.25s}
.loading-bar .meter{
  position:absolute;
  height: 80%;
  right: 0;
  bottom: 0;
  width: 100%;
}
.loading-bar .meter div{
  position:absolute;
  left: -4px;
  top: 0;
  font-size: 12px;
  padding: 6px 2px 6px 4px;
  color: #65665f;
  border-top: 1px solid #65665f;
  transform: translateX(-100%);
}
.loading-bar .meter div:nth-child(1){top:0%}
.loading-bar .meter div:nth-child(2){top:20%}
.loading-bar .meter div:nth-child(3){top:40%}
.loading-bar .meter div:nth-child(4){top:60%}
.loading-bar .meter div:nth-child(5){top:80%}

.loading-percentage{
  margin-top: 4px;
  color: var(--tube-color);
  font-weight: 800;
  text-align:center;
}

@media (max-width: 768px){
  .loading-text{font-size: 1.2rem}
  .loading-bar{height: 150px; width: 40px}
}

@media (prefers-reduced-motion: reduce){
  .loading-bar .liquid .percentage::before,
  .loading-bar .liquid .percentage::after,
  .loading-bar .bubbles div{animation:none !important}
}

