/* =========================================================================
   แท็บ SPIN — วงล้อนำโชค (shared/lucky-spin.js)  + แถวรายการโปรดใน MY ZONE
   ไฟล์แยกจาก hub.css: เพิ่มอย่างเดียว ไม่แก้สไตล์เดิม
   ========================================================================= */
.NavBtn--spin.is-active { background: linear-gradient(180deg, #4ade80, var(--green)); box-shadow: 0 6px 16px rgba(34, 197, 94, .4); }

#view-spin { padding: 0; height: 100%; }
.Spin {
  position: relative;
  display: flex;
  flex-flow: column;
  height: 100%;
  min-height: calc(100dvh - var(--topbar-h) - var(--tabbar-h));   /* เต็มเวที ปุ่มหมุนชิดล่างเสมอ */
  color: #fff;
  /* โทนเดียวกับล็อบบี้ (ธีมอวกาศเข้ม) — เดิมเป็นฟ้าอ่อนขัดกับแอป (user ทัก 2026-09-10) */
  background: radial-gradient(120% 60% at 50% 0%, rgba(139, 92, 246, .22), transparent 60%), linear-gradient(180deg, #141a3a 0%, #0f1330 45%, var(--bg) 100%);
  overflow: hidden auto;   /* จอเตี้ยมาก ๆ ยังเลื่อนถึงปุ่มได้ */
}

/* ครึ่งบน: วงล้อใหญ่กว่าจอ ศูนย์กลางอยู่ใกล้ขอบบน (ตามเรฟ)
   responsive: ส่วนนี้ยืด/หดตามความสูงที่เหลือ (ปุ่มหมุนอยู่ล่างเสมอ) — ขนาดวงล้ออิงความสูงของกล่องด้วย cqh */
.Spin-Top {
  position: relative;
  flex: 1 1 0;
  min-height: 150px;
  max-height: min(calc(66vw + 56px), 402px);
  overflow: hidden;
  container-type: size;
}
.Spin-WheelWrap {
  position: absolute;
  left: 50%; top: 14cqh;
  width: min(132vw, 690px, 172cqh);
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 16px 30px rgba(0, 0, 0, .55));
}
.Spin-Wheel { width: 100%; height: 100%; will-change: transform; }
.Spin-Svg { display: block; width: 100%; height: 100%; }
.Spin-Pointer {
  position: absolute;
  left: 50%; bottom: -2px;
  width: 54px; height: 54px;
  transform: translateX(-50%);
  z-index: 2;
  pointer-events: none;
}
.Spin-Pointer i {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #ffb347, #ff6a3d);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  border-radius: 8px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .25));
}
.Spin-Pointer::before {
  content: ""; position: absolute; inset: -6px -8px -8px;
  background: #f6c53a;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  z-index: -1;
}

/* กลาง */
.Spin-Body {
  flex: none;
  margin-top: auto;              /* จอสูง: วงล้อโตจนถึงเพดานก่อน ที่ว่างที่เหลือดันชื่อ+ปุ่มลงล่าง · จอเตี้ย: วงล้อหดให้ปุ่มอยู่ในจอ */
  display: flex;
  flex-flow: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 12px var(--gutter) 6px;
  text-align: center;
}
.Spin-Title { font-size: clamp(1.5rem, 4vh, 2rem); font-weight: 800; letter-spacing: .02em; }
.Spin-Sub { font-size: 1.2rem; color: var(--mut); line-height: 1.45; max-width: 34ch; }
.Spin-Msg { min-height: 1.6em; font-size: 1.5rem; font-weight: 800; color: #4ade80; }
.Spin-Streak { display: flex; flex-flow: column; align-items: center; gap: 4px; margin-top: 4px; }
.Spin-StreakIcon {
  width: 60px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(180deg, #ff5d5d, #d92c2c);
  color: #fff; font-weight: 900; font-size: 1.5rem;
  box-shadow: 0 6px 12px rgba(217, 44, 44, .35), inset 0 2px 0 rgba(255, 255, 255, .35);
  position: relative;
}
.Spin-StreakIcon::after {
  content: "🚩"; position: absolute; top: -12px; right: -8px; font-size: 1.1rem;
}
.Spin-StreakLabel { font-size: .95rem; font-weight: 800; letter-spacing: .12em; color: #2c3a63; }
.Spin-StreakPill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(30, 50, 100, .12);
  font-size: 1.35rem; font-weight: 700; color: #1e2a4a;
}
.Spin-StreakPill b { color: #d92c2c; }
.Spin-Info {
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: #cfd8ea; color: #fff; font-size: .8rem; font-weight: 800; font-style: italic;
}

/* ล่าง: ปุ่มเหลืองใหญ่ (ตามเรฟ) */
.Spin-Foot { flex: none; padding: 8px var(--gutter) calc(var(--gutter) + 4px); }
.Spin-Btn {
  width: 100%;
  padding: .55em 1em;
  border-radius: 100px;
  background: linear-gradient(180deg, #ffe27a, #ffc21a 60%, #f0a80a);
  color: #4a3202;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: 0 8px 0 #c9860a, 0 14px 22px rgba(240, 168, 10, .35), inset 0 2px 0 rgba(255, 255, 255, .6);
  transition: transform .12s ease, box-shadow .12s ease, filter .2s ease;
}
.Spin-Btn:active { transform: translateY(4px); box-shadow: 0 4px 0 #c9860a, 0 8px 14px rgba(240, 168, 10, .3), inset 0 2px 0 rgba(255, 255, 255, .6); }
.Spin-Btn:disabled { cursor: default; filter: saturate(.5) brightness(.95); }
.Spin-Btn.is-off { background: linear-gradient(180deg, #e6e9f2, #c9cfe0); color: #6a7390; box-shadow: 0 6px 0 #aab2c8; }

/* ผลรางวัล */
.Spin-Result { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; }
.Spin-Result[hidden] { display: none; }
.Spin-ResultBack { position: absolute; inset: 0; background: rgba(6, 10, 30, .55); backdrop-filter: blur(2px); }
.Spin-ResultCard {
  position: relative;
  width: min(86vw, 360px);
  padding: 26px 22px 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff, #eef3ff);
  color: #1e2a4a;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  animation: spinPop .35s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes spinPop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.Spin-ResultKicker { font-size: 1.2rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #6a7390; }
.Spin-ResultIcon { width: 96px; height: 96px; margin: 10px auto 4px; object-fit: contain; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .25)); }
.Spin-ResultAmount { font-size: 2.2rem; font-weight: 900; color: #0f7a3a; line-height: 1.2; }
.Spin-ResultNote { margin-top: 8px; font-size: 1.15rem; color: #4d5b83; line-height: 1.5; }
.Spin-Ok {
  margin-top: 16px;
  padding: .5em 2.4em;
  border-radius: 100px;
  background: linear-gradient(180deg, #ffe27a, #ffc21a 60%, #f0a80a);
  color: #4a3202; font-size: 1.4rem; font-weight: 800; letter-spacing: .08em;
  box-shadow: 0 5px 0 #c9860a; cursor: pointer;
}
.Spin-Ok:active { transform: translateY(3px); box-shadow: 0 2px 0 #c9860a; }

/* MY ZONE: แถวรายการโปรด (ย้ายมาจากปุ่ม FAVORITE เดิม) */
.FavRow { margin-top: var(--section); }
.FavRow .Row-Title { display: inline-flex; align-items: center; gap: 6px; }
.FavRow-Empty {
  margin: 0 var(--gutter);
  padding: 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px dashed var(--line);
  color: var(--mut);
  font-size: 1.2rem;
  line-height: 1.5;
  text-align: center;
}

/* จอเตี้ย: ตัดคำอธิบายให้วงล้อกับปุ่มยังอยู่ครบในจอ */
@media (max-height: 640px) {
  .Spin-Sub { display: none; }
  .Spin-Msg { min-height: 1.2em; }
  .Spin-Btn { font-size: 1.4rem; padding: .45em 1em; }
}

/* ฟีด: ใครหมุนได้อะไรล่าสุด (10 รายการ) */
.Spin-Feed { width: 100%; max-width: 420px; margin-top: 4px; text-align: left; }
.Spin-FeedHead { margin: 0 0 6px; font-size: 1.05rem; font-weight: 700; letter-spacing: .04em; color: var(--mut); text-align: center; }
.Spin-FeedList {
  list-style: none; margin: 0; padding: 4px 6px;
  max-height: clamp(84px, 26vh, 230px);
  overflow-y: auto; scrollbar-width: none;
  border-radius: 16px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
}
.Spin-FeedList::-webkit-scrollbar { display: none; }
.Spin-FeedItem {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; align-items: center; gap: 8px;
  padding: 5px 6px; font-size: 1.15rem; line-height: 1.3;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.Spin-FeedItem:last-child { border-bottom: 0; }
.Spin-FeedItem img { width: 24px; height: 24px; object-fit: contain; }
.Spin-FeedWho { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.Spin-FeedWho em { font-style: normal; color: var(--gold); font-weight: 700; }
.Spin-FeedWhat { color: #4ade80; font-weight: 700; white-space: nowrap; }
.Spin-FeedItem.is-reward .Spin-FeedWhat { color: var(--gold); }
.Spin-FeedWhen { color: var(--mut); font-size: .95rem; white-space: nowrap; }
.Spin-FeedItem.is-me { background: rgba(255, 201, 60, .08); border-radius: 10px; }
@media (max-height: 640px) { .Spin-Feed { display: none; } }

/* MY ZONE: ตัวเลือกภาษาย้ายมาอยู่เหนือแถวรายการโปรด (user 2026-09-10) — กันระยะซ้อนสองชั้น */
.LangSeg + .FavRow { margin-top: 0; }
