:root {
  --grass:#5d9e34; --grass-dark:#3f7a1f; --dirt:#7a5232; --dirt-dark:#5b3b22;
  --stone:#727272; --stone-dark:#3e3e3e; --text:#fff; --muted:#e6e6e6;
  --gui:#c6c6c6; --gui-text:#373737;
  --font:"Pixelify Sans","Kanit",system-ui,sans-serif;
  --px:48px; /* 1 บล็อก = พื้นผิว 16px ขยาย 3 เท่า */
}
* { box-sizing:border-box; border-radius:0 !important; }
html { scroll-behavior:smooth; }
/* มือถือ: ตัดดีเลย์ 300ms ตอนแตะ และไม่ให้มีกรอบฟ้ากะพริบ */
a { touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
/* ปุ่มขยับนุ่ม ๆ แทนการกระโดด (ขยับแค่ transform = ไม่ต้องวาดหน้าใหม่) */
nav > a, .btn, .links a, .mc, .pick span { transition:transform .08s ease-out, background-color .15s; }
body {
  margin:0; font-family:var(--font); color:var(--text); line-height:1.6;
  display:flex; flex-direction:column; min-height:100vh;
  /* ท้องฟ้ากลางคืน + ดาวพิกเซล */
  background:url(textures/stars.svg) 0 0/192px, linear-gradient(#070b24, #142257 55%, #2b3f78) fixed;
  background-attachment:fixed;
}
/* พระจันทร์ / พระอาทิตย์เหลี่ยม อยู่หลังทุกอย่าง */
body::before {
  content:""; position:fixed; z-index:-1; top:90px; right:8%; width:72px; height:72px;
  background:#e9ecd6; box-shadow:inset -12px -12px 0 #c9ccb4, inset 12px 12px 0 #f7f8ea, 0 0 0 6px #ffffff14;
}
/* ตัวหนังสือมีเงาแข็งแบบเกมพิกเซล */
h1, h2, nav > a, .btn, .links a, .mc { text-shadow:2px 2px 0 #3f3f3f; }
main { flex:1; width:100%; max-width:1000px; margin:0 auto; padding:24px 16px; }

/* เมนูบนสุด = ขอบหญ้าบนบล็อกดิน, ปุ่มเหมือนช่องไอเทม */
nav {
  position:sticky; top:0; z-index:2; display:flex; gap:10px; justify-content:center; flex-wrap:wrap; padding:22px 12px 12px;
  background:url(textures/grass-strip.svg) 0 0/var(--px) 18px repeat-x, url(textures/dirt.svg) 0 0/var(--px);
  border-bottom:4px solid #111; box-shadow:0 4px 0 #0006;
}

/* ปุ่มเมนูบนสุดกว้าง/สูงเท่ากันทุกปุ่ม */
nav > a, nav > .catalog > summary { display:flex; align-items:center; justify-content:center; box-sizing:border-box; min-width:9.5em; height:2.9em; white-space:nowrap; }

/* แคตตาล็อกช่อง = หน้าต่างกระเป๋าไอเทม เปิดลงมาจากปุ่ม */
.catalog { position:relative; }
.catalog summary { list-style:none; user-select:none; }
.catalog summary::-webkit-details-marker { display:none; }
.catalog[open] summary { background:#7b8fd6; box-shadow:inset 3px 3px 0 #4a5ba0, inset -3px -3px 0 #a9b8f0; }
.catalog-box {
  position:absolute; top:calc(100% + 10px); left:50%; transform:translateX(-50%); z-index:3;
  width:min(440px, calc(100vw - 24px)); max-height:70vh; overflow:auto; padding:12px;
  background:var(--gui); color:var(--gui-text); border:4px solid; border-color:#fff #555 #555 #fff;
  outline:3px solid #111; box-shadow:8px 8px 0 #0009; animation:place .15s ease-out;
}
.catalog-box > strong { display:block; margin:0 0 8px 4px; }
.catalog-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(96px, 1fr)); gap:6px; }
/* ช่องไอเทม: มืดบนซ้าย สว่างล่างขวา */
.slot {
  display:flex; flex-direction:column; align-items:center; gap:4px; padding:8px 4px; text-align:center;
  color:#fff; text-decoration:none; font-size:.85rem; font-weight:700; text-shadow:1px 1px 0 #3f3f3f;
  background:#8b8b8b; border:3px solid; border-color:#373737 #fff #fff #373737;
}
.slot img { width:56px; height:56px; object-fit:cover; border:2px solid #111; }
.slot span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%; }
.slot:hover { background:#a6a6c8; }
.slot[aria-current] { outline:3px solid #fff; outline-offset:-6px; background:#6f7fb8; }

/* ปุ่มสไตล์ปุ่มเมนูเกม: เทานูน กรอบดำ */
nav > a, .btn, .links a, .mc {
  display:inline-block; color:var(--text); text-decoration:none; padding:8px 16px; font-weight:700;
  background:var(--stone); border:3px solid #111;
  box-shadow:inset -3px -4px 0 var(--stone-dark), inset 3px 3px 0 #a8a8a8;
}
nav > a:hover, .btn:hover, .links a:hover, .mc:hover {
  background:#7b8fd6; box-shadow:inset -3px -4px 0 #4a5ba0, inset 3px 3px 0 #a9b8f0;
}
/* ลายพิกเซลหินมายคราฟบนปุ่มทุกสี: เบลนด์ทับสีพื้นของปุ่มนั้น (เขียว/แดง/ฟ้าตอนชี้) ไม่ต้องแก้ทีละสี */
nav > a, .btn, .links a, .mc {
  background-image:url(textures/stone.svg) !important; background-size:32px !important; background-position:0 0 !important;
  background-blend-mode:soft-light; image-rendering:pixelated; /* soft-light = ลายจาง ๆ ตัวหนังสือยังอ่านง่าย */
  text-shadow:2px 2px 0 #000c !important;
}
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline:3px solid #ffeb3b; outline-offset:2px; }

/* การ์ด = บล็อกดินมีหญ้าย้อยด้านบน */
.channel {
  margin-bottom:48px; scroll-margin-top:80px; padding:36px 20px 20px; border:4px solid #111;
  background:
    url(textures/grass-strip.svg) 0 0/var(--px) 18px repeat-x,
    linear-gradient(#0000004d, #00000066),
    url(textures/dirt.svg) 0 0/var(--px);
  box-shadow:8px 8px 0 #0009;
}
.head { display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin-bottom:16px; }
.head img, .pick img { object-fit:cover; background:var(--stone); border:4px solid #111; box-shadow:0 0 0 6px #6e5430; }
.head img { width:88px; height:88px; margin:6px; }
.head h1 { margin:0; font-size:2rem; }
.head p { margin:4px 0 0; color:var(--muted); white-space:pre-line; }
.btn, .mc.green, .pick span, .play { background:var(--grass); box-shadow:inset -3px -4px 0 var(--grass-dark), inset 3px 3px 0 #8fce5f; }
.btn { margin-left:auto; }
button.btn { font:inherit; font-weight:700; cursor:pointer; } /* ปุ่มจริงไม่สืบทอดฟอนต์ ทำให้เล็กกว่าปุ่มลิงก์ */
.head .row:has([data-upload]) { display:grid; grid-auto-flow:column; grid-auto-columns:1fr; } /* ปุ่มอัปโหลด + ปุ่ม Discord กว้างเท่ากัน */
.head .row:has([data-upload]) .btn { margin:0; text-align:center; }

h2 { font-size:1.3rem; margin:24px 0 10px; }
/* ไอคอนบล็อกหญ้าเล็ก ๆ หน้าหัวข้อ */
h2::before { content:""; display:inline-block; width:18px; height:18px; margin-right:10px; vertical-align:-2px;
  background:url(textures/grass-side.svg) 0 0/18px; border:2px solid #111; }

/* กรอบคลิป = ช่องไอเทมในหน้าต่างเกม (ขอบมืดบนซ้าย สว่างล่างขวา) */
.video { position:relative; aspect-ratio:16/9; background:#8b8b8b; border:4px solid; border-color:#373737 #fff #fff #373737; outline:3px solid #111; }
.video iframe { position:absolute; inset:4px; width:calc(100% - 8px); height:calc(100% - 8px); border:0; }
.cover {
  position:absolute; inset:4px; width:calc(100% - 8px); height:calc(100% - 8px); cursor:pointer;
  border:0; color:var(--text); font:inherit; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px;
  background:#222 center/cover no-repeat; overflow:hidden; touch-action:manipulation;
}
.cover::before { content:""; position:absolute; inset:0; background:#0007; transition:background-color .2s; }
.cover:hover::before { background:#0004; }
.cover > * { position:relative; }
.play {
  width:72px; height:52px; display:grid; place-items:center; font-size:1.6rem; border:3px solid #111;
  transition:transform .15s cubic-bezier(.3,1.4,.6,1);
}
.cover:hover .play { transform:scale(1.12); }
.cover:active .play { transform:scale(.95); transition-duration:.05s; }
.cover:focus-visible { outline:3px solid #ffeb3b; outline-offset:-3px; }
.cover-title { font-weight:700; text-shadow:2px 2px 0 #000; padding:0 12px; text-align:center; }
.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:20px; }
.grid p { margin:10px 0 0; font-weight:700; text-shadow:2px 2px 0 #3f3f3f; }
.links { display:flex; gap:12px; flex-wrap:wrap; }
.links a { display:inline-flex; align-items:center; gap:8px; line-height:24px; } /* สูงเท่าโลโก้พอดี = โลโก้ตกพิกเซลเต็ม ไม่เบี้ยว */
.links .ico { width:24px; height:24px; image-rendering:pixelated; filter:drop-shadow(2px 2px 0 #0006); }

/* ท้ายเว็บ = ชั้นดิน: หญ้า > ดิน > หิน > หินชั้นล่างสุด */
footer {
  min-height:220px; padding:80px 16px 24px; text-align:center; font-size:.95rem; color:#fff; text-shadow:2px 2px 0 #000;
  border-top:4px solid #111;
  background:
    url(textures/grass-side.svg) 0 0/var(--px) repeat-x,
    url(textures/dirt.svg) 0 var(--px)/var(--px) repeat-x,
    url(textures/bedrock.svg) 0 100%/var(--px) repeat-x,
    linear-gradient(#0000, #0000),
    url(textures/stone.svg) 0 0/var(--px);
}
/* ป้ายท้ายเว็บ = แผ่นหินออบซิเดียนฝังในชั้นหิน */
.foot-card {
  display:inline-flex; flex-direction:column; align-items:center; gap:6px; max-width:100%;
  padding:18px 28px 14px; background:#1b1426e6; border:4px solid #111;
  box-shadow:inset 3px 3px 0 #4a3a66, inset -3px -3px 0 #0b0812, 0 6px 0 #0008;
}
.foot-title {
  font-size:clamp(1.4rem, 4vw, 2rem); letter-spacing:1px; line-height:1.2; color:#ffd84a;
  text-shadow:3px 3px 0 #6b4a00;
}
.foot-row {
  display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:10px 14px;
  margin-top:6px; padding-top:10px; border-top:2px dashed #4a3a66; font-size:.85rem; color:#bfb3d6;
}

/* หน้ายินดีต้อนรับ: ชื่อเว็บแบบโลโก้หินนูน + ข้อความเหลืองเด้ง ๆ */
.welcome { text-align:center; padding-top:40px; }
.logo { position:relative; display:inline-block; margin:0 auto 8px; }
.welcome h1 {
  font-size:clamp(2.4rem, 7vw, 4rem); margin:0; color:#e8e8e8; letter-spacing:2px;
  text-shadow:3px 3px 0 #8a8a8a, 6px 6px 0 #4a4a4a, 9px 9px 0 #1c1c1c;
}
.splash {
  position:absolute; right:-28px; bottom:-14px; white-space:nowrap; color:#ffff55; font-weight:700; font-size:1.1rem;
  text-shadow:2px 2px 0 #3f3f15; transform:rotate(-16deg); animation:splash .45s ease-in-out infinite alternate;
}
@keyframes splash { to { transform:rotate(-16deg) scale(1.1); } }
#welcome-title { animation:title-bob 2.4s ease-in-out infinite; }
@keyframes title-bob { 25% { transform:translateY(-6px) rotate(-1.5deg); } 50% { transform:translateY(0); } 75% { transform:translateY(-6px) rotate(1.5deg); } }
.welcome > p { color:var(--muted); font-size:1.2rem; margin:24px 0 36px; text-shadow:2px 2px 0 #0008; }
.pick { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:28px; }
.pick a { color:var(--text); text-decoration:none; padding:36px 24px 28px; display:flex; flex-direction:column; align-items:center; gap:14px; transition:transform .18s cubic-bezier(.3,1.4,.6,1); }
.pick a:hover { transform:translateY(-6px); }
.pick img { width:128px; height:128px; margin:6px; }
.pick strong { font-size:1.6rem; text-shadow:2px 2px 0 #3f3f3f; }
.pick small { color:var(--muted); }
.pick span { padding:8px 20px; border:3px solid #111; font-weight:700; }
/* ป้าย LIVE: กรอบแดง + ป้ายใต้รูปช่องตอนกำลังไลฟ์ */
.avatar { position:relative; display:inline-block; line-height:0; }
.live-badge { display:none; position:absolute; left:50%; bottom:-10px; transform:translateX(-50%); line-height:1.2;
  padding:3px 10px; background:#e00; color:#fff; font-size:.85rem; letter-spacing:1px; border:3px solid #111; white-space:nowrap; }
.is-live .live-badge { display:block; animation:live-pulse 1.2s steps(2) infinite; }
.is-live .avatar img { border-color:#e00; box-shadow:0 0 0 6px #e00, 0 0 22px 6px #f008; }
.slot.is-live { border-color:#e00; }
@keyframes live-pulse { 50% { background:#900; } }
@media (prefers-reduced-motion: reduce) { .is-live .live-badge { animation:none; } }
[hidden] { display:none !important; }

/* ลูกเล่นตอนกด: ปุ่มยุบลง เงานูนกลับด้าน */
nav > a:active, .btn:active, .links a:active, .mc:active, .pick a:active span {
  transform:translateY(3px);
  box-shadow:inset 3px 3px 0 #0006, inset -3px -3px 0 #fff3 !important;
}
.pick a:active { transform:scale(.97); transition-duration:.05s; }
/* เปลี่ยนหน้า: ค่อย ๆ ลอยขึ้นมา */
main > section:not([hidden]) { animation:place .3s cubic-bezier(.2,.8,.3,1) both; }
@keyframes place { from { opacity:0; transform:translateY(16px); } }
/* ความสำเร็จ (Achievement Get!): กล่องเด้งมุมขวาบนแบบเกม */
.ach { position:fixed; top:16px; right:16px; z-index:50; display:flex; align-items:center; gap:12px; width:min(320px, calc(100vw - 32px));
  padding:10px 14px; background:#212121f2; border:3px solid #111; box-shadow:inset 0 0 0 2px #555, 4px 4px 0 #0008;
  font-family:"Kanit",system-ui,sans-serif; color:#fff; animation:ach-in .35s cubic-bezier(.2,.8,.3,1.2) both; pointer-events:none; }
.ach.out { animation:ach-out .4s ease-in both; }
.ach-icon { flex:none; display:grid; place-items:center; width:40px; height:40px; font-size:1.5rem; background:#8b8b8b; border:2px solid #111; box-shadow:inset -2px -2px 0 #555, inset 2px 2px 0 #c6c6c6; }
.ach div { display:flex; flex-direction:column; min-width:0; line-height:1.25; }
.ach b { color:#ffff55; font-weight:600; text-shadow:2px 2px 0 #3f3f15; }
.ach span:not(.ach-icon) { font-weight:600; }
.ach small { color:#ccc; font-size:.8rem; }
@keyframes ach-in { from { transform:translateY(-130%); } }
@keyframes ach-out { to { transform:translateY(-130%); opacity:0; } }
@media (prefers-reduced-motion: reduce) { .ach, .ach.out { animation-duration:.01s; } }
/* เศษบล็อกที่กระเด็นตอนคลิก */
.bit { position:fixed; width:8px; height:8px; pointer-events:none; z-index:9; border:1px solid #0006; }
@media (prefers-reduced-motion: reduce) {
  main > section:not([hidden]), .splash, #welcome-title, body.day::after { animation:none; }
}

/* ปุ่มที่เป็น <button> ให้หน้าตาเหมือนลิงก์ปุ่ม */
.mc { font:inherit; cursor:pointer; touch-action:manipulation; }
.mc.red { background:#b33a3a; box-shadow:inset -3px -4px 0 #7a2020, inset 3px 3px 0 #e06a6a; }

/* แถบประกาศ = ป้ายไม้กระดาน */
.announce {
  background:url(textures/planks.svg) 0 0/var(--px); color:#fff; text-align:center; padding:12px 16px; font-weight:700;
  border-bottom:4px solid #111; text-shadow:2px 2px 0 #3b2a12;
}

/* ตารางลงคลิป / เกี่ยวกับฉัน = หน้าต่างเกมสีเทา */
.schedule, .about {
  background:var(--gui); color:var(--gui-text); text-shadow:none;
  border:4px solid; border-color:#fff #555 #555 #fff; outline:3px solid #111;
}
.schedule { width:100%; border-collapse:separate; border-spacing:4px; }
.schedule th, .schedule td { padding:8px 12px; text-align:left; background:#8b8b8b; color:#fff; text-shadow:1px 1px 0 #3f3f3f;
  border:2px solid; border-color:#373737 #fff #fff #373737; }
.schedule th { background:#5a5a5a; }
.about { white-space:pre-line; padding:14px 18px; margin:0; font-family:"Kanit",system-ui,sans-serif; }

/* ปุ่มสลับกลางวัน/กลางคืน */
.music-toggle { position:fixed; right:16px; bottom:76px; z-index:5; font-size:1.4rem; padding:6px 12px; }
.music-box { position:fixed; right:16px; bottom:136px; z-index:5; width:min(280px, calc(100vw - 32px)); padding:6px;
  background:url(textures/planks.svg) 0 0/36px; border:4px solid #111; box-shadow:6px 6px 0 #0008; }
.music-box.is-file { width:auto; max-width:min(320px, calc(100vw - 32px)); padding:8px 14px; }
.music-title { display:block; color:#fff; font-weight:700; text-shadow:2px 2px 0 #3f3f3f; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.music-box iframe { display:block; width:100%; aspect-ratio:16/9; border:3px solid #111; }
.vol { display:flex; align-items:center; gap:8px; margin-top:6px; }
.vol .mc { font-size:1.1rem; padding:2px 10px; }
.vol-level { color:#7dd3fc; letter-spacing:-1px; text-shadow:2px 2px 0 #3f3f3f; font-size:.9rem; }
.theme-toggle { position:fixed; right:16px; bottom:16px; z-index:5; font-size:1.4rem; padding:6px 12px; }
/* กลางวัน: ฟ้าใส พระอาทิตย์ เมฆลอย */
body.day { background:linear-gradient(#5b9bff, #9fcbff 60%, #d4ecff) fixed; }
body.day::before { background:#fff27a; box-shadow:inset -10px -10px 0 #f5d43c, 0 0 0 10px #fff27a44, 0 0 0 20px #fff27a22; }
body.day::after {
  content:""; position:fixed; z-index:-1; left:0; right:0; top:40px; height:200px; pointer-events:none;
  background:url(textures/clouds.svg) 0 0/768px 192px repeat-x; animation:drift 120s linear infinite;
}
@keyframes drift { to { background-position:768px 0; } }
body.day .welcome > p { color:#1d3557; text-shadow:none; }

/* แจ้งเตือนเล็กด้านล่าง */
.toast {
  position:fixed; left:50%; bottom:24px; transform:translateX(-50%); z-index:10;
  background:#111; color:#fff; padding:10px 18px; border:3px solid var(--grass);
  animation:place .2s ease-out;
}

/* ฟอร์มหลังบ้าน */
.form { display:grid; gap:12px; }
.form label { display:grid; gap:4px; font-weight:600; }
.form small { color:var(--muted); font-weight:400; }
.form input, .form textarea {
  font:inherit; font-family:"Kanit",system-ui,sans-serif; padding:8px 10px; color:#fff;
  background:#111; border:3px solid; border-color:#373737 #a0a0a0 #a0a0a0 #373737;
}
.form textarea { min-height:90px; resize:vertical; }
.row { display:flex; gap:12px; flex-wrap:wrap; align-items:center; }
.error { color:#ffb4b4; font-weight:700; }

@media (max-width:600px) {
  body::before { width:48px; height:48px; top:110px; }
  .splash { right:0; bottom:-24px; font-size:.95rem; }
}
/* มือถือ: แคตตาล็อกเต็มความกว้างจอ ไม่ล้นขอบ */
@media (max-width:600px) {
  .catalog-box { position:fixed; top:76px; left:12px; right:12px; width:auto; transform:none; }
}

/* หน้าเปิดเว็บ: เมนูปุ่มเรียงลงแบบหน้าเปิดเกม */
.menu { display:grid; gap:14px; width:min(480px, 100%); margin:0 auto; }
.menu .big { font-size:1.4rem; padding:16px; }
.menu-links { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:14px; }
.menu-links a, .menu-links button { font:inherit; cursor:pointer; display:flex; flex-direction:column; align-items:center; line-height:1.3; }
.menu-links small { font-weight:400; font-size:.8rem; opacity:.9; }
/* ปุ่มสุดท้ายที่อยู่คนเดียวในแถว (ปุ่มที่เห็นเป็นเลขคี่) = อยู่กลาง กว้างเท่าปุ่มอื่น / จอแคบ (คอลัมน์เดียว) = เต็มแถวเหมือนเดิม */
.menu-links { container-type:inline-size; }
@container (min-width:414px) {
  .menu-links > :nth-last-child(1 of :not([hidden])):nth-child(odd of :not([hidden])) { grid-column:1 / -1; justify-self:center; width:calc(50% - 7px); }
}
@media (min-width:1280px) { .menu-links > :nth-last-child(1 of :not([hidden])):nth-child(odd of :not([hidden])) { width:calc(50% - 9px); } }
/* อ่านง่าย: ปุ่มหน้าแรกใช้ Kanit (ยังเป็นปุ่มหินแบบมายคราฟ) เงาบางลง บรรทัดเล็กสว่างขึ้น */
.menu .mc { font-family:"Kanit",system-ui,sans-serif; font-weight:600; letter-spacing:.3px; text-shadow:1px 1px 0 #2b2b2b; }
.menu-links small { opacity:1; color:#ececec; font-size:.85rem; margin-top:2px; }
#welcome-text { font-family:"Kanit",system-ui,sans-serif; font-size:1.05rem; text-shadow:1px 1px 0 #000; }
/* จอ HD ขึ้นไป: ขยายเมนูกับปุ่มมุมขวาให้กดง่ายขึ้น */
@media (min-width:1280px) {
  .menu { width:600px; gap:18px; }
  .menu .big { font-size:1.8rem; padding:20px; }
  .menu-links { gap:18px; }
  .menu-links .mc { font-size:1.3rem; padding:14px; }
  .menu-links small { font-size:.95rem; }
  .music-toggle, .theme-toggle { font-size:1.8rem; padding:8px 16px; }
  .music-toggle { bottom:92px; }
  .music-box { bottom:164px; }
  .viewer.upload { width:min(92vw, 620px); font-size:1.15rem; padding:20px 24px; }
  .viewer.upload h2 { font-size:1.6rem; }
  .viewer.upload small { font-size:.9rem; }
  .viewer.upload .form input, .viewer.upload .form textarea, .viewer.upload .mc { font-size:1.05rem; padding:10px 12px; }
  .viewer.upload .form textarea { min-height:110px; }
  .viewer.upload input[type=checkbox] { width:20px; height:20px; }
}
.pick-title { margin:0 0 28px; font-size:clamp(1.8rem, 5vw, 2.6rem); }

/* แกลเลอรีแฟนอาร์ต: รูปในกรอบไม้แบบกรอบใส่ไอเทม */
.gallery { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:20px; }
.gallery figure { margin:0; }
.gallery figcaption { margin-top:8px; text-align:center; font-weight:700; text-shadow:2px 2px 0 #3f3f3f; }
.frame {
  display:block; width:100%; aspect-ratio:1; padding:10px; cursor:pointer;
  background:url(textures/planks.svg) 0 0/36px; border:4px solid #111; box-shadow:6px 6px 0 #0008;
  transition:transform .15s cubic-bezier(.3,1.4,.6,1);
}
.frame:hover { transform:translateY(-4px) rotate(-1deg); }
/* กรอบน่ารัก 8 แบบ (สุ่มตามรูปใน index.html: frameCls) + สติกเกอร์มุมซ้ายล่าง */
.frame { position:relative; }
.frame::after { position:absolute; left:-10px; bottom:-10px; font-size:1.8rem; line-height:1; transform:rotate(-12deg);
  filter:drop-shadow(2px 2px 0 #000); pointer-events:none; }
.frame.f0::after { content:"🌼"; }
.frame.f1 { background:repeating-linear-gradient(45deg, #ff9ec7 0 8px, #fff 8px 16px); border-color:#b8326e; }
.frame.f1::after { content:"🎀"; }
.frame.f2 { background:radial-gradient(#fff 25%, transparent 28%) 0 0/12px 12px, #7fdcb6; border-color:#2e7d5b; }
.frame.f2::after { content:"🍀"; }
.frame.f3 { background:conic-gradient(#c9b3ff 25%, #efe6ff 0 50%, #c9b3ff 0 75%, #efe6ff 0) 0 0/12px 12px; border-color:#5b3fa0; }
.frame.f3::after { content:"⭐"; }
.frame.f4 { background:linear-gradient(135deg, #fff1a8, #f6b93b 40%, #ffe27a 60%, #e09a1a); border-color:#8a5a00; }
.frame.f4::after { content:"👑"; }
.frame.f5 { background:radial-gradient(#fff 32%, transparent 35%) 0 0/16px 16px, #8fd3ff; border-color:#2a6fa8; }
.frame.f5::after { content:"☁️"; }
.frame.f6 { background:radial-gradient(#ff5c82 28%, transparent 31%) 0 0/14px 14px, #ffe3ea; border-color:#c2185b; }
.frame.f6::after { content:"🍓"; }
.frame.f7 { background:repeating-linear-gradient(135deg, #c9f6ff 0 6px, #7fe0f0 6px 12px); border-color:#1b8aa0; }
.frame.f7::after { content:"💎"; }
.strip .frame::after { font-size:1.2rem; left:-6px; bottom:-6px; }
.frame img { width:100%; height:100%; object-fit:cover; display:block; border:3px solid #111; background:#222; }
/* แถบแฟนอาร์ตหน้าแรก: เลื่อนวนไปเรื่อย ๆ ชี้/โฟกัสแล้วหยุด */
.strip { margin:36px -16px 0; padding:8px 0 14px; overflow:hidden;
  -webkit-mask-image:linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image:linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.strip-track { display:flex; gap:16px; padding-right:16px; width:max-content; animation:strip 120s linear infinite; }
.strip:hover .strip-track, .strip:focus-within .strip-track { animation-play-state:paused; }
.strip .frame { width:150px; flex:none; padding:7px; position:relative; }
/* ป้าย "ใหม่" บนรูปที่เพิ่งขึ้นเว็บไม่เกิน 3 วัน */
.new-badge { position:absolute; top:2px; right:2px; padding:1px 8px; font-size:.85rem; font-weight:700; color:#fff;
  background:#e0335a; border:2px solid #111; box-shadow:inset -2px -2px 0 #9c1f3b; transform:rotate(6deg);
  text-shadow:1px 1px 0 #000; animation:new-blink 1.2s ease-in-out infinite alternate; }
@keyframes new-blink { to { transform:rotate(6deg) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .new-badge { animation:none; } }
/* ปุ่ม "♥ หัวใจมากที่สุด": กดอยู่ = สีชมพูแดงเหมือนหัวใจ / API หัวใจล่ม = ซ่อน */
.sort-btn { font:inherit; cursor:pointer; }
.sort-btn[aria-pressed="true"] { background:#e0335a; box-shadow:inset -3px -4px 0 #9c1f3b, inset 3px 3px 0 #ff7d9c; }
.no-likes .sort-btn { display:none; }
/* ป้าย "ใหม่!" บนปุ่มเลือกแกลเลอรีที่มีรูปใหม่ */
#fan-grid .slot, #fan-pick > a { position:relative; }
@keyframes strip { to { transform:translateX(-50%); } }
.strip-track.still { animation:none; width:auto; flex-wrap:wrap; justify-content:center; padding:0 16px; }
/* ปุ่มหัวใจ: เทา = ยังไม่กด, ชมพูแดง = กดแล้ว */
.heart {
  font:inherit; font-weight:700; font-size:1.05rem; cursor:pointer; padding:2px 12px; margin-left:6px; vertical-align:middle;
  color:#fff; background:#5a5a5a; border:2px solid #111; box-shadow:inset -2px -3px 0 #3a3a3a, inset 2px 2px 0 #8a8a8a;
  transition:transform .1s; position:relative;
}
/* กดหัวใจ: ปุ่มเด้ง + หัวใจเล็ก ๆ ลอยกระจายขึ้น */
.heart.pop { animation:heart-pop .45s ease-out; }
@keyframes heart-pop { 30% { transform:scale(1.35); } 60% { transform:scale(.95); } }
.heart .fly { position:absolute; left:50%; top:50%; color:#ff5c82; font-size:1rem; pointer-events:none; text-shadow:1px 1px 0 #111;
  animation:heart-fly .8s ease-out forwards; }
@keyframes heart-fly {
  from { transform:translate(-50%,-50%) scale(.6); opacity:1; }
  to { transform:translate(calc(-50% + var(--dx)), -60px) scale(1.3) rotate(var(--r)); opacity:0; }
}
@media (prefers-reduced-motion: reduce) { .heart.pop, .heart .fly { animation:none; } .heart .fly { display:none; } }
.heart:hover { transform:scale(1.08); }
.heart:active { transform:scale(.92); }
.heart.on { background:#e0335a; box-shadow:inset -2px -3px 0 #9c1f3b, inset 2px 2px 0 #ff7d9a; }
.no-likes .heart { display:none; }
.gallery figcaption { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:4px; }
.viewer .heart { font-size:1.1rem; padding:6px 16px; margin:0 0 10px; }
.foot-views { color:#ffd84a; }
/* ตัวเลข: ฟอนต์พิกเซลทำให้ 5 กับ S, 0 กับ O ดูเหมือนกัน ใช้ Kanit ที่อ่านง่ายแทน */
.heart, .foot-row, #fan-pick small { font-family:"Kanit",system-ui,sans-serif; font-variant-numeric:tabular-nums; }
.foot-row { font-size:.95rem; }
/* แฟนอาร์ตประจำวัน: กรอบใหญ่กลางจอ มีแสงทองรอบ ๆ */
.daily { margin:40px auto 0; max-width:360px; text-align:center; }
.daily-title { margin:0 0 14px; font-size:1.5rem; color:#ffd84a; text-shadow:3px 3px 0 #6b4a00; }
.daily .frame { width:min(320px, 80vw); margin:0 auto; box-shadow:6px 6px 0 #0008, 0 0 32px 6px #ffd84a55; }
.daily-by { margin:14px 0 0; font-weight:700; text-shadow:2px 2px 0 #000; word-break:break-word; }
.daily-by:empty { display:none; }
/* แท่นรางวัล 5 อันดับ: เรียง 4 · 2 · 1 · 3 · 5 ที่ 1 ตรงกลางใหญ่สุด ไล่เล็กลงออกด้านข้าง (มือถือ: ที่ 1 อยู่บน) */
.daily.has-podium { max-width:1000px; }
.podium { display:flex; justify-content:center; align-items:flex-end; gap:16px; }
.podium-card { position:relative; flex:0 1 190px; min-width:0; }
.podium-card.rank1 { order:3; flex-basis:250px; }
.podium-card.rank2 { order:2; }
.podium-card.rank3 { order:4; }
.podium-card.rank4 { order:1; flex-basis:150px; }
.podium-card.rank5 { order:5; flex-basis:150px; }
.daily .podium .frame { width:100%; }
.podium .rank1 .frame { box-shadow:6px 6px 0 #0008, 0 0 36px 8px #ffd84a77; }
.podium .rank2 .frame { box-shadow:6px 6px 0 #0008, 0 0 26px 4px #d8e2eecc; }
.podium .rank3 .frame { box-shadow:6px 6px 0 #0008, 0 0 26px 4px #d9884acc; }
/* กรอบรูปเป็นบล็อกเดียวกับเสา (ทอง/เหล็ก/ทองแดง/หิน) ไม่มีสติกเกอร์มุม ป้ายชื่อแบบ nametag บรรทัดเดียว */
.podium .frame { padding:8px; background:url(textures/stone.svg) 0 0/32px; border-color:#111; image-rendering:pixelated; }
.podium .frame:hover { transform:translateY(-4px); }
.podium .frame::after { content:none; }
.podium .rank1 .frame { background-image:url(textures/gold.svg); }
.podium .rank2 .frame { background-image:url(textures/iron.svg); }
.podium .rank3 .frame { background-image:url(textures/copper.svg); }
.podium .frame img { image-rendering:auto; }
.podium-by { display:flex; align-items:center; gap:6px; margin:12px auto 10px; padding:3px 4px 3px 10px; width:fit-content; max-width:100%;
  background:#000b; border:2px solid #111; font:700 .85rem "Kanit",system-ui,sans-serif; text-shadow:1px 1px 0 #000; }
.podium-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.podium-by .heart { flex:none; }
@media (max-width:600px) {
  .podium { flex-wrap:wrap; gap:22px 14px; }
  .podium-card.rank1 { order:0; flex-basis:100%; max-width:280px; }
  .podium-card.rank2, .podium-card.rank3, .podium-card.rank4, .podium-card.rank5 { flex-basis:calc(50% - 7px); }
  .podium-card.rank2 { order:1; } .podium-card.rank3 { order:2; } .podium-card.rank4 { order:3; } .podium-card.rank5 { order:4; }
}
@media (prefers-reduced-motion: reduce) { .strip { overflow-x:auto; } .strip-track { animation:none; } }
@media (max-width:600px) { .strip .frame { width:110px; } }
.empty { background:#0006; border:3px dashed #fff8; padding:24px; text-align:center; font-size:1.1rem; }
/* ดูรูปใหญ่ */
.viewer { max-width:min(92vw, 900px); padding:12px; background:var(--gui); color:var(--gui-text); text-align:center;
  border:4px solid; border-color:#fff #555 #555 #fff; outline:3px solid #111; }
.viewer::backdrop { background:#000c; }
.viewer img { max-width:100%; max-height:75vh; display:block; margin:0 auto; border:3px solid #111; }
.viewer p { margin:8px 0; font-weight:700; }
/* หน้าต่างอัปโหลดแฟนอาร์ต (พื้นเทาอ่อนแบบหน้าต่างในเกม) */
.upload { width:min(92vw, 440px); text-align:left; }
.upload h2 { margin:0; text-align:center; }
.upload small { color:#555; }
.upload select { font:inherit; font-family:"Kanit",system-ui,sans-serif; padding:8px; color:#fff; background:#111; border:3px solid #a0a0a0; }
.upload input[type=file] { color:var(--gui-text); background:#fff8; }
.upload .check { display:flex; align-items:flex-start; gap:8px; font-weight:400; }
.upload .check input { margin-top:5px; width:18px; height:18px; }
.upload #up-preview { max-height:180px; }
.upload .up-note { margin:0; font-weight:400; color:#555; }
.upload .error { color:#b3002d; margin:0; }
.upload .error.ok { color:#1e6b1e; }
.upload .error:empty { display:none; }

/* ===== หลังบ้าน: หน้าต่าง GUI สีเทาอ่อนแบบในเกม อ่านสบายตา + แถบแท็บแบบ hotbar ===== */
.admin { max-width:1100px; display:grid; gap:16px; align-content:start; } /* ไม่ให้กล่องยืดเต็มความสูงจอ */
.admin #editor:not([hidden]) { display:grid; gap:16px; align-content:start; }
.gui {
  background:var(--gui); color:var(--gui-text); padding:18px 20px;
  border:4px solid; border-color:#fff #555 #555 #fff; outline:3px solid #111; box-shadow:6px 6px 0 #0006;
}
.gui h1, .gui h2 { color:#2b2b2b; text-shadow:1px 1px 0 #fff9; margin:0; }
.gui h1 { font-size:1.6rem; }
.gui h2 { font-size:1.35rem; }
.gui h2::before { display:none; }
.gui small, .gui .hint { color:#555; }
.gui .hint { margin:0; font-weight:400; line-height:1.6; }
.gui .status { margin:0; padding:8px 12px; background:#8b8b8b; color:#fff; font-weight:700; text-shadow:1px 1px 0 #3f3f3f;
  border:3px solid; border-color:#555 #fff #fff #555; }
.gui .error { color:#b3002d; margin:0; }
.gui .error:empty { display:none; }
.gui label { color:#373737; }
.gui select { font:inherit; font-family:"Kanit",system-ui,sans-serif; padding:7px 10px; color:#fff; background:#111;
  border:3px solid; border-color:#373737 #a0a0a0 #a0a0a0 #373737; }
.gui .inline { display:flex; align-items:center; gap:10px; }
.lock { max-width:440px; width:100%; margin:40px auto 0; display:grid; gap:14px; }
/* หัวหน้า + แถบเชื่อม GitHub */
.admin-top { display:grid; gap:12px; }
.gh-bar { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.gh-bar input { flex:1 1 220px; font:inherit; font-family:"Kanit",system-ui,sans-serif; padding:8px 10px; color:#fff; background:#111;
  border:3px solid; border-color:#373737 #a0a0a0 #a0a0a0 #373737; }
.gh-status { font-weight:700; padding:6px 10px; background:#fff6; border:2px solid #555; }
.gh-bar.linked .gh-status { background:#c8f0b0; border-color:#3c7a1e; color:#1e4d0c; }
/* hotbar: ช่องเทาเข้ม ช่องที่เลือกขอบขาวหนาแบบในเกม */
.hotbar { display:flex; gap:6px; padding:6px; background:#0008; border:3px solid #111; overflow-x:auto; }
.hotbar button {
  position:relative; flex:1 0 110px; display:grid; justify-items:center; gap:2px; padding:10px 8px; cursor:pointer;
  font:inherit; font-weight:700; color:#fff; text-shadow:2px 2px 0 #3f3f3f;
  background:#8b8b8b; border:3px solid; border-color:#373737 #fff #fff #373737;
}
.hotbar button span { font-size:1.6rem; line-height:1; }
.hotbar button:hover { background:#a0a0a0; }
.hotbar button[aria-selected="true"] { background:#c6c6c6; color:#2b2b2b; text-shadow:none; outline:3px solid #fff; outline-offset:-1px; box-shadow:0 0 0 3px #111; z-index:1; }
/* ป้ายแดงมีของรอตรวจ: เด้งเบา ๆ ให้สะดุดตา */
.hotbar .badge:not([hidden]) { animation:badge-pop 1s ease-in-out infinite alternate; }
@keyframes badge-pop { to { transform:scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .hotbar .badge { animation:none !important; } }
.hotbar .badge { position:absolute; top:4px; right:6px; min-width:22px; padding:0 6px; font-size:.85rem; color:#fff; text-shadow:none;
  background:#e0335a; border:2px solid #111; font-family:"Kanit",system-ui,sans-serif; }
.hotbar.sub button { flex-basis:120px; padding:6px 8px; }
.hotbar.sub button span { font-size:1.2rem; }
.block-icon { display:inline-block; vertical-align:-2px; width:1em; height:1em; background:url(textures/grass-side.svg) 0 0/100%; border:2px solid #111; image-rendering:pixelated; }
/* กดแท็บให้ลื่น: ขยับเฉพาะ transform/opacity (การ์ดจอทำให้ เลยได้ 60fps) */
.hotbar button { transition:transform .12s ease-out, background-color .15s; }
.hotbar button span { transition:transform .2s cubic-bezier(.3,1.4,.6,1); }
.hotbar button:hover span { transform:translateY(-3px) scale(1.12); }
.hotbar button:active { transform:translateY(3px); transition-duration:.05s; }
.panel { display:grid; gap:14px; align-content:start; }
.panel:not([hidden]) { animation:place .25s cubic-bezier(.2,.8,.3,1) both; }
@media (prefers-reduced-motion: reduce) { .hotbar button, .hotbar button span, .panel:not([hidden]) { transition:none; animation:none; } .hotbar button:hover span { transform:none; } }
.panel[hidden] { display:none; }
/* การ์ดรูปในหลังบ้าน */
.gui .gallery figure { background:#8b8b8b; padding:10px; border:3px solid; border-color:#555 #fff #fff #555; display:grid; gap:6px; align-content:start; }
.gui .gallery figcaption { color:#fff; text-shadow:1px 1px 0 #3f3f3f; font-weight:700; text-align:center; margin:0; }
.gui .gallery input, .gui .gallery select { width:100%; }
.gui .gallery .row { flex-wrap:nowrap; }
.gui .gallery .row .mc { flex:1; padding-inline:6px; }
/* ฟอร์มช่องยูทูปแต่ละช่อง = การ์ดเทาเข้มในหน้าต่าง */
.panel .channel { background:#b3b3b3; border:3px solid; border-color:#555 #fff #fff #555; outline:none; box-shadow:none; padding:14px; margin:0 0 12px; }
.panel .channel h2 { color:#2b2b2b; }
.panel .channel { content-visibility:auto; contain-intrinsic-size:auto 1300px; } /* ฟอร์มช่องที่อยู่นอกจอยังไม่ต้องวาด แท็บเปิดไวขึ้น */
.admin .form label { color:#373737; }
/* แถบดาวน์โหลด data.js ติดขอบล่างจอ */
.savebar { position:sticky; bottom:12px; z-index:5; display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:flex-end; padding:12px 16px; }
.savebar[hidden] { display:none; }
.savebar .error { flex:1 1 100%; }
@media (max-width:600px) { .hotbar button { flex-basis:86px; font-size:.85rem; } .gui { padding:14px; } }

/* ===== ล็อกอิน Discord ===== */
.mc.discord { background:#5865f2; box-shadow:inset -3px -4px 0 #3c45a5, inset 3px 3px 0 #8b93ff; }
.mc.discord:hover { background:#6b77ff; }
.me { display:inline-flex; align-items:center; gap:8px; padding:3px 3px 3px 6px; color:#fff; font-weight:700; text-shadow:2px 2px 0 #3f3f3f;
  background:#0007; border:3px solid #111; }
.me[hidden] { display:none; }
.me img { width:28px; height:28px; border:2px solid #111; image-rendering:auto; }
.me b { max-width:140px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.me .mc { padding:4px 10px; font-size:.85rem; }
.upload .up-who { margin:0; display:block; text-align:left; font-weight:400; color:#373737; }
.upload .up-who img { width:24px; height:24px; border:2px solid #111; vertical-align:middle; display:inline-block; margin:0 4px; }
.upload .form[hidden] { display:none; }
.gh-bar.via-discord input, .gh-bar.via-discord button[type=submit] { display:none; }
.lock .discord { justify-self:start; font-size:1.1rem; padding:10px 18px; }
.lock .error, .gui .error { font-family:"Kanit",system-ui,sans-serif; } /* ตัวเลข ID อ่านง่าย */
/* แคตตาล็อกเลือกช่อง/แกลเลอรี: ช่องเข้มขึ้น รูปใหญ่ขึ้น ชื่อใช้ Kanit อ่านง่าย */
.catalog-box > strong { font-family:Kanit, sans-serif; font-size:1.05rem; color:#3f3f3f; }
.catalog-grid { grid-template-columns:repeat(auto-fill, minmax(120px, 1fr)); gap:10px; }
.slot { padding:12px 6px 10px; gap:8px; background:#5b5b6e; font-family:Kanit, sans-serif; font-size:.95rem; font-weight:600;
  text-shadow:2px 2px 0 #1e1e28; transition:background .12s, transform .12s; }
.slot img { width:72px; height:72px; border:3px solid #111; box-shadow:3px 3px 0 #0006; image-rendering:auto; }
.slot:hover, .slot:focus-visible { background:#6f7fd0; transform:translateY(-2px); }
.slot[aria-current] { background:#4c8f3a; outline:3px solid #ffe066; }
@media (prefers-reduced-motion: reduce) { .slot { transition:none; } .slot:hover { transform:none; } }
/* กันกดค้างเซฟรูปบนมือถือ (iOS) */
.gallery img, .strip img, .frame img { -webkit-touch-callout:none; -webkit-user-drag:none; user-select:none; }
/* ติ๊กถูกสีฟ้าแบบบล็อกพิกเซลมายคราฟ (แอดมินกดยืนยันในหลังบ้าน) */
span.verified { display:inline-block; width:.95em; height:.95em; margin-left:.3em; vertical-align:-.08em; flex:none;
  background:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' shape-rendering='crispEdges'><rect x='0' y='0' width='10' height='10' fill='%23082c57'/><rect x='1' y='1' width='8' height='8' fill='%233ea6ff'/><rect x='1' y='1' width='8' height='1' fill='%2395d5ff'/><rect x='1' y='1' width='1' height='8' fill='%2395d5ff'/><rect x='1' y='8' width='8' height='1' fill='%231c64b8'/><rect x='8' y='1' width='1' height='8' fill='%231c64b8'/><rect x='2' y='4' width='1' height='1' fill='%23fff'/><rect x='2' y='5' width='1' height='1' fill='%23fff'/><rect x='3' y='5' width='1' height='1' fill='%23fff'/><rect x='3' y='6' width='1' height='1' fill='%23fff'/><rect x='4' y='6' width='1' height='1' fill='%23fff'/><rect x='4' y='7' width='1' height='1' fill='%23fff'/><rect x='5' y='5' width='1' height='1' fill='%23fff'/><rect x='5' y='6' width='1' height='1' fill='%23fff'/><rect x='6' y='4' width='1' height='1' fill='%23fff'/><rect x='6' y='5' width='1' height='1' fill='%23fff'/><rect x='7' y='3' width='1' height='1' fill='%23fff'/><rect x='7' y='4' width='1' height='1' fill='%23fff'/></svg>") center/100% no-repeat; image-rendering:pixelated; color:transparent; overflow:hidden;
  text-shadow:none; filter:drop-shadow(2px 2px 0 #0007); }
.verified[hidden] { display:none; }
.pick .verified { padding:0; border:0; box-shadow:none; background-color:transparent; font-weight:400; }
.verify-btn::before { content:""; display:inline-block; width:16px; height:16px; margin-right:6px; vertical-align:-3px;
  background:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' shape-rendering='crispEdges'><rect x='0' y='0' width='10' height='10' fill='%23082c57'/><rect x='1' y='1' width='8' height='8' fill='%233ea6ff'/><rect x='1' y='1' width='8' height='1' fill='%2395d5ff'/><rect x='1' y='1' width='1' height='8' fill='%2395d5ff'/><rect x='1' y='8' width='8' height='1' fill='%231c64b8'/><rect x='8' y='1' width='1' height='8' fill='%231c64b8'/><rect x='2' y='4' width='1' height='1' fill='%23fff'/><rect x='2' y='5' width='1' height='1' fill='%23fff'/><rect x='3' y='5' width='1' height='1' fill='%23fff'/><rect x='3' y='6' width='1' height='1' fill='%23fff'/><rect x='4' y='6' width='1' height='1' fill='%23fff'/><rect x='4' y='7' width='1' height='1' fill='%23fff'/><rect x='5' y='5' width='1' height='1' fill='%23fff'/><rect x='5' y='6' width='1' height='1' fill='%23fff'/><rect x='6' y='4' width='1' height='1' fill='%23fff'/><rect x='6' y='5' width='1' height='1' fill='%23fff'/><rect x='7' y='3' width='1' height='1' fill='%23fff'/><rect x='7' y='4' width='1' height='1' fill='%23fff'/></svg>") center/100% no-repeat; filter:grayscale(1) brightness(1.3); }
.verify-btn[aria-pressed="true"] { background:#3ea6ff; color:#fff; box-shadow:inset -3px -4px 0 #1c64b8, inset 3px 3px 0 #95d5ff; }
.verify-btn[aria-pressed="true"]::before { filter:none; }
/* สมัครลงช่อง: ตัวอย่างรูปโปรไฟล์ */
.ap-preview { width:96px; height:96px; object-fit:cover; border:3px solid #111; image-rendering:auto; }
/* หลังบ้าน: การ์ดใบสมัครช่อง */
.apps { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:14px; }
.app-card { padding:12px; font-family:Kanit, sans-serif; }
.app-card img { width:64px; height:64px; object-fit:cover; border:3px solid #111; flex:none; }
.app-card p { margin:8px 0 0; overflow-wrap:anywhere; }

/* ===== ธีมมายคราฟเพิ่มเติม (หน้าแรก) ===== */
/* 1) เมฆเหลี่ยมกลางคืน: เป็นชั้นพื้นหลังของ body (ไม่ใช่ ::after จะได้ไม่บังเนื้อหา) จาง ๆ ไม่เลื่อน */
body:not(.day) { background:url(textures/clouds-night.svg) 0 70px/768px 192px repeat-x, url(textures/stars.svg) 0 0/192px,
  linear-gradient(#070b24, #142257 55%, #2b3f78) fixed; background-attachment:fixed; }

/* 2) ขอบฟ้า: เนินเขาเหลี่ยม + ต้นไม้พิกเซล 2 ชั้น ก่อนพื้นหญ้าท้ายเว็บ (ชั้นไกลจางกว่า เลื่อนเยื้อง ให้ดูลึก) */
.horizon { position:relative; height:96px; margin-top:24px; pointer-events:none; }
.horizon::before, .horizon::after { content:""; position:absolute; left:0; right:0; bottom:0; }
.horizon::before { top:0; background:#1c2c66; opacity:.9;
  -webkit-mask:url(textures/hills.svg) 190px 100%/480px 120px repeat-x; mask:url(textures/hills.svg) 190px 100%/480px 120px repeat-x; }
.horizon::after { top:24px; background:#0b1540;
  -webkit-mask:url(textures/hills.svg) 0 100%/384px 96px repeat-x; mask:url(textures/hills.svg) 0 100%/384px 96px repeat-x; }
body.day .horizon::before { background:#8cc276; }
body.day .horizon::after { background:#4c8a2f; }

/* 3) แท่นรางวัลบนบล็อก: ที่ 1 บล็อกทอง ที่ 2 เหล็ก ที่ 3 ทองแดง ที่ 4-5 หิน สูงไม่เท่ากัน มีเลขอันดับบนหน้าบล็อก */
.podium-card { padding-bottom:var(--pillar, 32px); }
.podium-card::after {
  position:absolute; left:6%; right:6%; bottom:0; height:var(--pillar, 32px);
  display:flex; align-items:center; justify-content:center; font:800 1.6rem/1 "Kanit", sans-serif; /* ฟอนต์พิกเซลทำ 3/5 ดูเหมือน 8 */ color:#fff;
  text-shadow:-2px 0 #111, 2px 0 #111, 0 -2px #111, 0 2px #111, 3px 3px 0 #0008; /* ตัวขาวขอบดำ อ่านชัดทุกบล็อก */ border:3px solid #111; box-shadow:inset -4px -4px 0 #0003, inset 4px 4px 0 #fff3, 4px 4px 0 #0007;
  background:url(textures/stone.svg) 0 0/32px; image-rendering:pixelated;
}
.podium-card.rank1 { --pillar:84px; } .podium-card.rank1::after { background-image:url(textures/gold.svg); font-size:2.2rem; }
.podium-card.rank2 { --pillar:60px; } .podium-card.rank2::after { background-image:url(textures/iron.svg); }
.podium-card.rank3 { --pillar:44px; } .podium-card.rank3::after { background-image:url(textures/copper.svg); }
.podium-card.rank4, .podium-card.rank5 { --pillar:30px; }
.podium-card.rank1::after { content:"1"; } .podium-card.rank2::after { content:"2"; } .podium-card.rank3::after { content:"3"; } .podium-card.rank4::after { content:"4"; } .podium-card.rank5::after { content:"5"; }
.podium-by { position:relative; z-index:1; }
@media (max-width:600px) {
  .podium-card.rank1 { --pillar:48px; } .podium-card.rank2, .podium-card.rank3 { --pillar:34px; } .podium-card.rank4, .podium-card.rank5 { --pillar:24px; }
  .podium-card::after { font-size:1.2rem; }
}

/* 4) แถบแฟนอาร์ตใหม่ = ฮอตบาร์: แถบเทาเข้มกรอบหิน */
.strip { background:#1d1d1d99; border-block:4px solid #555;
  box-shadow:inset 0 3px 0 #8b8b8b55, inset 0 -3px 0 #0008; padding:16px 0 18px; }

/* 5) หัวข้อ "แฟนอาร์ตยอดนิยม" = ป๊อปอัปความสำเร็จ (Advancement) */
.daily-title { display:inline-block; padding:8px 18px; background:#212121e6; border:3px solid #111;
  box-shadow:inset 0 0 0 3px #555, inset 6px 6px 0 #ffffff12, 4px 4px 0 #0008; }

/* ร้านค้า: การ์ดร้านแบบกล่อง GUI มายคราฟ รูปบน ชื่อ รายละเอียด ปุ่มลิงก์ */
/* ปุ่มบนหน้าร้านค้า: ลงร้านใหม่ + แก้ไขร้านของฉัน วางคู่กัน (มือถือเรียงลงมา) */
.shop-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:8px 10px; margin:0 auto 28px; }
.shop-actions .mc { font-size:1.05rem; padding:10px 20px; }
#shop-edit-btn { background:#d69a1e; box-shadow:inset -3px -4px 0 #8a5f0d, inset 3px 3px 0 #ffd36b; }
.shop-card .shop-edit { margin-top:10px; width:100%; background:#d69a1e; box-shadow:inset -3px -4px 0 #8a5f0d, inset 3px 3px 0 #ffd36b; font-family:"Kanit",system-ui,sans-serif; }
.shops { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:24px; text-align:left; }
.shop-card { display:flex; flex-direction:column; background:#2b2b2bee; border:4px solid #111;
  box-shadow:inset 0 0 0 3px #5a5a5a, inset 6px 6px 0 #ffffff14, 6px 6px 0 #0008; padding:12px; }
.shop-card img { width:100%; aspect-ratio:16/10; object-fit:cover; border:3px solid #111; background:#222; }
.shop-card h2 { margin:12px 0 4px; font:700 1.25rem "Kanit",system-ui,sans-serif; color:#ffd84a; text-shadow:2px 2px 0 #000; }
/* โปรไฟล์ Discord คนโพสร้าน */
.shop-owner { display:flex; align-items:center; gap:6px; margin:0 0 8px; font:400 .9rem "Kanit",system-ui,sans-serif; color:#bbb; min-width:0; }
.shop-owner img { width:24px; height:24px; aspect-ratio:auto; border:2px solid #111; border-radius:50%; flex:none; }
.shop-owner b { color:#fff; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* หมวดหมู่ร้าน: ป้ายบนการ์ด / ปุ่มกรอง / ช่องติ๊กในฟอร์ม */
.shop-tags { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 10px; }
.shop-tags span { padding:2px 8px; background:#3f7a1f; border:2px solid #111; font:500 .8rem "Kanit",system-ui,sans-serif; color:#fff; }
.shop-cats { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; margin:0 0 20px; }
.shop-cats .mc { font-size:.9rem; padding:6px 12px; }
.shop-cats .mc[aria-pressed="true"] { background-color:#3f7a1f; outline:3px solid #ffd84a; }
.sh-cats { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:4px 12px; margin:0; padding:8px 10px; border:3px solid #111; }
.sh-cats legend { padding:0 6px; }
.sh-cats .check { margin:0; }
.sh-cats label:has(input:disabled) { opacity:.5; }
/* ป้าย Partner (ติ๊กฟ้า แอดมินตั้งให้) */
.shop-badges { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 8px; }
.partner { padding:2px 10px; background:#1d9bf0; border:2px solid #0b4f7f; box-shadow:inset -2px -2px 0 #0f6db3, inset 2px 2px 0 #7cc8ff; font:700 .85rem "Kanit",system-ui,sans-serif; color:#fff; text-shadow:1px 1px 0 #0008; }
.verified-badge { padding:2px 10px; background:#3fae3a; border:2px solid #1f5e1c; box-shadow:inset -2px -2px 0 #2a7f26, inset 2px 2px 0 #8fe388; font:700 .85rem "Kanit",system-ui,sans-serif; color:#fff; text-shadow:1px 1px 0 #0008; }
.shop-edit-form { display:grid; gap:8px; margin-top:12px; }
.shop-edit-form .sh-cats { grid-template-columns:repeat(auto-fill, minmax(130px, 1fr)); }
.shop-edit-form .check { display:flex; align-items:center; gap:6px; }
.shop-edit-form .check input { width:auto; margin:0; flex:none; }
.shop-card p { margin:0 0 12px; flex:1; font-family:"Kanit",system-ui,sans-serif; white-space:pre-line; word-break:break-word; color:#e8e8e8; }
.shop-links { display:flex; flex-wrap:wrap; gap:8px; margin-top:auto; }
.shop-card p.clamp { flex:0 0 auto; margin-bottom:4px; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:6; line-clamp:6; overflow:hidden; }
.more-btn { align-self:flex-start; margin:0 0 12px; padding:0; background:none; border:0; color:#ffd84a; font:600 .9rem "Kanit",system-ui,sans-serif; cursor:pointer; text-decoration:underline; }
.more-btn:focus-visible { outline:2px solid #ffd84a; }
/* หลายรูป: ปัด/กดเลื่อนทีละรูป + ป้ายเลขรูป */
.shop-pics-wrap { position:relative; }
.shop-pics { display:flex; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none; cursor:pointer; border:3px solid #111; background:#222; }
.shop-pics::-webkit-scrollbar { display:none; }
.shop-card .shop-pics img { flex:0 0 100%; scroll-snap-align:start; border:0; }
.shop-count { position:absolute; right:8px; bottom:8px; padding:2px 8px; background:#000b; color:#fff; font:700 .85rem "Kanit",system-ui,sans-serif; pointer-events:none; }
.sh-previews { display:flex; flex-wrap:wrap; gap:6px; }
.sh-previews:empty { display:none; }
.sh-previews .ap-preview { width:72px; height:72px; }
/* รูปในฟอร์มลงร้าน: ปุ่ม ✖ มุมขวาบน + ป้าย "ปก" รูปแรก / ปุ่มเพิ่มรูป */
.sh-pics-field { display:grid; gap:6px; font-weight:600; }
.sh-pic { position:relative; margin:0; }
.sh-pic .sh-del { position:absolute; top:-8px; right:-8px; width:26px; height:26px; padding:0; border:2px solid #111; background:#b33a3a; color:#fff;
  font:700 .8rem system-ui, sans-serif; cursor:pointer; box-shadow:inset -2px -2px 0 #7a2020; }
.sh-pic .sh-del:hover { background:#d44; }
.sh-cover { position:absolute; left:3px; bottom:3px; padding:0 6px; background:#ffd84a; color:#111; border:2px solid #111; font:700 .75rem "Kanit",system-ui,sans-serif; }
#sh-add-pic { display:inline-block; justify-self:start; cursor:pointer; font-weight:700; }
#sh-add-pic[hidden] { display:none; }
.sh-mine { display:grid; gap:6px; padding:8px; border:3px solid #111; background:#0001; text-align:left; font-family:"Kanit",system-ui,sans-serif; }
.sh-mine .row { justify-content:space-between; align-items:center; gap:8px; }
.sh-mine .mc { padding:4px 10px; font-size:.9rem; }
.shop-links .mc { flex:1 1 auto; text-align:center; font-family:"Kanit",system-ui,sans-serif; font-size:.95rem; padding:6px 12px; }

/* ร้านผู้สนับสนุนหน้าแรก: การ์ดร้านแบบย่อ (รูป + ชื่อ) ใต้แท่นแฟนอาร์ต */
.sponsors { margin:56px auto 0; max-width:1000px; text-align:center; }
.sponsor-row { display:flex; flex-wrap:wrap; justify-content:center; gap:18px; margin-bottom:20px; }
.shop-card.mini { flex:0 1 220px; min-width:0; padding:8px; text-decoration:none; transition:transform .15s; }
.shop-card.mini:hover { transform:translateY(-4px); }
/* หน้าต่างข้อมูลร้าน (กดการ์ดร้านหน้าแรก) */
.shop-info { width:min(92vw, 560px); }
.shop-info .shop-card { text-align:left; margin-bottom:10px; }
.shop-info .shop-card p { font-weight:400; max-height:40vh; overflow:auto; }
.shop-info .shop-pics img { max-height:none; margin:0; }
.shop-card.mini h2 { margin:8px 0 2px; font-size:1.05rem; text-align:center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media (max-width:600px) { .shop-card.mini { flex-basis:calc(50% - 9px); } }

/* แถบผู้สนับสนุนใต้แฟนอาร์ต: บล็อกทองเตี้ย ๆ โลโก้ในช่องไอเทมวิ่งวน (เอาเมาส์ชี้ = หยุด) */
.sponsors { margin:40px auto 0; max-width:900px; text-align:center; }
.sp-title { display:inline-block; margin:0 0 10px; padding:4px 14px; font-size:1.15rem; color:#ffd84a; text-shadow:2px 2px 0 #6b4a00;
  background:#212121e6; border:3px solid #111; }
.sp-strip { overflow:hidden; padding:8px 0; background:url(textures/gold.svg) 0 0/32px; border:4px solid #111;
  box-shadow:inset -3px -4px 0 #0005, inset 3px 3px 0 #fff6, 5px 5px 0 #0008, 0 0 24px 2px #ffd84a55;
  mask-image:linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.sp-track { display:flex; gap:10px; width:max-content; animation:sp-run 24s linear infinite; }
.sp-strip:hover .sp-track, .sp-track:focus-within { animation-play-state:paused; }
.sp-card { display:flex; align-items:center; gap:8px; padding:5px 12px 5px 5px; background:#2b2b2bee; border:3px solid #111;
  box-shadow:inset -2px -2px 0 #000, inset 2px 2px 0 #555; color:#fff; text-decoration:none; font-family:"Kanit",system-ui,sans-serif; transition:transform .15s; }
.sp-card b { font-weight:600; font-size:.9rem; color:#ffd84a; text-shadow:2px 2px 0 #000; white-space:nowrap; }
.sp-slot { position:relative; flex:none; width:52px; height:52px; background:#8b8b8b; box-shadow:inset 2px 2px 0 #373737, inset -2px -2px 0 #fff; }
.sp-slot img { position:absolute; inset:4px; width:calc(100% - 8px); height:calc(100% - 8px); object-fit:contain; }
a.sp-card:hover { transform:translateY(-2px); box-shadow:inset -2px -2px 0 #000, inset 2px 2px 0 #555, 0 0 12px 3px #ffd84a99; }
@keyframes sp-run { to { transform:translateX(calc(-50% - 5px)); } }
@media (prefers-reduced-motion: reduce) { .sp-track { animation:none; flex-wrap:wrap; width:auto; justify-content:center; } .sp-track [aria-hidden] { display:none; } }
.sp-logo { object-fit:contain !important; background:#ddd !important; }
/* หลังบ้าน: ประวัติ */
#log-filter { flex-wrap:wrap; gap:6px; }
#log-filter .mc { padding:4px 10px; font-size:.9rem; }
#log-filter .mc[aria-pressed="true"] { background-color:#5d9e34; }
.log-list { list-style:none; margin:12px 0; padding:0; display:flex; flex-direction:column; gap:6px; }
.log-item { display:flex; gap:10px; align-items:flex-start; padding:8px 10px; background:#0000002e; border:2px solid #0006; }
.log-icon { flex:none; font-size:1.2rem; }
.log-item div { display:flex; flex-direction:column; min-width:0; }
.log-item b { word-break:break-word; }
.log-item small { opacity:.8; font-weight:400; }
/* จอลาก่อน (ปุ่มออกจากเว็บ): มืดลงแบบโหลดโลกในมายคราฟ */
.bye { position:fixed; inset:0; z-index:9999; display:grid; place-content:center; text-align:center; color:#fff;
  background:#0a0a14 url(textures/dirt.svg) 0 0/64px; background-blend-mode:multiply; animation:bye-in .5s ease-out both; }
.bye h2 { margin:0; font-size:clamp(2rem, 8vw, 4rem); color:#ffd84a; text-shadow:4px 4px 0 #000; animation:bye-pop .6s .2s cubic-bezier(.3,1.6,.5,1) both; }
.bye p { margin:8px 0 0; font:700 1.2rem "Kanit",system-ui,sans-serif; text-shadow:2px 2px 0 #000; animation:bye-in .4s .5s both; }
@keyframes bye-in { from { opacity:0; } }
@keyframes bye-pop { from { transform:scale(.3); opacity:0; } }
@media (prefers-reduced-motion: reduce) { .bye, .bye h2, .bye p { animation:none; } }

/* แบ่งหน้าร้านค้า/โปรเจค: ปุ่มเลขหน้าแบบปุ่มมายคราฟ หน้าปัจจุบันสีทอง + การ์ดเลื่อนเข้ามาทีละใบตอนเปลี่ยนหน้า */
.pager { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:8px; margin:28px 0 0; }
.pager .mc { min-width:46px; padding:8px 12px; font:700 1.05rem "Kanit",system-ui,sans-serif; }
.pager .mc[aria-current] { opacity:1; cursor:default; color:#3a2600; background-color:#f5c22e; box-shadow:inset -3px -4px 0 #9c6b14, inset 3px 3px 0 #fff27a, 0 0 14px #ffd84a88;
  text-shadow:1px 1px 0 #fff6 !important; transform:translateY(-3px); }
#shops, #projects { overflow-x:clip; } /* การ์ดที่กำลังเลื่อนเข้ามาไม่ทำให้หน้าเว็บมีแถบเลื่อนแนวนอน */
.pager .mc:disabled:not([aria-current]) { opacity:.4; }
.pager .gap { font-weight:700; padding:0 2px; }
.shops.page-next > .shop-card:not([hidden]) { animation:page-in-r .5s cubic-bezier(.2,.9,.3,1.15) both; animation-delay:calc(var(--i, 0) * 70ms); }
.shops.page-prev > .shop-card:not([hidden]) { animation:page-in-l .5s cubic-bezier(.2,.9,.3,1.15) both; animation-delay:calc(var(--i, 0) * 70ms); }
@keyframes page-in-r { from { opacity:0; transform:translateX(60px) scale(.94); } }
@keyframes page-in-l { from { opacity:0; transform:translateX(-60px) scale(.94); } }
@media (prefers-reduced-motion: reduce) { .shops.page-next > .shop-card, .shops.page-prev > .shop-card { animation:none; } }
