/* โชว์ของ (6 ต.ค. · server/showcase.js) — ลิงก์ไอเทมในแชท (item-share.js) · หน้าต่างดูอุปกรณ์ (gear-view.js) · ป้ายในการ์ดอ่านอย่างเดียว
   ⚠️ ลิงก์อยู่ในบรรทัดแชทที่สะสมหลายร้อยบรรทัด — ห้าม animation/transition/filter · ห้าม :has() (CLAUDE.md 4b) */

/* ── ลิงก์ไอเทมในแชท: [+7 ชื่อ ◆◇] สีตาม Rank (rarityOf: common C · good B · rare A · epic S) ── */
.ilink {
  display: inline; margin: 0; padding: 0 1px; border: 0; background: none; font: inherit; font-weight: 700;
  cursor: pointer; text-decoration: underline dotted 1px; text-underline-offset: 2px; color: #f3ead2;
}
.ilink.r-good { color: #8fd27a; }
.ilink.r-rare { color: #86b8ff; }
.ilink.r-epic { color: #d9a8ff; }
.ilink.r-pk-C { color: #9ad87f; } .ilink.r-pk-B { color: #86b8ff; } .ilink.r-pk-A { color: #d9a8ff; } .ilink.r-pk-S { color: #ffd36b; }   /* คู่หู (ใบ 203) สีตาม Rank */
.ilink.gone { cursor: default; text-decoration: none; font-weight: 400; color: #c9c2b0; }
.ilink:focus-visible { outline: 2px solid #e8b64a; outline-offset: 1px; border-radius: 3px; }
html.touch-ui .ilink { padding: 2px 2px; }   /* จอสัมผัส: เป้ากดใหญ่ขึ้นเล็กน้อยโดยไม่ดันบรรทัด */

/* ── การ์ดไอเทมอ่านอย่างเดียว (item-card.js readonly) ── */
.icard .ic-note { margin: 2px 0 6px; padding: 4px 8px; border-radius: 8px; background: #2f6f7318; color: #2f6f73; font-size: 12.5px; font-weight: 600; }

/* ── หน้าต่างดูอุปกรณ์ ── */
.gv { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.gv-empty { padding: 24px; text-align: center; color: #8a7a5c; }
.gv-head { display: flex; align-items: center; gap: 10px; padding: 4px 2px; }
.gv-head .gv-job { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #e8b64a; background: #fff8e8; object-fit: cover; flex: none; }
.gv-head > div { display: flex; flex-direction: column; min-width: 0; }
.gv-head b { font-size: 16px; color: #4a3519; }
.gv-head small { color: #7a6748; font-size: 13px; }
.gv-ttl { font-style: normal; font-size: 12.5px; color: #2f6f73; font-weight: 600; }
.gv-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 1.05fr) minmax(0, 1fr); gap: 8px; align-items: stretch; min-height: 0; }
.gv-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gv-stage { position: relative; min-height: 250px; border-radius: 14px; background: radial-gradient(circle at 50% 38%, #fff9ea, #ecdcb8); border: 1px solid #d9c49a; overflow: hidden; }
.gv-stage canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.gv-slot {
  position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 7px; align-items: center;
  min-height: 46px; padding: 3px 6px; border-radius: 10px; border: 1px solid #d9c49a; background: #fffaf0; text-align: left; font: inherit; color: #4a3519;
}
button.gv-slot { cursor: pointer; }
button.gv-slot:hover { border-color: #e8b64a; background: #fff4da; }
.gv-slot.empty { opacity: .55; background: #f6efdf; }
.gv-ic { grid-row: 1 / 3; width: 40px; height: 40px; display: grid; place-items: center; font-size: 20px; position: relative; }
.gv-ic img { width: 38px; height: 38px; object-fit: contain; }
.gv-ref { position: absolute; left: 4px; top: 2px; font-size: 11px; font-weight: 800; color: #fff; background: #2f6f73; border-radius: 6px; padding: 0 4px; }
.gv-lab { font-size: 11.5px; color: #8a7a5c; line-height: 1.1; }
.gv-nm { font-size: 13px; font-weight: 600; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gv-slot.empty .gv-lab { grid-row: 1 / 3; }
.gv-pips { position: absolute; right: 6px; top: 3px; font-size: 10px; color: #a07a2c; letter-spacing: 1px; }
.gv-cos h6 { margin: 2px 0 4px; font-size: 12.5px; color: #7a6748; }
.gv-cosrow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.gv-cosrow .gv-slot { grid-template-columns: 34px minmax(0, 1fr); }
.gv-cosrow .gv-ic, .gv-cosrow .gv-ic img { width: 32px; height: 32px; }

/* จอเตี้ย/แคบ (มือถือแนวนอน Screen Shell): ช่องสั้นลง ชื่อไอเทมซ่อน — ไอคอน + ป้ายช่องยังอ่านได้ แตะดูชื่อเต็มในการ์ด */
@media (max-height: 520px) {
  .gv { gap: 5px; }
  .gv-head { padding: 0 2px; gap: 8px; }
  .gv-head .gv-job { width: 28px; height: 28px; }
  .gv-head > div { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
  .gv-head b { font-size: 14px; }
  .gv-main { grid-template-columns: minmax(0, 1fr) minmax(130px, 0.9fr) minmax(0, 1fr); gap: 6px; }
  .gv-col { gap: 4px; }
  .gv-stage { min-height: 180px; }
  /* ช่องเหลือแถวเดียว: ชื่อไอเทม (ช่องว่างโชว์ชื่อช่อง) — 5 ช่องพอดีจอสูง 390 */
  .gv-slot { min-height: 34px; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: auto; padding: 2px 6px; }
  .gv-slot:not(.empty) .gv-lab { display: none; }
  .gv-slot.empty .gv-lab { grid-row: auto; }
  .gv-ic, .gv-ic img { grid-row: auto; width: 30px; height: 30px; }
  .gv-cosrow .gv-nm { display: none; }
}
/* ปุ่มดูอุปกรณ์ท้ายแถวชื่อของป้ายเป้าหมาย (ui.js) — เล็กกว่าปุ่มแถวล่าง ไม่ดันความสูงแถว */
#target #t-lv .t-gear { min-height: 22px; margin: 0 0 0 6px; padding: 0 8px; gap: 3px; font: 700 11.5px var(--font-head); vertical-align: middle; border-radius: 7px; }
html.touch-ui body #target #t-lv .t-gear { min-height: 24px; font-size: 11px; }
@media (max-width: 560px) {
  .gv-nm { display: none; }
}
