* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body { margin: 0; min-height: 100%; }
body {
  font-family: "Leelawadee UI", "Thonburi", "Noto Sans Thai", "Sarabun", system-ui, sans-serif;
  color: #2c2350;
  background: linear-gradient(#2b1f63, #5b3fa8 55%, #e58fc0);
  background-attachment: fixed;
  overflow-x: hidden;
}
#app { min-height: 100%; display: flex; justify-content: center; }
.screen {
  width: 100%; max-width: 560px; min-height: 100vh; min-height: 100dvh;
  padding: 20px 16px 28px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; text-align: center;
}
.hidden { display: none !important; }
h2 { margin: 0; font-size: 30px; color: #fff; text-shadow: 0 2px 0 #2b1f63; }

/* หน้าโหลด */
.small-title { margin: 0; font-size: 22px; font-weight: 700; color: #ffe27a; letter-spacing: 1px; }
.big-title {
  margin: 0; font-size: clamp(38px, 11vw, 60px); line-height: 1.05; color: #fff;
  text-shadow: 0 4px 0 #ff7fb6, 0 8px 18px rgba(0,0,0,.35);
}
.pets { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px; max-width: 420px; }
.pets span { font-size: clamp(34px, 10vw, 50px); display: inline-block; animation: hop 1.2s ease-in-out infinite; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.bar { width: 80%; max-width: 320px; height: 22px; border-radius: 99px; background: rgba(255,255,255,.3); border: 3px solid #fff; overflow: hidden; }
.bar-fill { width: 0; height: 100%; background: #ffe27a; transition: width .25s linear; }

/* ปุ่ม */
.btn {
  font: inherit; font-size: 26px; font-weight: 700; color: #2c2350; background: #ffe27a;
  border: 0; border-radius: 99px; padding: 14px 34px; min-height: 60px; cursor: pointer;
  box-shadow: 0 6px 0 #d9a520;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #d9a520; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: #fff; box-shadow: 0 6px 0 #b9a8e6; font-size: 22px; }
.btn:focus-visible, .chip:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }

/* แมว */
.cat-view { width: min(60vw, 240px); }
.cat-view svg, .recep svg, .card-pic svg, .go-star svg, .chip svg { display: block; width: 100%; height: auto; }
.pick-name { margin: 0; font-size: 26px; font-weight: 700; color: #fff; min-height: 34px; }

.choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.choices.col { flex-direction: column; width: 100%; }
.chip {
  font: inherit; font-size: 18px; font-weight: 700; color: #2c2350; background: #fff;
  border: 4px solid transparent; border-radius: 20px; padding: 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 84px; padding: 6px 10px; white-space: nowrap;
}
.chip svg { width: 52px; }
.chip.on { border-color: #ffe27a; background: #fff7d1; transform: scale(1.08); box-shadow: 0 0 0 3px #2c2350; }
.chip.wide { white-space: normal; width: 100%; flex-direction: row; gap: 12px; padding: 10px 14px; text-align: left; font-size: 20px; }
.chip.wide .ico { font-size: 34px; }
.chip.wide small { display: block; font-size: 16px; font-weight: 400; color: #6a5d99; }

/* เคาน์เตอร์ */
.desk-row { display: flex; align-items: flex-end; gap: 8px; width: 100%; }
.recep { width: 38%; max-width: 190px; flex: none; }
.bubble {
  position: relative; flex: 1; background: #fff; border-radius: 22px; padding: 14px 16px;
  font-size: 21px; line-height: 1.4; text-align: left; margin-bottom: 40px;
}
.bubble::before {
  content: ""; position: absolute; left: -14px; bottom: 22px;
  border: 10px solid transparent; border-right-color: #fff; border-left: 0;
}
.card { width: 100%; max-width: 380px; background: #fffaf0; border-radius: 20px; border: 5px solid #ffb3d4; overflow: hidden; box-shadow: 0 8px 20px rgba(0,0,0,.3); transform: rotate(-2deg); }
.card-head { background: #ffb3d4; font-size: 22px; font-weight: 700; padding: 6px; }
.card-body { display: flex; align-items: center; gap: 12px; padding: 12px; text-align: left; font-size: 22px; line-height: 1.9; }
.card-pic { width: 96px; flex: none; background: #d9f1ff; border-radius: 14px; padding: 4px; }
.card-blank { display: inline-block; min-width: 110px; border-bottom: 3px dashed #b9a8e6; vertical-align: bottom; height: 1.4em; }
.star-pick { width: 100%; background: rgba(255,255,255,.18); border-radius: 22px; padding: 10px 12px 14px; }
.label { margin: 6px 0; font-size: 22px; font-weight: 700; color: #fff; }

/* ตอนจบ */
.duo { display: flex; align-items: center; justify-content: center; gap: 4px; }
.go-star { width: min(30vw, 120px); animation: hop 1.6s ease-in-out infinite; }

/* แท็บภาษา */
.lang-tabs { position: fixed; top: 10px; right: 10px; z-index: 5; display: flex; background: rgba(255,255,255,.25); border-radius: 99px; padding: 4px; gap: 4px; }
.lang-tab { font: inherit; font-size: 18px; font-weight: 700; color: #fff; background: transparent; border: 0; border-radius: 99px; padding: 8px 14px; min-height: 44px; cursor: pointer; }
.lang-tab.on { background: #fff; color: #2c2350; }
.lang-tab:focus-visible { outline: 3px solid #ffe27a; outline-offset: 2px; }
.screen { padding-top: 70px; }

/* พิมพ์ชื่อแมว และพิมพ์ให้แมวพูด */
.card-input, .say-input {
  font: inherit; font-weight: 700; color: #2c2350; background: #fff; border: 3px solid #b9a8e6;
  border-radius: 12px; padding: 4px 10px; min-height: 44px; min-width: 0;
}
.card-input { width: 100%; font-size: 22px; }
.card-lines { flex: 1; min-width: 0; }
.card-input:focus, .say-input:focus { outline: 3px solid #ffb3d4; }
.hint { margin: 0; padding: 0 12px 10px; font-size: 16px; color: #6a5d99; text-align: left; }
.talk { width: 100%; }
.talk-row { display: flex; align-items: flex-end; gap: 8px; }
.my-cat { width: 26%; max-width: 120px; flex: none; }
.bubble.me { margin-bottom: 24px; min-height: 58px; text-align: right; background: #fff7d1; word-break: break-word; }
.bubble.me::before { left: auto; right: -14px; border: 10px solid transparent; border-left-color: #fff7d1; border-right: 0; }
.say { display: flex; gap: 8px; margin-top: 6px; }
.say-input { flex: 1; font-size: 20px; border-radius: 99px; padding: 6px 16px; }
.btn.small { font-size: 20px; padding: 8px 18px; min-height: 48px; box-shadow: 0 4px 0 #d9a520; white-space: nowrap; }
