/* หน้า Stage — ลงด่านจนได้ของ (โทนเดียวกับ Summon / Stat Check) */
.sg-page { font-family: var(--gs-font, "Fredoka", "Noto Sans Thai", system-ui, sans-serif); display: grid; gap: 14px; }
.sg-h1 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: clamp(28px, 4vw, 40px); color: #fff; -webkit-text-stroke: 7px #16121f; paint-order: stroke fill; }
.sg-h1 .ic { width: .9em; height: .9em; color: #ffd84d; }
.sg-sub { margin: 4px 0 0; color: #a8a3b8; font-size: 14px; }
.sg-hint { margin: 0; padding: 14px; color: #8b8796; font-size: 13px; }
/* หมวด */
.sg-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.sg-cats button { padding: 9px 16px; border-radius: 12px; font: 700 16px var(--gs-font, inherit); color: #fff; cursor: pointer; border: 3px solid #ffffff22;
  background: linear-gradient(180deg, #4a4e57, #33363d); box-shadow: 0 4px 0 #0008, 0 0 0 2px #0c0d0f; -webkit-text-stroke: 4px #16121f; paint-order: stroke fill; transition: transform .1s; }
.sg-cats button b { font-size: 12px; padding: 0 6px; border-radius: 8px; background: #16121f; -webkit-text-stroke: 0; color: #d7d2e2; }
.sg-cats button.on { background: linear-gradient(180deg, #74f06c, #34c23e); border-color: #a8ffa0; }
.sg-cats button:active { transform: translateY(3px); }
/* คำเตือน */
.sg-notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 14px; background: #2a210c; border: 2px solid #e0b44a66; color: #f3dc9b; font: 600 13.5px/1.5 "Noto Sans Thai", system-ui, sans-serif; }
.sg-notice[hidden] { display: none; }
.sg-notice .ic { width: 20px; height: 20px; flex: none; margin-top: 1px; color: #ffc93c; }
.sg-notice p { margin: 0; }
/* ซ้าย = รายชื่อด่าน · ขวา = ด่านที่เลือก */
.sg-main { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: clamp(12px, 2vw, 22px); align-items: start; }
.sg-list, .sg-stage { background: #151619; border: 4px solid #0c0d0f; border-radius: 20px; box-shadow: 0 16px 36px #000a, inset 0 0 0 2px #2a2c31; }
.sg-list { display: grid; gap: 6px; padding: 10px; position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow-y: auto; }
.sg-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px; border-radius: 14px; border: 2px solid transparent; background: #0f1012; color: #fff; text-align: left; cursor: pointer; transition: transform .15s, border-color .15s; }
.sg-item:hover { transform: translateX(3px); border-color: #ffffff22; }
.sg-item.on { border-color: #74f06c; background: linear-gradient(90deg, #1d2e1f, #0f1012); }
.sg-item-img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: #24262c; display: grid; place-items: center; color: #8b8796; }
.sg-item-img .ic { width: 22px; height: 22px; }
.sg-item-t { min-width: 0; } .sg-item-t b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sg-item-t small { color: #8b8796; font-size: 12px; }
.sg-item-u { display: flex; }
.sg-mini { width: 26px; height: 26px; border-radius: 7px; object-fit: cover; background: #24262c; display: inline-grid; place-items: center; font-size: 12px; color: #8b8796; }
.sg-item-u .sg-mini { margin-left: -6px; border: 2px solid #0f1012; }
.sg-mini.ico .ic { width: 15px; height: 15px; }
.sg-stage { padding: 16px; display: grid; gap: 14px; color: #d7d2e2; min-width: 0; }
.sg-skel { height: 300px; border-radius: 14px; background: linear-gradient(90deg, #151619 0%, #1e2026 50%, #151619 100%); background-size: 200% 100%; animation: sk-shimmer 1.3s linear infinite; }
.sg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.sg-head-img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; }
.sg-head-t { flex: 1 1 200px; min-width: 0; }
.sg-head-t h2 { margin: 4px 0 0; font-size: clamp(22px, 2.6vw, 30px); color: #fff; -webkit-text-stroke: 6px #16121f; paint-order: stroke fill; }
.sg-head-t small { color: #a8a3b8; font-size: 13px; }
.sg-tag { display: inline-block; padding: 1px 9px; border-radius: 8px; background: #6c7bff; color: #fff; font-size: 12px; font-weight: 700; }
.sg-acts { display: flex; gap: 8px; }
.sg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 12px; font: 700 14px var(--gs-font, inherit); color: #fff; cursor: pointer; border: 3px solid #ffffff22;
  background: linear-gradient(180deg, #4a4e57, #33363d); box-shadow: 0 4px 0 #0008, 0 0 0 2px #0c0d0f; -webkit-text-stroke: 4px #16121f; paint-order: stroke fill; transition: transform .1s, filter .15s; }
.sg-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #0008, 0 0 0 2px #0c0d0f; }
.sg-btn:disabled { opacity: .5; cursor: not-allowed; }
.sg-btn.big { padding: 12px 18px; font-size: 18px; }
.sg-btn.red { background: linear-gradient(180deg, #ff6b6b, #d63a3a); } .sg-btn.blue { background: linear-gradient(180deg, #6c7bff, #4a4fe0); }
.sg-btn.green { background: linear-gradient(180deg, #74f06c, #34c23e); } .sg-btn.purple { background: linear-gradient(180deg, #c07bff, #8a3dff); }
.sg-btn.gold { background: linear-gradient(180deg, #ffd84d, #f0a020); }
.sg-btn.running { background: linear-gradient(180deg, #f87171, #dc2626) !important; animation: run-pulse 1s ease-in-out infinite; }
/* ตัวเลข */
.sg-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.sg-stats > div { padding: 8px 12px; border-radius: 12px; background: #0f1012; display: grid; gap: 2px; }
.sg-stats .wide { grid-column: span 2; }
.sg-stats span { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #8b8796; font-weight: 600; }
.sg-stats b { font-size: 22px; color: #fff; -webkit-text-stroke: 4px #16121f; paint-order: stroke fill; }
.sg-stats .sg-msg { font-size: 15px; -webkit-text-stroke: 3px #16121f; }
.sg-stats .sg-msg b { font-size: inherit; color: #ffd84d; }
/* ตารางของรางวัล */
.sg-drops { display: grid; gap: 6px; }
.sg-drop { --tc: #3d8bff; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 80px; gap: 10px; align-items: center; padding: 6px 10px 6px 6px; border-radius: 14px; background: #0f1012; border: 2px solid color-mix(in srgb, var(--tc) 55%, transparent); }
.sg-drop[data-tier="epic"], .sg-chip[data-tier="epic"] { --tc: #a23dff; } .sg-drop[data-tier="gold"], .sg-chip[data-tier="gold"] { --tc: #ffc21a; }
.sg-drop[data-tier="mythic"], .sg-chip[data-tier="mythic"] { --tc: #ff5fd2; } .sg-drop[data-tier="secret"], .sg-chip[data-tier="secret"] { --tc: #ff3b3b; }
.sg-drop[data-tier="mythic"] { border-color: transparent; background: linear-gradient(#0f1012, #0f1012) padding-box, linear-gradient(90deg, #ff4d4d, #ffd84d, #5dff7a, #4dd8ff, #b44dff) border-box; }
.sg-pic { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: #1b1c21; display: grid; place-items: center; color: #fff; font-weight: 800; }
.sg-pic.ico .ic { width: 24px; height: 24px; color: #7cc4ff; }
.sg-drop-t { min-width: 0; } .sg-drop-t b { display: block; color: #fff; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-drop-t em { font-style: normal; color: #a8a3b8; font-size: 12px; }
.sg-drop-t small { font-size: 12px; color: var(--tc); font-weight: 700; } .sg-drop-t i { color: #e0b44a; font-style: normal; }
.sg-rate { font-weight: 800; color: var(--tc); font-size: 15px; -webkit-text-stroke: 3px #16121f; paint-order: stroke fill; white-space: nowrap; }
.sg-have { justify-self: end; display: grid; justify-items: end; }
.sg-have b { font-size: 18px; color: #fff; }
.sg-sh { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 800; color: #ffe27a; }
.sg-sh .ic { width: 12px; height: 12px; }
.sg-drop.bump { animation: sg-bump .45s ease-out; }
@keyframes sg-bump { 30% { transform: scale(1.025); box-shadow: 0 0 18px color-mix(in srgb, var(--tc) 55%, transparent); } }
/* ปุ่มลงด่าน */
.sg-ctrl { display: grid; gap: 10px; padding: 12px; border-radius: 16px; background: #0f1012; }
.sg-run { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sg-until { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.sg-until select { min-width: 0; padding: 10px 12px; border-radius: 12px; border: 2px solid #2a2c31; background: #17181c; color: #fff; font: 700 15px var(--gs-font, inherit); }
.sg-odds { margin: 0; font-size: 13px; color: #a8a3b8; } .sg-odds b { color: #fff; }
.sg-tg { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.sg-tg input { display: none; }
.sg-tg i { position: relative; width: 44px; height: 24px; border-radius: 12px; background: #2c2f37; flex: none; transition: background .2s; }
.sg-tg i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.sg-tg input:checked + i { background: linear-gradient(90deg, #ffd84d, #ff8ad8); } .sg-tg input:checked + i::after { transform: translateX(20px); }
.sg-tg b { display: block; color: #fff; } .sg-tg small { color: #a8a3b8; font-size: 12px; }
/* ตาล่าสุด */
.sg-log-h { font-size: 13px; font-weight: 700; color: #a8a3b8; }
.sg-log { display: grid; gap: 4px; }
.sg-log-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; background: #0f1012; }
.sg-log-row em { font-style: normal; color: #8b8796; font-size: 12px; min-width: 44px; }
.sg-log-row.new { animation: sg-in .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes sg-in { from { opacity: 0; transform: translateX(-14px); } }
.sg-chip { --tc: #3d8bff; position: relative; display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px 2px 2px; border-radius: 9px; border: 2px solid var(--tc); background: #17181c; font-size: 12px; color: #fff; }
.sg-chip b { font-weight: 800; }
.sg-chip.shiny { box-shadow: 0 0 10px #ffe27a; border-color: #ffe27a; }
.sg-chip i { display: inline-grid; color: #ffe27a; } .sg-chip i .ic { width: 12px; height: 12px; }
.sg-none { color: #6f6b7c; font-size: 12px; }
/* ทรานซิชัน */
.sg-swap { animation: sg-swap .35s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes sg-swap { from { opacity: 0; transform: translateY(10px); } }
.sg-win { animation: sg-win .9s ease-out; }
@keyframes sg-win { 30% { box-shadow: 0 0 0 3px #ffd84d, 0 0 40px #ffd84d88; } }
.sg-msg.bump { animation: sg-pop .35s ease-out; }
@keyframes sg-pop { 40% { transform: scale(1.06); } }
@media (max-width: 860px) {
  .sg-main { grid-template-columns: 1fr; }
  .sg-list { position: static; max-height: 260px; }
  .sg-drop { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .sg-have { grid-column: 3; grid-row: 1 / span 2; }
  .sg-rate { grid-column: 2; font-size: 13px; }
  .sg-drop > :first-child { grid-row: span 2; }
  .sg-stats .wide { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { .sg-swap, .sg-win, .sg-drop.bump, .sg-log-row.new { animation: none; } }
