/* Snake.io — ธีมนีออนกระจกฝ้า */
:root {
  --cyan: #38e1ff;
  --violet: #a855f7;
  --pink: #f472b6;
  --ink: #e8f1ff;
  --muted: #8ea0c8;
  --glass: rgba(10, 16, 36, 0.62);
  --glass-line: rgba(120, 200, 255, 0.22);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #02030a; color: var(--ink);
  font-family: "Noto Sans Thai", "Sarabun", "Leelawadee UI", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none; touch-action: none; user-select: none;
}
[hidden] { display: none !important; }

#game { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
body:not(.playing) #game { cursor: default; }

.panel {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ===== หน้าจอเต็ม (เมนู/ตาย) ===== */
.screen {
  z-index: 5;
  position: fixed; inset: 0; display: grid; place-items: center; padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b));
  background: radial-gradient(ellipse at center, rgba(2, 3, 10, 0.1), rgba(2, 3, 10, 0.65));
  overflow-y: auto; touch-action: pan-y; user-select: text;
}
.menu-panel { width: min(440px, 100%); margin-top: 48px; padding: 28px 26px 22px; text-align: center; animation: rise 0.5s ease-out; }

/* ===== แถบข่าววิ่ง (ประกาศจากเซิร์ฟเวอร์) ===== */
#news {
  position: fixed; z-index: 6; left: 0; right: 0; top: 0; height: calc(36px + var(--safe-t)); padding-top: var(--safe-t);
  display: flex; align-items: center; overflow: hidden;
  background: linear-gradient(90deg, rgba(30, 10, 60, 0.85), rgba(6, 12, 32, 0.8) 30%, rgba(6, 12, 32, 0.8) 70%, rgba(30, 10, 60, 0.85));
  border-bottom: 1px solid rgba(168, 85, 247, 0.4); box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 1px 12px rgba(168, 85, 247, 0.25);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#news::after { /* เส้นแสงวิ่งใต้แถบ */
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, #f472b6, #38e1ff, #fbbf24, transparent); background-size: 200% 100%; animation: name-shine 5s linear infinite;
}
.news-label {
  flex: none; display: flex; align-items: center; gap: 6px; height: 100%; padding: 0 14px 0 12px; z-index: 1;
  font-size: 12px; font-weight: 900; letter-spacing: 0.18em; color: #fff;
  background: linear-gradient(90deg, #db2777, #7c3aed); clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}
.news-label i { width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px #fff; animation: blink 1.2s ease-in-out infinite; }
.news-viewport { flex: 1; min-width: 0; height: 100%; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.news-track { display: flex; width: max-content; height: 100%; animation: news-run var(--dur, 40s) linear infinite; }
#news:hover .news-track, #news:focus-within .news-track { animation-play-state: paused; }
@keyframes news-run { to { transform: translateX(-50%); } }
.news-group { display: flex; align-items: center; height: 100%; }
.news-item { display: inline-flex; align-items: center; gap: 8px; padding: 0 28px 0 4px; white-space: nowrap; font-size: 13.5px; color: var(--ink); text-decoration: none; }
.news-item + .news-item::before { content: '✦'; margin-right: 22px; color: rgba(251, 191, 36, 0.7); text-shadow: 0 0 8px rgba(251, 191, 36, 0.8); }
.news-tag {
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; color: var(--c);
  border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 45%, transparent);
  text-shadow: 0 0 6px color-mix(in srgb, var(--c) 70%, transparent);
}
a.news-item:hover .news-text { color: #fff; text-decoration: underline; text-decoration-color: var(--c); }
.news-go { font-style: normal; font-size: 12px; color: var(--c); }
/* เมนู: ดันเนื้อหาลงใต้แถบข่าว */
body:has(#news:not([hidden])) #menu { padding-top: calc(52px + var(--safe-t)); }
/* ระหว่างเล่น: แถบเล็กกลางจอด้านบน (จอแคบซ่อน ไม่ทับ HUD) */
body.playing #news {
  left: 50%; right: auto; top: calc(10px + var(--safe-t)); width: min(520px, calc(100vw - 620px)); height: 30px; padding-top: 0;
  transform: translateX(-50%); border: 1px solid rgba(168, 85, 247, 0.35); border-radius: 999px; opacity: 0.85;
}
body.playing .news-label { font-size: 10.5px; padding: 0 12px 0 10px; }
body.playing .news-item { font-size: 12.5px; }
body.playing #news::after { display: none; }
@media (max-width: 1139px) { body.playing #news { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .news-track { animation-duration: calc(var(--dur, 40s) * 2); }
  #news::after, .news-label i { animation: none; }
}
/* ===== หอเกียรติยศ (ข้างเมนู · จอแคบอยู่ใต้เมนู) ===== */
#menu { gap: 18px; align-content: start; justify-content: center; }
@media (min-width: 1000px) {
  /* safe: แผงสูงกว่าจอ → เริ่มจากบนแล้วเลื่อนได้ ไม่ล้นหัวจนโลโก้หาย */
  #menu { grid-auto-flow: column; align-content: center; align-content: safe center; align-items: center; gap: 28px; }
  .hall-panel { margin-top: 48px; }
}

.hall-panel {
  position: relative; width: min(400px, 100%); padding: 18px 16px 12px; text-align: left; animation: rise 0.6s ease-out;
  border-color: rgba(251, 191, 36, 0.35);
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(251, 191, 36, 0.16), transparent 60%),
    linear-gradient(180deg, rgba(30, 18, 52, 0.72), rgba(8, 12, 30, 0.72));
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(251, 191, 36, 0.08), 0 0 40px rgba(168, 85, 247, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.hall-panel::before { /* เส้นทองวิ่งรอบขอบบน */
  content: ''; position: absolute; left: 18px; right: 18px; top: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #fbbf24, #fff7cc, #a855f7, transparent); background-size: 200% 100%;
  animation: name-shine 4s linear infinite;
}
.hall-head { text-align: center; margin-bottom: 10px; }
.hall-crown { display: block; font-size: 26px; line-height: 1; filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.8)); animation: logo-float 3s ease-in-out infinite; }
.hall-head h2 {
  margin: 4px 0 0; font-size: 22px; font-weight: 800; letter-spacing: 0.06em;
  background: linear-gradient(110deg, #92400e 0%, #fbbf24 30%, #fffbeb 45%, #fbbf24 60%, #92400e 100%); background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: name-shine 3.5s linear infinite;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.45));
}
.hall-sub { margin: 2px 0 0; font-size: 12px; letter-spacing: 0.2em; color: var(--muted); }
.hall-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hof-row {
  display: grid; grid-template-columns: 30px 84px 1fr auto; align-items: center; gap: 8px;
  padding: 7px 10px 7px 6px; border-radius: 12px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.06);
  animation: rise 0.45s ease-out both;
}
.hof-row:nth-child(2) { animation-delay: .04s; } .hof-row:nth-child(3) { animation-delay: .08s; } .hof-row:nth-child(4) { animation-delay: .12s; }
.hof-row:nth-child(5) { animation-delay: .16s; } .hof-row:nth-child(n+6) { animation-delay: .2s; }
.hof-row.rank-1 { padding-block: 10px; border-color: rgba(251, 191, 36, 0.55); background: linear-gradient(90deg, rgba(251, 191, 36, 0.18), rgba(251, 191, 36, 0.03)); box-shadow: 0 0 18px rgba(251, 191, 36, 0.18); }
.hof-row.rank-2 { border-color: rgba(203, 213, 225, 0.45); background: linear-gradient(90deg, rgba(203, 213, 225, 0.13), rgba(203, 213, 225, 0.02)); }
.hof-row.rank-3 { border-color: rgba(217, 119, 6, 0.45); background: linear-gradient(90deg, rgba(217, 119, 6, 0.14), rgba(217, 119, 6, 0.02)); }
.hof-row.me { outline: 1px dashed rgba(56, 225, 255, 0.6); outline-offset: 1px; }
.hof-rank { text-align: center; font-size: 15px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.hof-row.rank-1 .hof-rank, .hof-row.rank-2 .hof-rank, .hof-row.rank-3 .hof-rank { font-size: 22px; line-height: 1; }
.hof-row.rank-1 .hof-rank { filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.9)); }
.hof-snake { width: 84px; height: 28px; display: block; }
.hof-row.rank-1 .hof-snake { height: 32px; }
.hof-who { min-width: 0; }
.hof-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hof-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 700; color: var(--ink); }
.hof-row.rank-1 .hof-name { font-size: 16px; }
.hof-name[class*="name-fx-"] { font-weight: 800; }
.hof-name.name-fx-flag::before { width: 16px; height: 11px; }
.hof-who small { display: block; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--muted); }
.hof-badge {
  flex: none; padding: 1px 6px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.04em; color: #1c1206;
  background: linear-gradient(110deg, #f59e0b, #fde68a 45%, #c084fc); background-size: 200% 100%; animation: name-shine 3s linear infinite;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.45);
}
.hof-score { font-size: 15px; font-weight: 800; color: #fde68a; font-variant-numeric: tabular-nums; text-shadow: 0 0 10px rgba(251, 191, 36, 0.35); }
.hof-row.rank-1 .hof-score { font-size: 17px; }
.hof-empty { padding: 18px 8px; text-align: center; color: var(--muted); font-size: 13.5px; }
.hall-foot { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 10px 0 0; font-size: 11.5px; color: var(--muted); }
@media (max-width: 420px) {
  .hof-row { grid-template-columns: 26px 64px 1fr auto; gap: 6px; }
  .hof-snake { width: 64px; height: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .hall-panel::before, .hall-crown, .hall-head h2, .hof-badge, .hof-row { animation: none; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.98); } }

/* โลโก้ Snake.io (ภาพเดียวกับใน XgamesHub) ล้นขอบแผงขึ้นไปเล็กน้อยและลอยช้า ๆ */
.logo { margin: -64px -14px 0; line-height: 0; }
.logo img {
  width: 100%; height: auto; max-width: 420px;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 22px rgba(132, 255, 92, 0.28));
  animation: logo-float 4s ease-in-out infinite;
}
@keyframes logo-float { 50% { transform: translateY(-5px) rotate(-0.6deg); } }
.tagline { margin: 8px 0 20px; color: var(--muted); letter-spacing: 0.08em; }

.field { display: block; text-align: left; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px 4px; }
.field input, .field select {
  width: 100%; height: 50px; padding: 0 16px; border-radius: 14px; font: inherit; font-size: 17px; color: var(--ink);
  background: rgba(4, 8, 20, 0.7); border: 1px solid var(--glass-line); outline: none; transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(56, 225, 255, 0.18); }

/* สกินมีหลายสิบตัว: โชว์ราว 3 แถวแล้วเลื่อนดู ปุ่มเริ่มเล่นจะได้ไม่ถูกดันตกจอ */
.skins {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
  max-height: 196px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 4px 4px 4px 0;
  scrollbar-gutter: stable;
  scrollbar-width: thin; scrollbar-color: rgba(56, 225, 255, 0.35) transparent;
}
.skin {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 6px; min-width: 0; overflow: hidden;
  border-radius: 12px; border: 1px solid transparent; background: rgba(255, 255, 255, 0.04); color: var(--muted);
  cursor: pointer; font: inherit; transition: transform .15s, border-color .15s, background .15s;
}
.skin:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.08); }
.skin.selected { border-color: var(--cyan); background: rgba(56, 225, 255, 0.12); color: var(--ink); box-shadow: 0 0 18px rgba(56, 225, 255, 0.25); }
.skin-preview { display: flex; align-items: center; height: 18px; }
.skin-preview i { width: 11px; height: 11px; border-radius: 50%; margin-left: -3px; box-shadow: 0 0 6px currentColor, inset -2px -2px 3px rgba(0,0,0,.35); }
.skin-preview i:last-child { width: 14px; height: 14px; }
.skin-name { font-size: 10.5px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.btn {
  height: 54px; padding: 0 26px; border-radius: 16px; border: 0; font: inherit; font-size: 19px; font-weight: 700; cursor: pointer;
  color: #04121f; transition: transform .12s, filter .2s, box-shadow .2s;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  width: 100%; margin-top: 6px;
  background: linear-gradient(90deg, var(--cyan), #7c9bff 55%, var(--violet));
  box-shadow: 0 8px 30px rgba(88, 140, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 10px 36px rgba(88, 140, 255, 0.6); }
.btn.ghost { background: rgba(255, 255, 255, 0.08); color: var(--ink); border: 1px solid var(--glass-line); }
.btn:focus-visible, .skin:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.status { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 13.5px; color: var(--muted); }
.status i { width: 9px; height: 9px; border-radius: 50%; background: #fbbf24; box-shadow: 0 0 10px #fbbf24; }
.status[data-kind="online"] i { background: #4ade80; box-shadow: 0 0 10px #4ade80; }
.status[data-kind="offline"] i { background: #a78bfa; box-shadow: 0 0 10px #a78bfa; }
.status[data-kind="connecting"] i { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.best { margin: 8px 0 0; color: #fde68a; font-size: 14px; min-height: 1em; }
.help { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 16px; font-size: 12.5px; color: var(--muted); }
kbd { display: inline-block; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--glass-line); background: rgba(255,255,255,.06); font: inherit; color: var(--ink); }
.touch-only { display: none; }
@media (pointer: coarse) { .touch-only { display: block; } .help > div:not(.touch-only) { display: none; } }

/* ===== HUD ===== */
#hud { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.hud-stats {
  position: absolute; top: calc(12px + var(--safe-t)); left: calc(12px + var(--safe-l));
  display: flex; gap: 18px; padding: 10px 18px; border-radius: 14px;
}
.hud-stats div { display: flex; flex-direction: column; }
.hud-stats small, .death-grid small { font-size: 11px; color: var(--muted); }
.hud-stats b { font-size: 22px; font-variant-numeric: tabular-nums; text-shadow: 0 0 12px rgba(56, 225, 255, 0.45); }

.hud-board { position: absolute; top: calc(12px + var(--safe-t)); right: calc(12px + var(--safe-r)); width: 220px; padding: 10px 12px; border-radius: 14px; }
.hud-board h2 { margin: 0 0 6px; font-size: 12px; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
#leaderboard { margin: 0; padding: 0; list-style: none; counter-reset: r; }
#leaderboard li { display: flex; align-items: center; gap: 7px; font-size: 13px; line-height: 1.75; counter-increment: r; }
#leaderboard li::before { content: counter(r); width: 16px; color: var(--muted); font-size: 11px; text-align: right; }
#leaderboard li i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
#leaderboard li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#leaderboard li b { font-variant-numeric: tabular-nums; font-weight: 600; }
#leaderboard li.me { color: #fde68a; }
/* แถวของเราเมื่อไม่ติดอันดับ: เส้นคั่น + เลขอันดับจริงแทนเลขลำดับ */
#leaderboard li.self-row { margin-top: 3px; padding-top: 3px; border-top: 1px dashed rgba(255, 255, 255, .15); }
#leaderboard li.self-row::before { content: attr(data-rank); }
.hud-board h2 button { all: unset; display: flex; width: 100%; justify-content: space-between; align-items: center; cursor: pointer; pointer-events: auto; }
.hud-board h2 button span { display: none; transition: transform .2s; }
.hud-board.open h2 button span { transform: rotate(180deg); }
.hud-board h2 button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

#minimap { position: absolute; right: calc(12px + var(--safe-r)); bottom: calc(12px + var(--safe-b)); width: 160px; height: 160px; border-radius: 50%; padding: 0; }
#killfeed { position: absolute; left: calc(12px + var(--safe-l)); bottom: calc(64px + var(--safe-b)); display: flex; flex-direction: column-reverse; gap: 6px; }
.kill { padding: 5px 12px; border-radius: 10px; background: var(--glass); border: 1px solid var(--glass-line); font-size: 13px; transition: opacity .6s, transform .6s; }
.kill.mine { border-color: rgba(74, 222, 128, 0.6); }
.kill.me { border-color: rgba(248, 113, 113, 0.7); }
.kill.fade { opacity: 0; transform: translateX(-10px); }

/* ===== ชิปผลไอเทมของเรา ===== */
.fx-chips {
  position: absolute; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; pointer-events: none;
}
.fx-chip {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 6px; padding: 6px 12px 8px; border-radius: 12px;
  background: var(--glass); border: 1px solid var(--c); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 45%, transparent);
  font-size: 13px; animation: fx-in .25s ease-out;
}
.fx-chip[hidden] { display: none; }
.fx-chip i { font-style: normal; font-weight: 900; color: var(--c); }
.fx-chip b { font-variant-numeric: tabular-nums; min-width: 2.2em; text-align: right; color: #fff; }
.fx-chip u { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c); transform-origin: left; text-decoration: none; }
.fx-chip.ending { animation: fx-blink .5s ease-in-out infinite alternate; }
@keyframes fx-in { from { opacity: 0; transform: translateY(-6px) scale(.9); } }
@keyframes fx-blink { to { opacity: .45; } }
@media (max-width: 640px) {
  .fx-chips { top: calc(64px + var(--safe-t)); }
  .fx-chip span { display: none; }
}
#netInfo { position: absolute; left: calc(12px + var(--safe-l)); bottom: calc(12px + var(--safe-b)); font-size: 12.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; padding: 3px 9px; border-radius: 999px; background: rgba(2, 6, 18, .55); border: 1px solid rgba(255, 255, 255, .08); }
#netInfo:empty { display: none; }
/* เลขรุ่นเกม/เซิร์ฟเวอร์: เล็ก จาง เหนือป้ายปิง เห็นทั้งในเมนูและตอนเล่น */
#verInfo { position: fixed; z-index: 5; left: calc(14px + var(--safe-l)); bottom: calc(44px + var(--safe-b)); font-size: 10.5px; color: var(--muted); opacity: .7; pointer-events: none; font-variant-numeric: tabular-nums; }
#verInfo:empty { display: none; }
#netInfo[data-q="ok"] { color: #4ade80; }
#netInfo[data-q="warn"] { color: #facc15; }
#netInfo[data-q="bad"] { color: #f87171; }
.icon-btn {
  position: absolute; pointer-events: auto; top: calc(80px + var(--safe-t)); left: calc(12px + var(--safe-l));
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--glass-line); background: var(--glass); color: var(--ink); font-size: 18px; cursor: pointer;
}

#boostBtn {
  display: none; position: absolute; pointer-events: auto; right: calc(26px + var(--safe-r)); bottom: calc(190px + var(--safe-b));
  width: 84px; height: 84px; border-radius: 50%; border: 2px solid rgba(56, 225, 255, 0.6); font-size: 34px; color: #fff;
  background: radial-gradient(circle at 35% 30%, rgba(124, 155, 255, 0.55), rgba(10, 16, 36, 0.7)); box-shadow: 0 0 24px rgba(56, 225, 255, 0.35);
  touch-action: none;
}
#boostBtn.on { transform: scale(0.94); box-shadow: 0 0 40px rgba(56, 225, 255, 0.8); }
/* ปุ่มสกิลสายฟ้า: วงมืดกวาดตามเวลาชาร์จที่เหลือ (--cd 1→0) · พร้อม = เรืองแสงเต้น */
#skillBtn {
  position: absolute; pointer-events: auto; right: calc(186px + var(--safe-r)); bottom: calc(22px + var(--safe-b));
  width: 66px; height: 66px; border-radius: 50%; border: 2px solid rgba(147, 197, 253, 0.55); color: #fff; cursor: pointer; touch-action: none;
  background: radial-gradient(circle at 35% 30%, rgba(96, 165, 250, 0.65), rgba(10, 16, 36, 0.85)); box-shadow: 0 0 16px rgba(96, 165, 250, 0.3);
  display: grid; place-items: center; padding: 0; overflow: hidden; transition: transform .12s, box-shadow .2s, border-color .2s;
}
#skillBtn[hidden] { display: none; }
#skillBtn span { font-size: 30px; line-height: 1; position: relative; z-index: 1; filter: drop-shadow(0 0 6px rgba(147, 197, 253, 0.9)); }
#skillBtn small { position: absolute; z-index: 1; right: 9px; bottom: 6px; font-size: 11px; font-weight: 800; color: #bfdbfe; }
#skillBtn::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(rgba(2, 6, 18, 0.78) calc(var(--cd, 0) * 360deg), transparent 0); }
#skillBtn.ready { border-color: #bfdbfe; animation: skill-ready 1.1s ease-in-out infinite alternate; }
#skillBtn.poor span { filter: grayscale(.8) opacity(.6); }
#skillBtn:active { transform: scale(0.93); }
@keyframes skill-ready { from { box-shadow: 0 0 14px rgba(147, 197, 253, 0.45); } to { box-shadow: 0 0 34px rgba(191, 219, 254, 0.95), inset 0 0 12px rgba(191, 219, 254, 0.5); } }
@media (pointer: coarse) {
  #skillBtn { right: calc(34px + var(--safe-r)); bottom: calc(290px + var(--safe-b)); width: 70px; height: 70px; }
  #skillBtn small { display: none; }
}
@media (pointer: coarse) {
  #boostBtn { display: block; }
  .icon-btn { display: none; }
  #minimap { width: 118px; height: 118px; }
}
/* จอเล็ก (มือถือ แท็บเล็ตแนวตั้ง หน้าต่างแคบ จอเตี้ย): ตารางอันดับย่อเป็น 3 อันดับแรก + แถวของเรา
   โปร่งขึ้น ไม่บังทางเลื้อย · แตะหัวตารางเพื่อดูครบ 10 */
@media (pointer: coarse), (max-width: 760px), (max-height: 560px) {
  .hud-board { width: 158px; padding: 7px 10px; opacity: .82; }
  .hud-board h2 { margin-bottom: 3px; font-size: 11px; }
  .hud-board h2 button span { display: inline; }
  #leaderboard li { font-size: 12px; line-height: 1.6; gap: 6px; }
  .hud-board:not(.open) #leaderboard li:nth-child(n+4):not(.me) { display: none; }
  .hud-board.open { opacity: .95; }
  #killfeed .kill { font-size: 12px; padding: 4px 10px; }
  #killfeed .kill:nth-child(n+4) { display: none; }
}
@media (max-width: 560px) {
  .hud-stats { gap: 12px; padding: 8px 12px; }
  .hud-stats b { font-size: 17px; }
  .hud-board { top: calc(70px + var(--safe-t)); }
  .skins { grid-template-columns: repeat(4, 1fr); }
}

#joy { position: fixed; left: 0; top: 0; width: 0; height: 0; pointer-events: none; opacity: 0; transition: opacity .15s; }
#joy.on { opacity: 1; }
#joy::before { content: ""; position: absolute; left: -60px; top: -60px; width: 120px; height: 120px; border-radius: 50%; border: 2px solid rgba(56, 225, 255, 0.35); background: rgba(10, 16, 36, 0.25); }
#joy span { position: absolute; left: -24px; top: -24px; width: 48px; height: 48px; border-radius: 50%; background: rgba(56, 225, 255, 0.45); box-shadow: 0 0 20px rgba(56, 225, 255, 0.6); }

/* ป้ายชื่อเหนือหัวงู */
#labels { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.snake-label {
  position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 12.5px; font-weight: 600; color: rgba(232, 241, 255, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9); will-change: transform;
}
.snake-label.me { color: #fde68a; }

/* เอฟเฟกต์ชื่อตามสกิน (snakes.js ใส่คลาส name-fx-* และสี --n1..--n4) */
.snake-label[class*="name-fx-"] { font-weight: 800; letter-spacing: 0.2px; }
.snake-label.me[class*="name-fx-"] { font-size: 14px; }
/* ตัวอักษรไล่สี: เส้นขอบใช้ drop-shadow เพราะ text-shadow จะทะลุตัวอักษรใส */
:is(.snake-label, .hof-name).name-fx-fire, :is(.snake-label, .hof-name).name-fx-gold, :is(.snake-label, .hof-name).name-fx-ice, :is(.snake-label, .hof-name).name-fx-rainbow,
:is(.snake-label, .hof-name).name-fx-stripe {
  color: transparent; -webkit-background-clip: text; background-clip: text; text-shadow: none;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.95)) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8));
}
:is(.snake-label, .hof-name).name-fx-tint { color: var(--n1); text-shadow: 0 0 6px var(--n1), 0 1px 3px rgba(0, 0, 0, 0.95); }
:is(.snake-label, .hof-name).name-fx-neon {
  color: #fff; text-shadow: 0 0 3px #fff, 0 0 8px var(--n1), 0 0 16px var(--n2), 0 1px 2px rgba(0, 0, 0, 0.9);
  animation: name-flicker 3.2s infinite steps(1);
}
:is(.snake-label, .hof-name).name-fx-fire {
  background-image: linear-gradient(0deg, #dc2626, #f97316 35%, #fde047 65%, #fff7cc 90%, #f97316);
  background-size: 100% 220%; animation: name-rise 1.1s linear infinite;
  filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 6px rgba(249, 115, 22, 0.85));
}
:is(.snake-label, .hof-name).name-fx-gold {
  background-image: linear-gradient(110deg, #92400e 0%, #fbbf24 30%, #fffbeb 45%, #fbbf24 60%, #92400e 100%);
  background-size: 250% 100%; animation: name-shine 2.4s linear infinite;
  filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 5px rgba(251, 191, 36, 0.7));
}
:is(.snake-label, .hof-name).name-fx-ice {
  background-image: linear-gradient(180deg, #ffffff 20%, var(--n2) 55%, #e0f2fe 80%);
  filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 6px rgba(125, 211, 252, 0.9));
}
:is(.snake-label, .hof-name).name-fx-rainbow {
  background-image: linear-gradient(90deg, #f43f5e, #f59e0b, #facc15, #4ade80, #22d3ee, #6366f1, #d946ef, #f43f5e);
  background-size: 200% 100%; animation: name-shine 2s linear infinite;
}
/* ธง: ชื่อขาวเรืองแสงสีธง + ธงจิ๋วพลิ้วอยู่หน้าชื่อ (สี --nflag มาจาก skins.js) */
:is(.snake-label, .hof-name).name-fx-flag { color: #fff; text-shadow: 0 0 6px var(--n1), 0 0 2px var(--n3), 0 1px 3px rgba(0, 0, 0, 0.95); }
:is(.snake-label, .hof-name).name-fx-flag::before {
  content: ''; display: inline-block; width: 18px; height: 12px; margin-right: 5px; vertical-align: -1px;
  border-radius: 1.5px; background: var(--nflag); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 8px var(--n1);
  transform-origin: left center; animation: name-flag 1.4s ease-in-out infinite alternate;
}
@keyframes name-flag { from { transform: perspective(40px) rotateY(-14deg) skewY(-4deg); } to { transform: perspective(40px) rotateY(10deg) skewY(4deg); } }
:is(.snake-label, .hof-name).name-fx-stripe {
  background-image: repeating-linear-gradient(-45deg, var(--n1) 0 4px, var(--n2) 4px 8px);
  background-size: 200% 100%; animation: name-shine 3s linear infinite;
}
:is(.snake-label, .hof-name).name-fx-glitch {
  color: #f8fafc; text-shadow: 1.5px 0 #ff00ff, -1.5px 0 #00e5ff, 0 1px 3px rgba(0, 0, 0, 0.9);
  animation: name-glitch 1.8s infinite steps(1);
}
@keyframes name-flicker { 0%, 100% { opacity: 1; } 47% { opacity: 0.55; } 49% { opacity: 1; } 51% { opacity: 0.7; } 53% { opacity: 1; } }
@keyframes name-rise { from { background-position: 0 0; } to { background-position: 0 -220%; } }
@keyframes name-shine { from { background-position: 0% 0; } to { background-position: -200% 0; } }
@keyframes name-glitch {
  0%, 100% { text-shadow: 1.5px 0 #ff00ff, -1.5px 0 #00e5ff, 0 1px 3px rgba(0, 0, 0, 0.9); }
  20% { text-shadow: -2.5px 1px #ff00ff, 2.5px -1px #00e5ff, 0 1px 3px rgba(0, 0, 0, 0.9); }
  22% { text-shadow: 1.5px 0 #ff00ff, -1.5px 0 #00e5ff, 0 1px 3px rgba(0, 0, 0, 0.9); }
  70% { text-shadow: 3px 0 #ff00ff, -3px 0 #00e5ff, 0 1px 3px rgba(0, 0, 0, 0.9); opacity: 0.8; }
  72% { opacity: 1; }
}
/* กันแลค: ป้ายชื่อเลื่อนด้วย transform บนเลเยอร์ของตัวเอง ถ้าเอฟเฟกต์ขยับ เบราว์เซอร์ต้องวาดป้ายใหม่ทุกเฟรม
   จึงให้ขยับเฉพาะชื่อเรา (.me) — ป้ายงูตัวอื่น (สูงสุด 40 ป้าย) ได้สี/เรืองแสงเหมือนกันแต่นิ่ง วาดครั้งเดียว */
.snake-label:not(.me)[class*="name-fx-"], .snake-label:not(.me).name-fx-flag::before { animation: none; }
.snake-label.me.name-fx-flag::before { will-change: transform; }
@media (prefers-reduced-motion: reduce) {
  .snake-label[class*="name-fx-"], :is(.snake-label, .hof-name).name-fx-flag::before { animation: none; }
}

/* ===== หน้าตาย ===== */
.death-panel { width: min(400px, 100%); padding: 26px; text-align: center; animation: rise .4s ease-out; }
.death-panel h2 { margin: 0; font-size: 28px; background: linear-gradient(90deg, #fca5a5, var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.death-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.death-grid div { padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); display: flex; flex-direction: column; gap: 2px; }
.death-grid b { font-size: 24px; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; margin: 0; }

#banner {
  position: fixed; top: calc(14px + var(--safe-t)); left: 50%; transform: translateX(-50%); padding: 8px 18px; border-radius: 999px;
  background: rgba(120, 53, 15, 0.85); border: 1px solid rgba(251, 191, 36, 0.6); font-size: 14px; z-index: 10;
}
#toast {
  position: fixed; left: 50%; top: 30%; transform: translate(-50%, 10px); padding: 10px 20px; border-radius: 14px; background: var(--glass);
  border: 1px solid var(--glass-line); font-size: 17px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; z-index: 10;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===== เสียงและเพลง ===== */
.sound-box { margin: 14px 0 0; text-align: left; border-radius: 14px; background: rgba(4, 8, 20, 0.55); border: 1px solid var(--glass-line); }
.sound-box summary { padding: 10px 14px; cursor: pointer; font-size: 14px; color: var(--ink); list-style: none; }
.sound-box summary::-webkit-details-marker { display: none; }
.sound-box summary::after { content: '▾'; float: right; color: var(--muted); transition: transform .2s; }
.sound-box[open] summary::after { transform: rotate(180deg); }
.sound-box summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 14px; }
.sound-row { display: flex; align-items: center; gap: 10px; padding: 4px 14px; }
.sound-row label { flex: 0 0 132px; display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.sound-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--cyan); }
.sound-row input[type=range] { flex: 1; min-width: 0; accent-color: var(--violet); }
.sound-row input:disabled { opacity: 0.4; }
.sound-track { display: flex; gap: 8px; padding: 8px 14px 0; }
.sound-track select {
  flex: 1; min-width: 0; height: 42px; padding: 0 12px; border-radius: 12px; font: inherit; font-size: 14px; color: var(--ink);
  background: rgba(4, 8, 20, 0.7); border: 1px solid var(--glass-line); outline: none;
}
.sound-track select:focus { border-color: var(--cyan); }
.sound-track select:disabled { opacity: 0.45; }
.sound-track button { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--glass-line); background: rgba(255, 255, 255, 0.06); color: var(--ink); font-size: 16px; cursor: pointer; }
.sound-track button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.now-playing { margin: 6px 14px 10px; min-height: 1em; font-size: 12.5px; color: var(--muted); }
#muteBtn { left: calc(58px + var(--safe-l)); }
#muteBtn.off { color: #fca5a5; border-color: rgba(248, 113, 113, 0.5); }
@media (pointer: coarse) { #muteBtn { display: block; left: calc(12px + var(--safe-l)); } }
/* ปุ่มซ่อนคะแนน/อันดับ (มือถือ แท็บเล็ต): ย่อแล้วเหลือแค่ตัวเลขคะแนนเล็ก ๆ */
#hudToggleBtn { display: none; left: calc(104px + var(--safe-l)); }
@media (max-width: 760px), (max-height: 560px) { #hudToggleBtn { display: block; } }
@media (pointer: coarse) { #hudToggleBtn { display: block; left: calc(58px + var(--safe-l)); } }
/* ชวนเพื่อน: ปุ่มในเกม + ป้ายช่อง/ห้องที่กำลังเล่น */
#hudInviteBtn { left: calc(150px + var(--safe-l)); }
@media (pointer: coarse) { #hudInviteBtn { display: block; left: calc(104px + var(--safe-l)); } }
#roomInfo { position: absolute; top: calc(124px + var(--safe-t)); left: calc(14px + var(--safe-l)); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
#roomInfo:empty, #hud.hud-min #roomInfo { display: none; }
.play-row { display: flex; gap: 8px; align-items: stretch; }
.play-row .btn.primary { flex: 1; width: auto; }
.btn.invite-btn { flex: none; height: auto; margin-top: 6px; padding: 0 14px; font-size: 15px; white-space: nowrap; }
.invite-note { margin: 0 0 8px; padding: 8px 12px; border-radius: 12px; font-size: 13.5px; color: #bbf7d0; background: rgba(74, 222, 128, .1); border: 1px solid rgba(74, 222, 128, .35); }
.copyright { margin: 14px 0 0; font-size: 11.5px; letter-spacing: .04em; color: var(--muted); opacity: .8; }
#hud.hud-min #hudToggleBtn { opacity: .55; }
#hud.hud-min .hud-board { display: none; }
#hud.hud-min .hud-stats { gap: 0; padding: 4px 10px; opacity: .75; }
#hud.hud-min .hud-stats div:not(:first-child), #hud.hud-min .hud-stats small { display: none; }
#hud.hud-min .hud-stats b { font-size: 15px; }

/* ===== ร้านสกิน TPIX ===== */
.skin.premium { position: relative; background: linear-gradient(160deg, rgba(251, 191, 36, 0.10), rgba(168, 85, 247, 0.10)); }
.skin.premium::after { content: '✦'; position: absolute; top: 3px; right: 5px; font-size: 9px; color: #fbbf24; }
.skin.locked { color: #fcd34d; }
.skin.locked .skin-preview { filter: saturate(0.75) brightness(0.8); }
.shop-link {
  display: block; width: 100%; margin: 8px 0 0; padding: 10px 14px; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 14px; color: #fde68a; text-align: center;
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.14), rgba(168, 85, 247, 0.18));
  border: 1px solid rgba(251, 191, 36, 0.35); transition: filter .2s, transform .15s;
}
.shop-link:hover { filter: brightness(1.15); }
.shop-link:active { transform: scale(0.98); }
.shop-link:focus-visible { outline: 2px solid #fbbf24; outline-offset: 2px; }

.shop-screen { z-index: 40; background: rgba(2, 3, 10, 0.55); backdrop-filter: blur(4px); }

/* ===== แผงชวนเพื่อน (แชร์ไปโซเชียล) ===== */
.share-screen { z-index: 40; background: rgba(2, 3, 10, 0.55); }
.share-screen[hidden] { display: none; }
.share-panel { width: min(420px, 100%); padding: 18px 18px 16px; text-align: left; animation: rise .25s ease-out; }
.share-where { margin: 0 0 12px; font-size: 13.5px; color: var(--muted); }
.share-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.share-app { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 14px; text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 600; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-line); transition: transform .15s, background .2s; }
.share-app:hover { background: rgba(255, 255, 255, 0.1); }
.share-app:active { transform: scale(0.95); }
.share-app:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.share-app i { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-style: normal; font-size: 20px; font-weight: 900; color: #fff; }
.share-line i { background: #06c755; }
.share-messenger i { background: linear-gradient(135deg, #0a7cff, #a033ff 60%, #ff5280); }
.share-facebook i { background: #1877f2; }
.share-whatsapp i { background: #25d366; }
.share-telegram i { background: #229ed9; }
.share-x i { background: #000; border: 1px solid rgba(255, 255, 255, .25); }
.share-link { display: flex; gap: 8px; margin-top: 14px; }
.share-url { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--glass-line); background: rgba(4, 8, 20, 0.6); color: var(--ink); font-size: 13px; }
.share-link .btn { width: auto; flex: none; height: 44px; padding: 0 18px; font-size: 15px; }
.share-more { width: 100%; height: 42px; margin-top: 10px; font-size: 14.5px; }
.share-more[hidden] { display: none; }
.shop-panel { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 18px 18px 14px; text-align: left; }
.shop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.shop-head h2 { margin: 0; font-size: 20px; }
.shop-head .tpix { background: linear-gradient(90deg, #fde68a, #a855f7); -webkit-background-clip: text; background-clip: text; color: transparent; }
.shop-close { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--glass-line); background: rgba(255, 255, 255, 0.06); color: var(--ink); font-size: 16px; cursor: pointer; }
.shop-close:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.shop-wallet { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(4, 8, 20, 0.6); border: 1px solid var(--glass-line); }
.shop-wallet .shop-addr { flex: 1; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.shop-wallet .btn { width: auto; height: 40px; padding: 0 16px; font-size: 14px; }
.shop-open-wallet { display: inline-block; margin: 8px 2px 0; font-size: 13px; color: var(--cyan); }
.shop-get { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0; padding: 8px 12px; border-radius: 14px; background: linear-gradient(90deg, rgba(251, 191, 36, 0.08), rgba(168, 85, 247, 0.1)); border: 1px solid rgba(251, 191, 36, 0.25); }
.shop-get[hidden], .shop-get a[hidden] { display: none; }
.shop-get-label { flex: 1 1 auto; font-size: 13.5px; color: var(--muted); }
.shop-get a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13.5px; color: #fde68a; text-decoration: none; background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.35); transition: filter .2s; }
.shop-get a:hover { filter: brightness(1.2); }
.shop-get a:focus-visible { outline: 2px solid #fbbf24; outline-offset: 2px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 12px 0 8px; }
.shop-card {
  display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08);
}
.shop-card.r-rare { border-color: rgba(56, 225, 255, 0.35); }
.shop-card.r-epic { border-color: rgba(168, 85, 247, 0.5); box-shadow: inset 0 0 22px rgba(168, 85, 247, 0.12); }
.shop-card.r-legendary { border-color: rgba(251, 191, 36, 0.6); box-shadow: inset 0 0 26px rgba(251, 191, 36, 0.14); }
.shop-card.focus { outline: 2px solid #fbbf24; outline-offset: 2px; }
.shop-card.owned { opacity: 0.92; }
.shop-card b { font-size: 15px; }
.shop-card small { font-size: 12px; line-height: 1.4; color: var(--muted); min-height: 34px; }
.shop-card .btn { width: 100%; height: 40px; font-size: 14px; margin-top: auto; }
.shop-card .btn:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(0.4); }
/* สกินแจกฟรี (ราคา 0) — ปุ่มเขียวทอง + ป้ายมุม FREE */
.shop-card.free { position: relative; }
.shop-card.free::after {
  content: 'FREE'; position: absolute; top: 8px; right: 8px; padding: 1px 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; color: #052e16; background: linear-gradient(90deg, #4ade80, #fde68a);
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.55);
}
.shop-card .btn.free { background: linear-gradient(90deg, #22c55e, #84cc16 55%, #facc15); color: #052e16; font-weight: 800; }
.skin-preview.big { height: 26px; }
.skin-preview.big i { width: 15px; height: 15px; margin-left: -4px; }
.skin-preview.big i:last-child { width: 19px; height: 19px; }
.shop-status { min-height: 20px; margin: 6px 2px; font-size: 13.5px; color: var(--ink); }
.shop-status[data-kind="ok"] { color: #86efac; }
.shop-status[data-kind="warn"] { color: #fcd34d; }
.shop-status[data-kind="err"] { color: #fca5a5; }
.shop-note { margin: 4px 2px 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
@media (max-width: 520px) {
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
  .shop-card { padding: 10px; }
}

/* จอเตี้ย (โน้ตบุ๊ก, แท็บเล็ตแนวนอน): ย่อโลโก้/ระยะ/กล่องสกิน ให้ทั้งเมนูพอดีจอ */
@media (max-height: 860px) {
  .menu-panel { margin-top: 34px; padding: 18px 22px 14px; }
  .logo { margin-top: -50px; }
  .logo img { max-width: 290px; }
  .tagline { margin: 2px 0 10px; font-size: 14px; }
  .field { margin-bottom: 10px; }
  .field input, .field select { height: 44px; font-size: 16px; }
  .skins { max-height: 132px; }
  .btn { height: 48px; font-size: 18px; }
  .btn.invite-btn { font-size: 14px; padding: 0 12px; }
  .copyright { margin-top: 6px; }
  .status { margin-top: 10px; }
  .best { margin-top: 4px; }
  .help { margin-top: 8px; }
  .hall-panel { margin-top: 34px; }
}
@media (max-height: 650px) {
  .help { display: none; }
  .menu-panel { padding-bottom: 10px; }
  .tagline { margin-bottom: 6px; }
  .skins { max-height: 124px; }
}
