/* =====================================================================
   KWAY Theme — โหมดสว่าง "Aurora Blue" (โหมดมืด = ค่าเดิมใน kway.css/deck.css)
   เปิดด้วย <html data-theme="light"> — สลับโดย KW.toggleTheme()
   ===================================================================== */
html.i18n-pending body { visibility: hidden; }
body { min-height: 100vh; }
html[data-theme="light"] { background: #DCE8FF; }
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .55s ease, color .45s ease, border-color .55s ease, box-shadow .55s ease, fill .45s, stroke .45s !important;
}

html[data-theme="light"] {
  --bg: #EDF4FF;
  --bg-2: #E3EEFF;
  --surface: rgba(255, 255, 255, .74);
  --surface-solid: #FFFFFF;
  --surface-2: rgba(222, 234, 255, .75);
  --line: rgba(28, 78, 170, .13);
  --line-2: rgba(28, 78, 170, .24);
  --text: #0A1A3E;
  --text-2: #3D5480;
  --text-3: #6F83A8;

  --neon: #0B6CF0;
  --neon-2: #0FA3F2;
  --neon-rgb: 11, 108, 240;
  --neon-soft: rgba(11, 108, 240, .09);
  --glow: 0 0 0 1px rgba(11, 108, 240, .35), 0 6px 18px rgba(11, 108, 240, .18);
  --red: #DB2F55;
  --green: #0B9868;
  --amber: #F2A516;
  --ember: #E07A10;

  --neon-grad: linear-gradient(90deg, #0B6CF0, #16B4F7);
  --rim: linear-gradient(135deg, rgba(255,255,255,.95), rgba(255,255,255,.4) 30%, rgba(160,195,255,.25) 60%, rgba(11,108,240,.35));
  --shadow: 0 18px 44px rgba(30, 72, 160, .13), 0 2px 6px rgba(30, 72, 160, .06), inset 0 1px 0 rgba(255, 255, 255, .9);
  --hud: rgba(11, 108, 240, .55);
  --hud-dim: rgba(11, 108, 240, .2);

  /* พื้นผิวกระจกเดิม (น้ำเงินเข้ม) → กระจกขาวฟ้า */
  --n-20-38-82: 255, 255, 255;
  --n-44-68-120: 228, 238, 255;
  --n-4-10-30: 120, 160, 230;
  --n-6-16-42: 240, 246, 255;
  --n-6-14-38: 190, 208, 240;
  --n-14-30-66: 255, 255, 255;
  --n-14-30-68: 255, 255, 255;
  --n-30-52-104: 255, 255, 255;
  --n-12-26-60: 246, 250, 255;
  --n-70-100-160: 212, 228, 255;
  --n-40-64-118: 196, 218, 255;
  --n-10-22-52: 244, 249, 255;
  --n-8-18-44: 246, 250, 255;
  --n-18-36-78: 255, 255, 255;
  --n-18-36-80: 255, 255, 255;
  --n-30-60-120: 226, 238, 255;
  --n-12-28-64: 255, 255, 255;
  color-scheme: light;
}

/* ฟ้า: แสงอรุณจากด้านบน */
html[data-theme="light"] body {
  background:
    radial-gradient(1300px 700px at 50% -20%, rgba(255, 255, 255, .95), transparent 62%),
    radial-gradient(900px 600px at 100% 0%, rgba(120, 190, 255, .35), transparent 60%),
    radial-gradient(900px 700px at 0% 100%, rgba(150, 175, 255, .35), transparent 60%),
    linear-gradient(180deg, #F6FAFF 0%, #EAF2FF 45%, #DCE8FF 100%);
  background-attachment: fixed;
}
html[data-theme="light"] body::before { opacity: .35; filter: invert(1) hue-rotate(180deg); }
html[data-theme="light"] body::after { background: radial-gradient(ellipse at 50% 40%, transparent 60%, rgba(110, 150, 230, .16) 100%); }

/* อวกาศกลางวัน: ดาวเป็นประกายน้ำเงินบางๆ + เมฆแสง */
html[data-theme="light"] .space .stars { filter: invert(1) hue-rotate(180deg) saturate(3); }
html[data-theme="light"] .space .s1 { opacity: .16; }
html[data-theme="light"] .space .s2 { opacity: .14; }
html[data-theme="light"] .space .s3 { opacity: .28; }
html[data-theme="light"] .space .nebula { background:
  radial-gradient(40% 30% at 78% 18%, rgba(140, 170, 255, .28), transparent 70%),
  radial-gradient(35% 28% at 12% 70%, rgba(90, 200, 255, .22), transparent 70%),
  radial-gradient(30% 25% at 55% 55%, rgba(255, 255, 255, .5), transparent 70%); }
html[data-theme="light"] .space .floor { opacity: .38; }
html[data-theme="light"] .space .horizon { opacity: .5; }
html[data-theme="light"] .cursor-light { mix-blend-mode: normal; background: radial-gradient(circle, rgba(11, 108, 240, .07), rgba(15, 163, 242, .03) 40%, transparent 70%); }

/* จุดที่เคยใช้ตัวอักษรขาวบนพื้นเข้ม */
html[data-theme="light"] .bubble b,
html[data-theme="light"] .admin-side:hover { color: var(--text); }
html[data-theme="light"] .a-bar button, html[data-theme="light"] .a-bar a { color: var(--text); border-color: var(--line-2); box-shadow: 0 2px 8px rgba(30,72,160,.15); }
html[data-theme="light"] .gal-grid .g .k, html[data-theme="light"] .lib-grid .g .k, html[data-theme="light"] .srt-link { color: #fff; }
html[data-theme="light"] .input { box-shadow: inset 0 1px 3px rgba(30,72,160,.08); }
html[data-theme="light"] .input:focus { box-shadow: 0 0 0 3px rgba(11,108,240,.14); }
html[data-theme="light"] .modal-bg { background: rgba(170, 195, 235, .45); }
html[data-theme="light"] .boot { background: radial-gradient(ellipse at 50% 40%, #FFFFFF, #DCE9FF 70%); }
html[data-theme="light"] .boot .ln { color: var(--text-2); }
html[data-theme="light"] .energy-cells i.on, html[data-theme="light"] .tele .cells i.on { background: linear-gradient(180deg, #57C2FF, var(--neon)); box-shadow: 0 0 5px rgba(11, 108, 240, .45); }
html[data-theme="light"] .logo-text, html[data-theme="light"] .chrome-text { filter: none; }
html[data-theme="light"] ::selection { background: rgba(11, 108, 240, .2); }

/* ---------- ปุ่มสลับธีม / ภาษา ---------- */
.kw-switch { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line-2); border-radius: 9px; background: rgba(var(--n-8-18-44), .45); font: 600 11px var(--font-mono); letter-spacing: .06em; }
.kw-switch button { border: 0; background: none; color: var(--text-3); padding: 4px 7px; border-radius: 7px; line-height: 1; display: inline-grid; place-items: center; min-width: 28px; min-height: 24px; }
.kw-switch button.on { background: var(--neon-soft); color: var(--neon); box-shadow: inset 0 0 0 1px rgba(var(--neon-rgb), .35); }
.kw-switch button:hover:not(.on) { color: var(--text); }
.kw-switch svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kw-prefs { display: inline-flex; gap: 6px; align-items: center; }

/* ตัวอักษรโลหะมุก → โลหะไพลินเข้มบนพื้นสว่าง */
html[data-theme="light"] .credits #creditNum, html[data-theme="light"] .empty h1 span, html[data-theme="light"] .chrome-text,
html[data-theme="light"] .plan .price, html[data-theme="light"] .logo > span, html[data-theme="light"] .hero h1 .c {
  background: linear-gradient(180deg, #2A5BD0 0%, #0B1A3E 52%, #1D4BB8 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: none;
}
html[data-theme="light"] .logo > span .dot, html[data-theme="light"] .logo .dot { -webkit-text-fill-color: var(--neon); }
html[data-theme="light"] .sec-title h2 .c, html[data-theme="light"] .free h2 .c, html[data-theme="light"] .kpay h2 .c { background: linear-gradient(180deg, #2A5BD0 0%, #0B1A3E 52%, #1D4BB8 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (max-width: 820px) { html[data-theme="light"] .side { background-color: rgba(250, 252, 255, .97); } html:not([data-theme="light"]) .side { background-color: rgba(14, 30, 66, .97); } }
html[data-theme="light"] .kpi .v { background: linear-gradient(180deg, #2A5BD0 0%, #0B1A3E 52%, #1D4BB8 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top .kw-prefs { margin-left: auto; margin-right: 10px; }
@media (max-width: 600px) {
  nav .bar .logo > span, .gx-nav .logo > span { font-size: 14px; letter-spacing: .12em; }
  nav .bar .logo img, .gx-nav .logo img { width: 26px; }
  nav .links, .gx-nav .links { gap: 6px !important; }
  nav .bar, .gx-nav { padding: 0 8px 0 10px; }
  .kw-prefs { gap: 3px; }
  .kw-switch button { min-width: 22px; min-height: 22px; padding: 3px 4px; }
  nav .links .btn.sm, .gx-nav .links .btn.sm { padding: 6px 10px; font-size: 12.5px; }
}

/* ===== KWAY ลายไทย (20 ต.ค.) — พื้นหลังลายไทยทั้งแอป + กรอบขลิบทองมุมลายกนก ===== */
:root { --thai-pattern: url(/img/thai-pattern.svg); --corner: url(/img/corner-gold.svg); --corner-br: url(/img/corner-gold-br.svg); --gold: #E8C27A;
  --rim: linear-gradient(135deg, rgba(243, 217, 154, .85), rgba(232, 194, 122, .28) 28%, rgba(232, 194, 122, .12) 55%, rgba(232, 194, 122, .32) 80%, rgba(243, 217, 154, .75)); }
html[data-theme="light"] { --thai-pattern: url(/img/thai-pattern-light.svg); --corner: url(/img/corner-gold-light.svg); --corner-br: url(/img/corner-gold-light-br.svg); --gold: #B07A1E;
  --rim: linear-gradient(135deg, rgba(176, 122, 30, .7), rgba(176, 122, 30, .2) 30%, rgba(176, 122, 30, .1) 55%, rgba(176, 122, 30, .25) 80%, rgba(176, 122, 30, .6)); }
/* พื้นลายไทย: วางทับแสงเดิม + จางลงที่ขอบล่าง (คล้ายผ้าไหมลายไทยมีแสงส่อง) */
body { background-image: var(--thai-pattern), radial-gradient(1400px 760px at 50% -18%, rgba(88, 132, 230, .55), transparent 62%), radial-gradient(900px 600px at 100% 0%, rgba(120, 150, 255, .16), transparent 60%), radial-gradient(900px 700px at 0% 100%, rgba(40, 90, 200, .22), transparent 60%), linear-gradient(180deg, #16306B 0%, #0F2352 38%, #0B1A3D 72%, #091633 100%);
  background-size: 44px 44px, auto, auto, auto, auto; background-attachment: fixed; }
html[data-theme="light"] body { background-image: var(--thai-pattern), radial-gradient(1300px 700px at 50% -20%, rgba(255, 255, 255, .95), transparent 62%), radial-gradient(900px 600px at 100% 0%, rgba(120, 190, 255, .35), transparent 60%), radial-gradient(900px 700px at 0% 100%, rgba(150, 175, 255, .35), transparent 60%), linear-gradient(180deg, #F6FAFF 0%, #EAF2FF 45%, #DCE8FF 100%);
  background-size: 44px 44px, auto, auto, auto, auto; }
body::before { opacity: .35; } /* ลดเส้นโครงข่ายเดิมไม่ให้แย่งลาย */
body::after { background: radial-gradient(ellipse at 50% 35%, transparent 45%, rgba(var(--n-4-10-30), .62) 100%); }
/* กรอบขลิบทอง + มุมลายกนก (มุมซ้ายบน + ขวาล่าง) */
.card:not(.no-corner):not(.credit-box):not(.gx-card):not(.final)::after, .modal:not(.no-corner)::after {
  content: ''; position: absolute; inset: 5px; width: auto; height: auto; pointer-events: none; z-index: 2; border-radius: inherit;
  background: var(--corner) left top / 22px 22px no-repeat, var(--corner-br) right bottom / 22px 22px no-repeat;
}
.modal { border-color: rgba(232, 194, 122, .45); }
.card:not(.no-corner):not(.credit-box):not(.gx-card):not(.final)::after { background-size: 20px 20px; }
