/* duduangfree.buzz — eat.css : หน้า "กินอะไรดี" (วงล้อสุ่มเมนู / ตู้กาชา / ใครเลี้ยง) */

.eat-hero h1 { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.eat-hero-emoji { display: inline-block; font-size: .9em; animation: eatBob 2.6s ease-in-out infinite; filter: drop-shadow(0 0 14px rgba(168,85,247, .55)); }
@keyframes eatBob { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-6px) rotate(6deg); } }

.eat-ticker-wrap { padding-left: var(--gutter); padding-right: var(--gutter); }
.eat-main { padding-top: 22px; }
.eat-modes { display: flex; justify-content: center; margin-bottom: 20px; }
.eat-modes .tabs { justify-content: center; border-radius: 14px; }
.eat-modes .tabs button { padding: 10px 16px; min-height: 44px; }

/* ---------- layout ---------- */
.eat-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.eat-stage, .eat-panel { position: relative; min-width: 0; }
.eat-stage { display: flex; flex-direction: column; align-items: center; text-align: center; }
.eat-stage .hud-label { align-self: flex-start; }
.eat-pool-line { margin: 14px 0 0; font-size: .9rem; color: var(--text-2); max-width: 46ch; }
.eat-stage-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 16px; width: 100%; }
.eat-stage-actions .btn-xl { min-width: min(100%, 300px); }
.eat-jump { display: none; }
@media (max-width: 900px) {
  .eat-layout { grid-template-columns: 1fr; }
  .eat-jump { display: inline-flex; }
}

/* ---------- วงล้อ ---------- */
.eat-wheel-box { width: 100%; display: flex; justify-content: center; padding-top: 12px; }
.eat-wheel { position: relative; width: min(100%, 440px); aspect-ratio: 1 / 1; }
/* ห่อ canvas ด้วยวงกลม overflow:hidden → canvas ที่หมุนอยู่จะไม่ล้นจอ (กัน scroll แนวนอน) */
.eat-disc {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 3px rgba(122, 84, 20, .9), 0 0 36px -4px rgba(168,85,247, .55), 0 0 70px -20px rgba(247, 197, 72, .6);
  transition: box-shadow .3s ease;
}
.eat-wheel.spinning .eat-disc { box-shadow: 0 0 0 3px rgba(122, 84, 20, .9), 0 0 50px 0 rgba(168,85,247, .75), 0 0 90px -10px rgba(247, 197, 72, .8); }
.eat-disc canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; will-change: transform; }
.eat-pointer {
  position: absolute; z-index: 3; left: 50%; top: -14px; width: 40px; height: 52px; margin-left: -20px;
  transform-origin: 50% 16px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .7)) drop-shadow(0 0 8px rgba(247, 197, 72, .6));
  pointer-events: none;
}
.eat-pointer.tick { animation: eatTick .14s ease-out; }
@keyframes eatTick { 0% { transform: rotate(0); } 40% { transform: rotate(-16deg); } 100% { transform: rotate(0); } }
.eat-hub {
  position: absolute; z-index: 2; left: 50%; top: 50%; width: 23%; height: 23%; min-width: 64px; min-height: 64px;
  transform: translate(-50%, -50%); border-radius: 50%; cursor: pointer; border: 3px solid #7a5414;
  background: radial-gradient(circle at 35% 30%, #fff6d6, #f7c548 45%, #b8862b 80%, #6a4410);
  box-shadow: 0 0 0 4px rgba(168,85,247, .55), 0 0 24px rgba(247, 197, 72, .7), inset 0 -6px 12px rgba(0, 0, 0, .35);
  color: #3a0b05; font-family: var(--font-head); font-weight: 600; font-size: clamp(.9rem, 3.6vw, 1.15rem);
  transition: transform .15s ease, box-shadow .2s ease;
}
.eat-hub:hover:not([disabled]) { transform: translate(-50%, -50%) scale(1.06); box-shadow: 0 0 0 4px var(--red), 0 0 34px rgba(247, 197, 72, .9), inset 0 -6px 12px rgba(0, 0, 0, .35); }
.eat-hub[disabled] { cursor: wait; }
.eat-hub span { pointer-events: none; }

/* ---------- ตู้กาชา ---------- */
.eat-gacha { width: 100%; display: flex; justify-content: center; padding-top: 6px; }
.gacha { width: min(100%, 300px); display: flex; flex-direction: column; align-items: center; }
.gacha-sign {
  position: relative; z-index: 2; margin-bottom: -10px; padding: 6px 18px; border-radius: 10px;
  background: linear-gradient(135deg, var(--red-2), var(--red) 55%, var(--red-3)); color: #fff;
  font-family: var(--font-head); font-size: 1rem; letter-spacing: .04em; box-shadow: 0 0 18px -2px var(--red-glow), 0 0 0 2px rgba(247, 197, 72, .6);
}
.gacha-sign .latin { font-size: .78rem; letter-spacing: .2em; color: var(--gold-2); }
.gacha-dome {
  position: relative; width: 100%; aspect-ratio: 1 / .92; border-radius: 50% 50% 18px 18px / 56% 56% 18px 18px; overflow: hidden;
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, .10), rgba(168,85,247, .06) 55%, rgba(7,3,15, .6));
  border: 3px solid rgba(247, 197, 72, .75);
  box-shadow: inset 0 0 40px rgba(168,85,247, .25), 0 0 30px -8px rgba(168,85,247, .6);
}
.gacha-shine { position: absolute; left: 14%; top: 10%; width: 22%; height: 38%; border-radius: 50%; background: linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0)); transform: rotate(18deg); pointer-events: none; }
.gacha-balls { position: absolute; inset: 0; }
.gacha-balls .ball {
  position: absolute; width: 19%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(180deg, var(--c1) 0 50%, var(--c2) 50% 100%);
  box-shadow: inset -4px -6px 10px rgba(0, 0, 0, .3), inset 3px 4px 6px rgba(255, 255, 255, .45), 0 3px 6px rgba(0, 0, 0, .45);
  transform: rotate(var(--rot));
}
.gacha-balls .ball span { font-size: clamp(.8rem, 4vw, 1.1rem); font-style: normal; transform: rotate(calc(var(--rot) * -1)); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4)); }
.gacha-dome.shake .ball { animation: ballJiggle .32s ease-in-out var(--d) infinite alternate; }
.gacha-dome.shake { animation: domeShake .18s linear infinite; }
@keyframes ballJiggle { from { transform: translate(0, 0) rotate(var(--rot)); } to { transform: translate(6px, -22px) rotate(calc(var(--rot) + 120deg)); } }
@keyframes domeShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }

