/* ===== ระบบบ้าน v4 (หน้าต่างตกปลา / แปลงผัก / ทำอาหาร / แฟชั่น / ร้านค้า) ===== */
.hs-card { text-align: center; width: min(560px, 94vw) !important; max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; }

/* ----- แท็บบน: ไอคอนบน ตัวหนังสือล่าง 5 ช่องเท่ากัน ----- */
.hs-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 12px; }
.hs-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 60px; padding: 4px 1px; font-family: inherit; font-size: 12px; line-height: 1.2;
  border-radius: 12px; border: 2px solid #8a6a32; background: #26090f; color: #ffe28a;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; min-width: 0;
}
.hs-ti { font-size: 22px; line-height: 1; }
.hs-tl { font-size: 11px; white-space: nowrap; }
.hs-tab.on { background: linear-gradient(180deg, #ffe07a, #ffc83d); color: #26090f; border-color: #ffd45c; box-shadow: 0 0 10px rgba(255, 212, 92, .45); }
/* แท็บย่อย (ระดับเมนูอาหาร / หมวดและระดับแฟชั่น) : จำนวนช่องปรับได้ที่ตัวโค้ด */
.hs-sub-tabs { grid-template-columns: repeat(5, 1fr); gap: 5px; margin-bottom: 0; }
.hs-sub-tabs .hs-tab { min-height: 38px; font-size: 12px; flex-direction: row; border-radius: 10px; white-space: nowrap; }

.hs-body { display: flex; flex-direction: column; gap: 10px; }
.hs-list { display: flex; flex-direction: column; gap: 10px; }
.hs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ----- ข้อความ/ป้าย ----- */
.hs-sub { font-size: 11px; color: #cbbd9a; line-height: 1.4; }
.hs-note { font-size: 13px; color: #cbbd9a; padding: 12px; grid-column: 1 / -1; }
.hs-sec {
  font-size: 15px; color: #ffe28a; text-align: left; margin-top: 4px; padding: 0 0 4px 10px;
  border-left: 4px solid #ffd45c; border-bottom: 1px solid #5a2028;
}
.hs-sum { font-size: 13px; color: #ffe28a; line-height: 1.5; background: #3a1018; border: 1px solid #5a2028; border-radius: 10px; padding: 8px 10px; text-align: left; }
.hs-gold {
  align-self: center; font-size: 16px; color: #26090f; background: linear-gradient(180deg, #ffe07a, #ffc83d);
  border-radius: 20px; padding: 6px 18px; font-weight: 600;
}

/* ----- ปุ่ม ----- */
.hs-btn {
  width: 100%; min-height: 54px; font-family: inherit; font-size: 17px; border-radius: 14px;
  border: 2px solid #ffd45c; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.hs-main { background: linear-gradient(180deg, #ffe07a, #ffc83d); color: #26090f; font-size: 22px; min-height: 66px; box-shadow: 0 3px 0 #a57a12; }
.hs-main:active { transform: translateY(2px); box-shadow: 0 1px 0 #a57a12; }
.hs-main2 { background: #2c6a3a; color: #fff; border-color: #5ee08a; min-height: 52px; font-size: 16px; }
.hs-alt { background: #26090f; color: #ffe28a; font-size: 14px; min-height: 46px; }
.hs-alt:disabled { opacity: .5; }
.hs-alt.on { background: #4a1a22; border-color: #5ee08a; }
.hs-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hs-two { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 58px; padding: 4px 6px; }
.hs-two b { font-size: 14px; font-weight: 500; }
.hs-two small { font-size: 11px; color: #cbbd9a; }
.hs-mini {
  min-height: 44px; min-width: 70px; padding: 4px 10px; font-family: inherit; font-size: 14px; border-radius: 10px;
  border: 2px solid #ffd45c; background: #ffd45c; color: #26090f; touch-action: manipulation;
}
.hs-mini:disabled { opacity: .4; }
.hs-wide { width: 100%; }

/* ----- ตกปลา: ฉากน้ำ ----- */
.hs-scene {
  position: relative; overflow: hidden; min-height: 190px; padding: 14px 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border: 2px solid #8a6a32; border-radius: 16px;
  background: linear-gradient(180deg, #17405c 0%, #1f6a97 55%, #10334d 100%);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, .45);
}
.hs-scene::before {
  content: ''; position: absolute; left: -10%; right: -10%; top: 0; bottom: 0; pointer-events: none; opacity: .18;
  background: repeating-linear-gradient(180deg, transparent 0 18px, #fff 18px 20px);
  animation: hs-wave 4s linear infinite;
}
@keyframes hs-wave { from { transform: translateX(0); } to { transform: translateX(-30px); } }
.hs-float { font-size: 42px; line-height: 1; z-index: 1; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .5)); }
.st-wait .hs-float { animation: hs-bob 1.4s ease-in-out infinite; }
.st-bite .hs-float { animation: hs-shake .25s linear infinite; }
@keyframes hs-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@keyframes hs-shake { 0%, 100% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }
.hs-msg { z-index: 1; font-size: 16px; min-height: 24px; color: #fff; text-shadow: 0 1px 3px #000; }
.hs-res { z-index: 1; font-size: 20px; min-height: 44px; color: #ffe28a; display: flex; align-items: center; justify-content: center; gap: 6px; text-shadow: 0 1px 3px #000; }
.hs-bar {
  position: relative; z-index: 1; width: 100%; height: 34px; border-radius: 17px; background: #3a0d0d;
  border: 2px solid #8a6a32; overflow: hidden;
}
.hs-zone { position: absolute; top: 0; bottom: 0; background: rgba(91, 227, 91, .8); }
.hs-mark { position: absolute; top: 0; bottom: 0; width: 6px; margin-left: -3px; background: #fff; box-shadow: 0 0 6px #fff; }

/* ของที่ได้: การ์ดเล็กเรียงเท่ากัน */
.hs-stock { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.hs-chip {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px;
  background: #3a1018; border: 1px solid #5a2028; border-radius: 10px;
}
.hs-chip b { font-size: 14px; color: #ffe28a; font-weight: 500; }
.hs-chip small { font-size: 10px; color: #cbbd9a; }

/* ----- การ์ดสินค้า / เมล็ด (ร้านค้า + เลือกเมล็ด) ----- */
.hs-prod {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 8px;
  background: #3a1018; border: 1px solid #5a2028; border-radius: 12px;
}
.hs-pic { width: 62px; height: 62px; display: flex; align-items: center; justify-content: center; font-size: 36px; background: #26090f; border: 1px solid #8a6a32; border-radius: 12px; }
.hs-pname { font-size: 14px; color: #ffe28a; line-height: 1.25; }
.hs-price { font-size: 13px; color: #26090f; background: #ffd45c; border-radius: 10px; padding: 1px 10px; }
.hs-tag { font-size: 10px; color: #fff; background: #5a2a8a; border-radius: 8px; padding: 0 8px; }
.hs-bt { display: flex; gap: 6px; flex-wrap: wrap; }
.hs-bt2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; margin-top: 4px; }

/* ----- แปลงผัก: การ์ด 2 คอลัมน์ ----- */
.hs-plot {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 22px 8px 8px;
  background: linear-gradient(180deg, #4a2e16, #2f1a0c); border: 2px solid #7a5230; border-radius: 12px;
}
.hs-plot.grow { border-color: #7aa24a; }
.hs-plot.ready { border-color: #5ee08a; box-shadow: 0 0 12px rgba(94, 224, 138, .5); }
.hs-pn { position: absolute; top: 5px; left: 9px; font-size: 11px; color: #d8c08a; }
.hs-pi { width: 62px; height: 62px; display: flex; align-items: center; justify-content: center; font-size: 40px; line-height: 1; }
.hs-plus { font-size: 34px; color: #8a6a32; border: 2px dashed #8a6a32; border-radius: 12px; width: 54px; height: 54px; display: flex; align-items: center; justify-content: center; }
.hs-pg { width: 100%; height: 8px; background: #1a0508; border-radius: 4px; margin-top: 3px; overflow: hidden; }
.hs-pgf { height: 100%; width: 0; background: #5be35b; transition: width .8s linear; }
.hs-plot .hs-mini { margin-top: 4px; }

/* ----- ทำอาหาร + แฟชั่น: การ์ดรายการ ----- */
.hs-dish { background: #3a1018; border-radius: 12px; padding: 10px; text-align: left; border: 1px solid #5a2028; display: flex; flex-direction: column; gap: 6px; }
.hs-dish.can { border-color: #ffd45c; }
.hs-dish.max { border-color: #5ee08a; }
.hs-dh { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.hs-dn { font-size: 15px; color: #ffe28a; display: flex; align-items: center; gap: 8px; min-width: 0; }
.hs-emo { font-size: 30px; width: 44px; text-align: center; flex: 0 0 auto; }
.hs-ico { width: 48px; height: 48px; object-fit: contain; flex: 0 0 auto; }
.hs-dc { font-size: 12px; color: #26090f; background: #ffd45c; border-radius: 10px; padding: 1px 10px; white-space: nowrap; }
.hs-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.hs-bn { font-size: 12px; color: #cfeecf; background: #1f3a26; border: 1px solid #3f7a4f; border-radius: 8px; padding: 1px 8px; }
.hs-ing { display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; }
.hs-ing span { background: #26090f; border: 1px solid #5a2028; border-radius: 8px; padding: 2px 7px; }
.hs-ok { color: #7ee79a; }
.hs-no { color: #ff8c8c; }
.hs-dish .hs-bt { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.hs-dish .hs-pg { margin-top: 0; height: 6px; }

/* ----- ไอคอนรูปวัตถุดิบ ----- */
.hs-mi { object-fit: contain; flex: 0 0 auto; vertical-align: middle; }
.hs-ig { display: inline-flex; align-items: center; gap: 4px; }

/* ----- ปุ่ม X ปิดหน้าต่าง (เล็ก ล็อกไว้มุมบนซ้ายของหน้าต่าง) ----- */
.hs-xwrap { position: sticky; top: 0; height: 0; z-index: 20; }
.hs-x {
  position: absolute; top: 8px; left: 8px; width: 32px; height: 32px; padding: 0;
  font-family: inherit; font-size: 15px; line-height: 1; color: #ffe28a;
  background: #26090f; border: 1.5px solid #8a6a32; border-radius: 50%;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.hs-x:active { background: #ffd45c; color: #26090f; }

/* ----- รูปผักในแปลง ----- */
.hs-vg { transition: transform .8s linear; transform-origin: 50% 90%; }
.hs-grow { opacity: .6; filter: saturate(.7); }

/* ----- จอแคบมาก: ย่อแท็บให้ 5 ช่องพอดี ----- */
@media (max-width: 360px) {
  .hs-tab { min-height: 54px; }
  .hs-ti { font-size: 20px; }
  .hs-tl { font-size: 10px; }
}