.gacha-body {
  position: relative; width: 88%; padding: 14px 14px 16px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 12px; align-items: center;
  background: linear-gradient(180deg, #7e22ce, #4c1d95 60%, #2a1048); border: 2px solid rgba(247, 197, 72, .7); border-top: 0; border-radius: 0 0 18px 18px;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, .45), 0 18px 40px -16px rgba(0, 0, 0, .9);
}
.gacha-slot { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 10px; border-radius: 8px; background: rgba(7,3,15, .55); border: 1px solid rgba(247, 197, 72, .35); text-align: left; }
.gacha-slot .latin { font-size: .8rem; color: var(--gold); letter-spacing: .2em; }
.gacha-slot small { font-size: .72rem; color: var(--text-2); }
.gacha-knob {
  width: 64px; height: 64px; border-radius: 50%; cursor: pointer; position: relative;
  border: 3px solid #7a5414; background: radial-gradient(circle at 35% 30%, #fff6d6, #f7c548 45%, #b8862b 85%);
  box-shadow: 0 0 18px rgba(247, 197, 72, .6), inset 0 -5px 10px rgba(0, 0, 0, .3);
}
.gacha-knob i { position: absolute; left: 50%; top: 10%; bottom: 10%; width: 12px; margin-left: -6px; border-radius: 6px; background: linear-gradient(180deg, #7e22ce, #4c1d95); box-shadow: inset 0 0 4px rgba(0, 0, 0, .4); }
.gacha-knob.turn { animation: knobTurn 1.1s cubic-bezier(.4, 0, .2, 1); }
.gacha-knob:hover:not([disabled]) { box-shadow: 0 0 28px rgba(247, 197, 72, .9), inset 0 -5px 10px rgba(0, 0, 0, .3); }
@keyframes knobTurn { to { transform: rotate(540deg); } }
.gacha-out {
  grid-column: 1 / -1; height: 82px; border-radius: 12px; position: relative; overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, rgba(0, 0, 0, .85), rgba(7,3,15, .95)); border: 1px solid rgba(247, 197, 72, .35);
}
.gacha-capsule { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; opacity: 0; transform: translateY(-90px); }
.gacha-capsule .cap-top, .gacha-capsule .cap-bot { position: absolute; left: 0; width: 60px; height: 30px; transition: transform .45s cubic-bezier(.3, 1.4, .5, 1); }
.gacha-capsule .cap-top { top: 0; border-radius: 30px 30px 0 0; background: var(--c1, var(--red)); box-shadow: inset 4px 4px 8px rgba(255, 255, 255, .4); }
.gacha-capsule .cap-bot { bottom: 0; border-radius: 0 0 30px 30px; background: var(--c2, #fff1e6); box-shadow: inset -4px -4px 8px rgba(0, 0, 0, .25); }
.gacha-capsule .cap-emoji { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.8rem; transform: scale(0); transition: transform .4s cubic-bezier(.3, 1.6, .5, 1) .1s; }
.gacha-capsule.open { opacity: 1; transform: none; }
.gacha-capsule.drop { animation: capDrop .7s cubic-bezier(.3, 1.3, .5, 1) forwards; }
.gacha-capsule.open .cap-top { transform: translate(-24px, -6px) rotate(-28deg); }
.gacha-capsule.open .cap-bot { transform: translate(24px, 6px) rotate(22deg); }
.gacha-capsule.open .cap-emoji { transform: scale(1.25); }
@keyframes capDrop { 0% { opacity: 1; transform: translateY(-90px) rotate(0); } 70% { opacity: 1; transform: translateY(4px) rotate(300deg); } 100% { opacity: 1; transform: translateY(0) rotate(360deg); } }

/* ---------- แผงตัวกรอง ---------- */
.eat-group { margin-bottom: 16px; }
.eat-group-h { font-family: var(--font-head); font-size: .95rem; color: var(--gold-2); margin-bottom: 8px; }
.eat-group-h small { color: var(--text-3); font-size: .78rem; font-weight: 300; }
.eat-opts { display: flex; flex-wrap: wrap; gap: 7px; }
.eat-opt {
  min-height: 38px; padding: 6px 12px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-head); font-size: .88rem; color: var(--text-2);
  background: rgba(6,2,12, .55); border: 1px solid var(--border); transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.eat-opt small { font-size: .72rem; color: var(--text-3); }
.eat-opt b.latin { font-size: .72rem; color: var(--gold); }
.eat-opt s { text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.eat-opt:hover:not([disabled]) { color: var(--text); border-color: rgba(168,85,247, .5); }
.eat-opt.on { color: #fff; border-color: var(--red); background: linear-gradient(135deg, rgba(196,161,255, .35), rgba(126,34,206, .55)); box-shadow: 0 0 14px -3px var(--red-glow); }
.eat-opt.on small { color: var(--gold-2); }
#f-avoid .eat-opt.on { background: linear-gradient(135deg, rgba(126,34,206, .7), rgba(42,16,72, .9)); }
#f-cats .eat-opt.on { color: #1a0d02; border-color: var(--gold); background: linear-gradient(135deg, var(--gold-2), var(--gold)); box-shadow: 0 0 14px -3px var(--gold-glow); }
.eat-opt[disabled] { opacity: .55; cursor: wait; }
.eat-panel-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.eat-veto-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.eat-veto-chip { font-size: .8rem; color: var(--text-3); }
.eat-veto-chip s { text-decoration-color: var(--red); }

/* เพื่อน */
.eat-treat-h { margin: 0 0 12px; font-size: 1.15rem; }
.eat-friend-form { display: flex; gap: 8px; }
.eat-friend-form input { flex: 1; min-width: 0; }
.eat-friends { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; min-height: 40px; }
.eat-friends .muted { margin: 0; font-size: .9rem; }
.eat-friend { padding-right: 4px; max-width: 100%; overflow-wrap: anywhere; }
.eat-friend-x {
  width: 28px; height: 28px; margin-left: 2px; border-radius: 50%; border: 0; cursor: pointer; flex: none;
  background: rgba(168,85,247, .25); color: var(--text); font-size: 1rem; line-height: 1;
}
.eat-friend-x:hover { background: var(--red); }

/* ---------- ผลลัพธ์ ---------- */
.eat-result { margin-top: 24px; scroll-margin-top: calc(var(--header-h) + 12px); }
.eat-res { position: relative; overflow: hidden; }
.eat-res-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; }
.eat-res-plate {
  width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: radial-gradient(circle, #fff8ea 0 52%, #f1e2c2 53% 60%, #f7c548 61% 66%, #4c1d95 67% 100%);
  box-shadow: 0 0 0 3px rgba(247, 197, 72, .6), 0 0 34px -4px rgba(168,85,247, .7);
}
.eat-res-plate span { font-size: 3.4rem; animation: eatPlate .7s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes eatPlate { from { transform: scale(0) rotate(-40deg); } to { transform: scale(1) rotate(0); } }
.eat-res-name { margin: 0 0 10px; font-size: clamp(1.5rem, 5vw, 2.2rem); color: var(--gold-2); text-shadow: 0 0 18px rgba(247, 197, 72, .35); overflow-wrap: anywhere; }
.eat-res-score { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.eat-why { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--border); }
.eat-why-h { font-family: var(--font-head); color: var(--text); margin-bottom: 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.eat-why-h small { color: var(--text-3); font-weight: 300; }
.eat-why-1 { font-size: 1.08rem; color: var(--gold-2); min-height: 1.6em; margin: 0 0 10px; }
.eat-why-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.eat-why-list li { padding: 8px 12px; border-radius: 10px; background: rgba(168,85,247, .06); border: 1px solid rgba(168,85,247, .16); color: var(--text-2); font-size: .95rem; }
.eat-why-list b { color: var(--red-2); font-family: var(--font-head); font-weight: 500; }
.eat-res-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.eat-res-seal { position: absolute; right: 18px; bottom: 74px; pointer-events: none; }
.eat-res-seal .seal { font-size: .95rem; line-height: 1.15; text-align: center; }

.eat-payer-top { display: flex; gap: 20px; align-items: center; }
.eat-payer-kick { font-family: var(--font-head); color: var(--text-2); }
.eat-payer-name { margin: 2px 0 6px; font-size: clamp(1.7rem, 7vw, 2.8rem); overflow-wrap: anywhere; }
.eat-payer-line { margin: 0; color: var(--text-2); }
.eat-payer-menu { margin: 16px 0 6px; padding: 10px 14px; border-radius: 10px; background: rgba(247, 197, 72, .08); border: 1px solid var(--border-2); }
.eat-payer-menu b { color: var(--gold-2); font-family: var(--font-head); font-weight: 500; }

@media (max-width: 640px) {
  .eat-res-top { grid-template-columns: auto minmax(0, 1fr); gap: 14px; }
  .eat-res-plate { width: 84px; height: 84px; }
  .eat-res-plate span { font-size: 2.5rem; }
  .eat-res-score { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; gap: 14px; }
  .eat-res-actions .btn { flex: 1 1 calc(50% - 10px); padding-left: 10px; padding-right: 10px; white-space: normal; }
  .eat-res-actions .btn[data-act=veto], .eat-res-actions .btn[data-act=treat-again] { flex-basis: 100%; }
  .eat-res-seal { bottom: auto; top: 14px; right: 10px; }
  .eat-res-seal .seal { width: 66px; height: 66px; font-size: .8rem; }
  .eat-payer-top { flex-direction: column; text-align: center; }
  .eat-modes .tabs button { padding: 9px 11px; font-size: .9rem; }
}

/* ---------- ประวัติ ---------- */
.eat-history { max-width: 760px; margin: 0 auto; }
.eat-history-stat { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.eat-history-stat .latin { font-size: .8rem; }
.eat-history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 420px; overflow-y: auto; }
.eat-history-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(6,2,12, .45); border: 1px solid var(--border); min-width: 0; }
.eat-history-list li.is-veto .eat-h-name { text-decoration: line-through; color: var(--text-3); }
.eat-history-list li.eat-h-empty { justify-content: center; }
.eat-h-emo { font-size: 1.3rem; flex: none; }
.eat-h-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-family: var(--font-head); }
.eat-history-list time { font-size: .78rem; color: var(--text-3); flex: none; }

/* ---------- เมนูทั้งหมด ---------- */
.eat-all { padding: 0; }
.eat-all summary { cursor: pointer; padding: 18px 22px; font-family: var(--font-head); font-size: 1.05rem; display: flex; align-items: center; justify-content: space-between; gap: 10px; list-style: none; }
.eat-all summary::-webkit-details-marker { display: none; }
.eat-all summary::after { content: '▾'; color: var(--gold); transition: transform .2s; }
.eat-all[open] summary::after { transform: rotate(180deg); }
.eat-all summary .badge { margin-left: auto; }
.eat-all-body { padding: 0 22px 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.eat-all-cat h4 { margin: 0 0 8px; color: var(--gold-2); font-size: 1rem; }
.eat-all-cat h4 small { color: var(--text-3); font-family: var(--font-latin); font-size: .7rem; }
.eat-all-list { display: flex; flex-wrap: wrap; gap: 6px; }
.eat-all-item { font-size: .85rem; padding: 4px 9px; border-radius: 8px; background: rgba(168,85,247, .07); border: 1px solid rgba(168,85,247, .18); color: var(--text-2); }
.eat-all-item.off { opacity: .35; text-decoration: line-through; }
.eat-disclaimer { max-width: 720px; margin: 18px auto 0; }

@media (prefers-reduced-motion: reduce) {
  .eat-hero-emoji, .gacha-dome.shake, .gacha-dome.shake .ball, .eat-pointer.tick, .gacha-knob.turn, .eat-res-plate span { animation: none !important; }
}
