@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@400;700;800;900&family=Kanit:wght@700;800;900&family=Press+Start+2P&family=Fredoka+One&display=swap');

/* ── TOKENS ── */
:root {
  --pk: #FF4DA6;    
  --lime: #8BEA20;  
  --yel: #FFE600;   
  --dk: #111111;    
  --cream: #FFFFFF; 
  --mint: #00FFBA;  
  --sky: #00C8FF; 
  --pur: #B23AEE;   
  --ora: #FF7420;
  --dk2: #1E0C38;   
  --dk3: #2A1450;

  --pfont: 'Press Start 2P', 'Sarabun', monospace;
  --hfont: 'Sarabun', sans-serif;
  --bfont: 'Sarabun', sans-serif;

  --bdr: 3px solid var(--dk);
  --sh:  none; /* ปิดเงาหลัก */

  --phone-w: 390px;
  --phone-h: 844px;
}

/* ── BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { 
  width: 100%; height: 100%; overflow: hidden; background: var(--pk); 
  font-family: 'Sarabun', sans-serif; 
}
button, input, select, textarea { font-family: inherit; }

body { 
  display: flex; align-items: center; justify-content: center; min-height: 100vh; 
  background-color: #FF1E8E !important;
  background-image:
    radial-gradient(circle at 10% 10%, rgba(255, 255, 0, 1) 0%, transparent 50%),     
    radial-gradient(circle at 90% 90%, rgba(57, 255, 20, 1) 0%, transparent 55%),     
    radial-gradient(circle at 50% 50%, rgba(255, 0, 128, 0.9) 0%, transparent 60%),   
    radial-gradient(circle at 85% 15%, rgba(180, 0, 255, 0.9) 0%, transparent 50%) !important; 
  background-size: cover !important;
  background-attachment: fixed !important;
}

/* ═══════ PHONE SHELL ═══════ */
.phone-shell {
  position: relative; width: var(--phone-w); height: var(--phone-h);
  background: var(--dk2); border-radius: 44px;
  border: 4px solid var(--dk);
  box-shadow: 0 0 0 8px var(--cream), 0 0 0 14px var(--dk); /* เอาเงาฟุ้งด้านหลังมือถือออก */
  overflow: hidden; isolation: isolate;
}
@media(max-width:430px) {
  .phone-shell { width: 100vw; height: 100dvh; border-radius: 0; border: none; box-shadow: none; }
  body { background: var(--pk); }
}
@media(max-height:860px) and (min-width:431px) {
  :root { --phone-h: 100vh; --phone-w: min(390px, 100vw); }
  .phone-shell { height: 100vh; border-radius: 0; }
}

.phone-notch {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 120px; height: 30px; background: var(--dk); border-radius: 0 0 20px 20px;
  z-index: 3000; display: flex; align-items: center; justify-content: center;
}
.notch-pill { width: 60px; height: 10px; background: #0A0018; border-radius: 5px; }
@media(max-width:430px) { .phone-notch { display: none; } }

/* ═══════ SCREENS & BACKGROUND ═══════ */
.screen { position: absolute; inset: 0; display: none; flex-direction: column; overflow: hidden; z-index: 10 !important; }
.screen.active { display: flex; }
.screen-in { animation: scrIn 0.32s cubic-bezier(0.22,1,0.36,1) both; }
.screen-out { animation: scrOut 0.2s ease-in both; }
@keyframes scrIn { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes scrOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(0.95); } }

/* อัปเดตพื้นหลังไล่สี Mesh Gradient ตามแบบ Reference */
.phone-shell, .screen, .lock-wrap, .char-select-wrap, .clear-wrap, .go-wrap, .result-wrap, .chat-wrap {
  background-color: transparent !important;
  background-image: none !important;
}

/* ═══════ FLOATING COINS & LANG BTN ═══════ */
.float-coins { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.fc-item { position: absolute; font-size: 18px; opacity: 0.25; animation: fcFloat linear infinite; filter: drop-shadow(0 0 4px rgba(255,255,255,.6)); will-change: transform; image-rendering: pixelated; }
@keyframes fcFloat { 0% { transform: translateY(110%) rotate(0deg); } 100% { transform: translateY(-110%) rotate(360deg); } }

/* Global Language Button */
#langBtn { position: absolute !important; z-index: 99999 !important; display: flex !important; }
.lang-btn {
  position: absolute !important; top: 38px !important; right: 14px !important; z-index: 99999 !important;
  background: var(--cream); color: var(--dk); border: var(--bdr); box-shadow: none; /* ลบเงา */
  font-family: var(--pfont); font-size: 7px; padding: 7px 12px; cursor: pointer;
  display: flex; align-items: center; gap: 5px; transition: transform 0.1s; letter-spacing: 0.5px;
  border-radius: 8px;
}
.lang-btn:hover { transform: translate(-2px,-2px); }
.lang-btn:active { transform: translate(1px,1px); }
.lang-globe { font-size: 11px; }
@media(max-width:430px) { .lang-btn { top: 14px !important; right: 14px !important; } }

#screenStageClear .lang-btn, 
#screenResult .lang-btn,
#langBtnStage, 
#langBtnResult { display: none !important; }

/* ═══════ BUTTONS & TYPOGRAPHY ═══════ */
.ptxt { font-family: var(--pfont) !important; }
.fat-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--bfont); font-size: 14px; font-weight: 800; padding: 14px 24px; border: var(--bdr); cursor: pointer;
  transition: transform 0.08s; white-space: nowrap; border-radius: 12px;
  box-shadow: none !important; /* ลบเงา */
}
.fat-btn:hover { transform: translate(-2px,-2px); }
.fat-btn:active { transform: translate(2px,2px); }
.btn-sm { font-size: 12px; padding: 10px 18px; }

.g-btn { background: var(--lime); color: var(--dk); box-shadow: none; }
.p-btn { background: var(--pk); color: #fff; box-shadow: none; }
.gray-btn { background: var(--cream); color: var(--dk); box-shadow: none; }

.wrong-pill { display: flex; align-items: center; gap: 4px; background: var(--cream); border: 2px solid var(--dk); box-shadow: none; padding: 5px 10px; font-family: var(--pfont); font-size: 8px; color: var(--pk); border-radius: 8px; }
.go-dots { display: flex; gap: 4px; align-items: center; }
.go-dots span { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(0,0,0,.3); }
.go-dots span:nth-child(1) { background: #FF4DA6; } .go-dots span:nth-child(2) { background: #FFE600; } .go-dots span:nth-child(3) { background: #8BEA20; }
.go-head-txt { flex: 1; text-align: center; font-size: 10px; color: var(--dk); letter-spacing: 0.5px; font-weight: 800;}

.back-btn { background: var(--cream); border: 2px solid var(--dk); color: var(--dk); font-family: var(--pfont); font-size: 10px; padding: 7px 12px; cursor: pointer; transition: background 0.15s; border-radius: 8px; box-shadow: none; }
.back-btn:active { transform: translate(1px,1px); }
.float-anim { animation: floatBob 3s ease-in-out infinite; }
@keyframes floatBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ═══════ SCREEN 1: LOCK SCREEN (INTRO) ═══════ */
.lock-wrap { flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 80px 20px 40px; position: relative; z-index: 10; }
.lock-time-area { text-align: center; margin-bottom: 10px; }
.lock-clock { font-size: 40px; color: var(--cream); text-shadow: -2px -2px 0 var(--dk), 2px -2px 0 var(--dk), -2px 2px 0 var(--dk), 2px 2px 0 var(--dk), 4px 4px 0 var(--pur); letter-spacing: 1px; }
.lock-date { font-family: var(--bfont); font-size: 10px; font-weight: 900; color: var(--dk); background: var(--yel); display: inline-block; padding: 2px 10px; border: 2px solid var(--dk); box-shadow: none; border-radius: 8px; margin-top: 5px; }

.lock-notifications { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.noti-card { background: rgba(255, 255, 255, 0.9); border-radius: 20px; padding: 14px; border: 3px solid var(--dk); box-shadow: none; animation: notiPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes notiPop { from { transform: scale(0.9) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

.noti-header { display: flex; align-items: center; gap: 6px; border-bottom: 2px dashed rgba(0,0,0,0.15); padding-bottom: 6px; margin-bottom: 8px; }
.noti-icon { font-size: 20px; }
.noti-app, .noti-time, .noti-desc { font-family: var(--bfont); color: var(--dk); font-weight: 800; }
.noti-app { flex: 1; font-size: 16px; color: var(--pk); }
.noti-time { font-size: 11px; }
.noti-title { font-family: var(--hfont); font-size: 16px; color: var(--dk); margin-bottom: 8px; font-weight: 900; background: transparent; padding: 0; border: none; }
.noti-desc { font-size: 13px; line-height: 1.5; }
.noti-desc .rule-item { margin-top: 4px; }

.noti-special { background: var(--yel); position: relative; }

.slide-unlock-container { width: 100%; height: 64px; background: var(--cream); border-radius: 32px; position: relative; overflow: hidden; border: 4px solid var(--dk); box-shadow: none; }
.slide-text { position: absolute; width: 100%; text-align: center; line-height: 58px; font-size: 9px; color: var(--dk); z-index: 1; pointer-events: none; font-weight: 900; }
.blink-text { animation: blinkText 2s infinite; }
@keyframes blinkText { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; color: var(--pk); } }

.slide-thumb { width: 54px; height: 54px; background: var(--lime); border-radius: 27px; position: absolute; top: 1px; left: 1px; display: flex; justify-content: center; align-items: center; cursor: grab; border: 3px solid var(--dk); box-shadow: none; z-index: 2; transition: transform 0s; }
.slide-thumb:active { cursor: grabbing; background: var(--yel); }
.thumb-icon { color: var(--dk); font-size: 12px; margin-left: 3px; }

/* ═══════ SCREEN 2: CHARACTER SELECT ═══════ */
.char-select-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.char-topbar { display: flex; align-items: center; justify-content: space-between; padding: 100px 16px 12px; flex-shrink: 0; }
.char-topbar-title, .clear-title, .go-title, .result-title, .tips-header { 
  color: var(--pk) !important; 
  font-weight: 900; font-size: 20px; text-align: center; letter-spacing: 1px; 
  text-shadow: -2px -2px 0 #FFF, 2px -2px 0 #FFF, -2px 2px 0 #FFF, 2px 2px 0 #FFF, 0px 3px 0 #FFF, 0px -3px 0 #FFF, 3px 0px 0 #FFF, -3px 0px 0 #FFF, 4px 4px 0 var(--pur) !important;
  background: transparent !important; border: none !important; box-shadow: none !important;
}
.char-hint { font-family: var(--bfont); font-size: 14px; font-weight: 900; color: var(--cream); text-shadow: 2px 2px 0 var(--dk); text-align: center; padding: 8px 20px 4px; flex-shrink: 0; }

.char-stage-area { flex: 1; position: relative; display: flex; align-items: center; justify-content: flex-start !important; overflow: hidden; }
.char-nav { position: absolute; z-index: 10; width: 44px; height: 44px; border-radius: 50%; font-size: 28px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s, transform 0.1s; font-family: var(--bfont); font-weight: 900; }
.char-nav { background: var(--cream) !important; border: 3px solid var(--dk) !important; color: var(--dk) !important; box-shadow: none !important; opacity: 1 !important; }
.char-nav:active { background: var(--yel) !important; transform: translate(2px, 2px) !important; }
.char-nav-l { left: 8px; } .char-nav-r { right: 8px; }

.char-showcase { display: flex; gap: 16px; transition: transform 0.38s cubic-bezier(0.22,1,0.36,1); will-change: transform; align-items: center; padding: 0 16px; }

.char-card {
  flex-shrink: 0;
  width: 82vw !important; max-width: 320px !important;
  height: 58vh !important; max-height: 480px !important;
  display: flex !important; flex-direction: column !important;
  background: var(--cream); border: var(--bdr); border-radius: 20px !important;
  box-shadow: none !important; transition: transform 0.3s, filter 0.3s;
  overflow: hidden; cursor: pointer; filter: none !important; opacity: 1 !important;
}
.char-card.active-char { transform: scale(1.05) translateY(-6px) !important; z-index: 5; }
.char-card.inactive-char { transform: scale(0.9) !important; }

.char-face-area { flex: 1 !important; height: auto !important; display: flex; align-items: center; justify-content: center; border-bottom: 3px solid var(--dk) !important; position: relative; overflow: hidden; box-shadow: none !important; }
.char-face-area::before { content: ''; position: absolute; inset: 0; background: var(--char-grad, linear-gradient(145deg, var(--yel), var(--lime))); }
.char-face-area::after { content: ''; position: absolute; inset: 0; background: repeating-conic-gradient(rgba(255,255,255,.3) 0% 25%, transparent 0% 50%) 0 0/30px 30px; }

.pix-char { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 0; image-rendering: pixelated; }
.pix-head { width: 60px; height: 60px; border: 3px solid var(--dk); background: var(--char-skin, #FFCBA4); box-shadow: none; display: flex; align-items: center; justify-content: center; position: relative; font-size: 36px; }
.pix-head::before { content: ''; position: absolute; top: 4px; left: 4px; width: 12px; height: 6px; background: rgba(255,255,255,.4); }
.pix-body { width: 50px; height: 40px; border: 3px solid var(--dk); border-top: none; background: var(--char-shirt, #FF4DA6); box-shadow: none; }
.pix-legs { display: flex; gap: 4px; } .pix-leg { width: 20px; height: 20px; border: 3px solid var(--dk); border-top: none; background: var(--char-pants, #111); }

.char-info-area { padding: 16px !important; display: flex !important; flex-direction: column !important; gap: 10px !important; background: var(--cream) !important; }
.char-name { background: var(--cream) !important; color: var(--pk) !important; display: inline-block !important; padding: 6px 14px !important; border: 3px solid var(--dk) !important; border-radius: 12px !important; box-shadow: none !important; align-self: flex-start !important; font-size: 22px !important; margin-bottom: 0 !important; font-family: var(--hfont); font-weight: 900; line-height: 1.1; }
.char-role { background: var(--lime) !important; color: var(--dk) !important; display: inline-block !important; padding: 6px 10px !important; border: 2px solid var(--dk) !important; border-radius: 8px !important; align-self: flex-start !important; font-size: 11px !important; margin-bottom: 0 !important; font-family: var(--pfont); letter-spacing: 0.5px; }
.char-bio { background: var(--yel) !important; color: var(--dk) !important; padding: 12px !important; border: 2px solid var(--dk) !important; border-radius: 10px !important; box-shadow: none !important; font-size: 14px !important; font-weight: 800 !important; opacity: 1 !important; line-height: 1.5 !important; font-family: var(--bfont); }

.char-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 5; }
.char-dot { width: 10px; height: 10px; border: 2px solid var(--dk); background: var(--cream); transition: background 0.2s, transform 0.2s; border-radius: 50%; }
.char-dot.active { background: var(--pk); transform: scale(1.3); }
.char-confirm-btn { width: calc(100% - 32px); margin: 0 16px 20px; flex-shrink: 0; background: var(--yel); color: var(--dk); box-shadow: none; }

/* แอนิเมชันลอยขึ้น-ลง ให้ตัวละคร */
.char-image-display {
    animation: floatAnim 3s ease-in-out infinite;
    image-rendering: pixelated !important;
}

/* ═══════ SCREEN 3: CHAT DIALOGUE ═══════ */
.chat-wrap { 
  flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; padding-top: 85px;
}

.chat-bg-anim { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.chat-float-icon { position: absolute; bottom: -50px; opacity: 0.4; animation: chatFloatUp linear infinite; will-change: transform; filter: drop-shadow(2px 2px 0 var(--cream)); image-rendering: pixelated !important; }

.chat-topbar { 
  background: var(--cream); 
  padding: 12px 16px; 
  border-bottom: 4px solid var(--dk); 
  border-top: 4px solid var(--dk);
  display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 10; flex-shrink: 0; 
}
.chat-wrong-pill { border-color: var(--dk); box-shadow: none; margin-right: 65px; background: var(--yel); color: var(--dk); }

.chat-body { flex: 1; overflow-y: auto; padding: 20px 16px; display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 5; scroll-behavior: smooth; }

.chat-msg { display: flex; gap: 10px; align-items: flex-end; width: 100%; animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.msg-left { justify-content: flex-start; }
.msg-right { justify-content: flex-end; }

.chat-avatar { width: 60px; height: 60px; object-fit: contain; background: var(--cream); border: 3px solid var(--dk); border-radius: 50%; box-shadow: none; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.chat-avatar.hidden { visibility: hidden; }

.ccp-avatar { width: 56px; height: 56px; object-fit: contain; margin-bottom: 4px; }
.mbox-senior-face { width: 85px !important; height: 85px !important; object-fit: contain; }

.chat-bubble { max-width: 78%; padding: 12px 16px; border: 3px solid var(--dk); border-radius: 20px; position: relative; box-shadow: none !important; }
.senior-bubble { background: var(--cream); border-bottom-left-radius: 6px; box-shadow: none; }
.player-bubble { background: var(--yel); color: var(--dk); border-bottom-right-radius: 6px; box-shadow: none; }

.chat-name { font-size: 8px; color: var(--pk); margin-bottom: 6px; letter-spacing: 0.5px; font-weight: 800; }
.chat-text-content { font-family: var(--bfont); font-size: 14px; font-weight: 800; line-height: 1.5; white-space: pre-line; word-break: break-word; color: var(--dk); }

.chat-input-area { background: var(--lime); border-top: 4px solid var(--dk); padding: 12px 16px 20px; display: flex; flex-direction: column; position: relative; z-index: 10; flex-shrink: 0; box-shadow: none !important; }
.secret-hint { font-size: 11px; font-weight: 900; color: var(--dk); opacity: 0.7; text-align: center; margin-bottom: 8px; background: var(--cream); border-radius: 10px; padding: 4px; border: 2px solid var(--dk); display: inline-block; align-self: center; }

.input-row { display: flex; gap: 10px; width: 100%; }
.chat-input { flex: 1; font-family: var(--bfont); font-size: 14px; font-weight: 800; padding: 12px 16px; border: 3px solid var(--dk); border-radius: 20px; outline: none; background: var(--yel); color: var(--dk); box-shadow: none; }
.chat-input:focus { border-color: var(--pk); background: var(--cream); }
.chat-send-btn { width: 48px; height: 48px; border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 20px; padding: 0; flex-shrink: 0; background: var(--pk); color: var(--cream); border: 3px solid var(--dk); box-shadow: none; cursor: pointer; }
.chat-send-btn:active { transform: translate(2px,2px); }

/* ═══════ SCREEN 4: GAME & CARDS ═══════ */
.game-header { display: flex; align-items: center; justify-content: space-between; padding: 85px 16px 8px; flex-shrink: 0; box-shadow: none !important; }
.gh-stage-box { background: var(--cream); border: 3px solid var(--dk); border-radius: 16px; padding: 8px 14px; box-shadow: none; display: flex; align-items: center; justify-content: center; }
.gh-stage { font-size: 12px; color: var(--pk); text-shadow: none; font-weight: 900; letter-spacing: 0.5px; box-shadow: none !important; }

.card-arena { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; padding: 8px 16px; min-height: 0; }
.swipe-guide { display: flex; justify-content: space-between; width: 100%; max-width: 320px; pointer-events: none; margin-bottom: 8px; z-index: 5; }

.sg-l, .sg-r { font-family: var(--hfont); font-size: 24px; font-weight: 900; padding: 4px 18px; border-radius: 16px; display: flex; align-items: center; justify-content: center; border: 3px solid var(--dk); box-shadow: none; }
.sg-l { color: var(--cream); background: var(--pk); text-shadow: 2px 2px 0 var(--dk); } 
.sg-r { color: var(--cream); background: var(--lime); text-shadow: 2px 2px 0 var(--dk);}

/* ค้นหาโค้ดส่วนนี้ใน style.css */
.stack-wrap { 
    position: relative; 
    width: 100%; 
    max-width: 320px; 
    /* 👇 เปลี่ยนความสูงตรงนี้ครับ (ของเดิมน่าจะ 440px) */
    height: 490px !important; /* ลองปรับเป็น 480px หรือ 500px ดูครับ */
}
.swipe-card { position: absolute; inset: 0; background: var(--cream); border: 4px solid var(--dk); box-shadow: none; display: flex; flex-direction: column; cursor: grab; user-select: none; transform-origin: 50% 108%; will-change: transform; overflow: hidden; border-radius: 24px; }
.swipe-card:active { cursor: grabbing; box-shadow: none; }

.cz0 { z-index: 10; } .cz1 { z-index: 9; transform: rotate(-2.5deg) scale(0.96) translateY(8px); pointer-events: none; } .cz2 { z-index: 8; transform: rotate(2deg) scale(0.92) translateY(16px); pointer-events: none; } .cz3 { z-index: 7; transform: rotate(-1deg) scale(0.88) translateY(22px); pointer-events: none; }

.card-top { border-bottom: 3px solid var(--dk); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; position: relative; flex-shrink: 0; background: var(--yel); box-shadow: none !important; }
.card-top::after { content: ''; position: absolute; top: 6px; left: 6px; width: 25px; height: 12px; background: rgba(255,255,255,.6); border-radius: 6px; }
.card-type-tag { font-family: var(--pfont); font-size: 9px; padding: 6px 14px; border: 3px solid var(--dk); background: var(--cream); color: var(--pk); border-radius: 12px; font-weight: bold; box-shadow: none; }

.card-emo-zone { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 25px; border-bottom: 3px solid var(--dk); position: relative; overflow: hidden; min-height: 160px; background: repeating-linear-gradient(45deg, var(--pk), var(--pk) 10px, #FF66B2 10px, #FF66B2 20px); }
.card-main-emo { font-size: 110px; filter: drop-shadow(4px 4px 0 var(--dk)); position: relative; z-index: 1; }

.card-info-block { padding: 20px 18px; background: var(--cream); }
.card-title-txt { font-family: var(--hfont); font-size: 26px; font-weight: 900; color: var(--pk); margin-bottom: 8px; line-height: 1.2; text-shadow: 1px 1px 0 var(--dk); }
.card-desc-txt { font-family: var(--bfont); font-size: 18px; font-weight: 800; color: var(--dk); line-height: 1.6; }
.card-price-bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--lime); margin-top: auto; border-top: 3px solid var(--dk); flex-shrink: 0; }
.card-price-num { font-family: var(--pfont); font-size: 20px; color: var(--dk); text-shadow: 2px 2px 0 var(--cream); }
.card-price-lbl { font-family: var(--bfont); font-weight: 900; font-size: 14px; color: var(--dk); }

.swipe-stamp { position: absolute; font-family: var(--pfont); font-size: 24px; padding: 8px 16px; border: 5px solid; opacity: 0; pointer-events: none; z-index: 20; letter-spacing: 1px; border-radius: 10px; background: var(--cream); }
.stamp-nope { top: 25px; left: 15px; color: var(--pk); border-color: var(--dk); transform: rotate(-14deg); box-shadow: none; }
.stamp-good { top: 25px; right: 15px; color: var(--lime); border-color: var(--dk); transform: rotate(14deg); box-shadow: none; }

.sout-l { animation: swpL 0.35s ease-in both; } .sout-r { animation: swpR 0.35s ease-in both; }

/* ─── ACTION ROW ─── */
.action-row { display: flex; gap: 12px; padding: 10px 16px 25px; justify-content: center; align-items: stretch; flex-shrink: 0; }
.act-btn { flex: 1; display: flex; align-items: center; justify-content: center; border: 3px solid var(--dk); cursor: pointer; transition: transform 0.1s; padding: 18px 10px; border-radius: 16px; box-shadow: none; }
.act-btn:hover { transform: translate(-2px,-2px); }
.act-btn:active { transform: translate(2px,2px); }

.act-pass { background: var(--pk); } 
.act-hint { background: var(--yel); } 
.act-good { background: var(--lime); } 

.act-lbl { font-size: 20px; color: var(--dk); font-weight: 900; font-family: var(--bfont); text-shadow: -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff, 2px 2px 0 #fff; letter-spacing: 0.5px; }
.card-counter { font-family: var(--pfont); font-size: 10px; color: var(--dk); text-shadow: 1px 1px 0 var(--cream); text-align: center; padding-bottom: 12px; flex-shrink: 0; }

/* ═══════ RESULTS, GAME OVER & CLEAR ═══════ */
.clear-wrap, .go-wrap, .result-wrap { flex: 1; display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; width: 100% !important; padding: 20px !important; gap: 16px !important; overflow-y: auto !important; }
#screenGameOver .screen-content { align-items: center; justify-content: center; padding-top: 80px; }
#screenGameOver .lang-btn { position: absolute; top: 14px; right: 14px; z-index: 9000; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

/* คงเงาให้รูปภาพ user-main-photo */
.user-main-photo { width: 180px; height: auto; border: 4px solid var(--dk); border-radius: 24px; box-shadow: 6px 6px 0 var(--pur); animation: bob 3s ease-in-out infinite; display: block; }
.clear-confetti-row { position: absolute; top: 0; left: 0; right: 0; height: 60px; pointer-events: none; overflow: hidden; display: none !important; }
.clear-burst-emoji { font-size: 60px; animation: burstPop .5s cubic-bezier(.175,.885,.32,1.275); display: none !important; }
.clear-stars { font-size: 28px; letter-spacing: 8px; }

.clear-convo-panel, .clear-stat-card, .go-card, .go-lesson-card, .persona-card, .result-stat-card, .tip-item { width: 100%; background: var(--cream); border: 4px solid var(--dk); box-shadow: none; overflow: hidden; border-radius: 16px; }
.ccp-senior { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 10px; background: var(--lime); border-right: 3px solid var(--dk); min-width: 64px; }
.ccp-avatar { font-size: 36px; } .ccp-nametag { font-size: 11px; color: var(--dk); font-weight: 900; }
.ccp-bubble { flex: 1; padding: 12px 14px; font-family: var(--bfont); font-size: 16px; font-weight: 800; color: var(--dk); line-height: 1.7; background: var(--cream); }

.csc-head, .go-card-head, .pc-top, .tips-header { background: var(--pk); padding: 10px 12px; border-bottom: 3px solid var(--dk); font-size: 12px; color: var(--cream); font-weight: 900; display: flex; align-items: center; gap: 6px; box-shadow: none !important; }
.csc-row, .go-stat-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 2px dashed rgba(0,0,0,.15); font-family: var(--bfont); font-size: 14px; font-weight: 800; color: var(--dk); }
.csc-val, .go-stat-row .ptxt { font-size: 10px; color: var(--pk); }

.go-emoji { font-size: 68px; filter: drop-shadow(4px 4px 0 var(--dk)); } 
.go-title { font-size: 24px !important; color: var(--pk); text-align: center; }
.go-bar { background: var(--pk); border-bottom: 3px solid var(--dk); } .lesson-bar { background: var(--yel); border-bottom: 3px solid var(--dk); color: var(--dk); }
.go-card-body { padding: 16px; }
.go-mom-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }

/* คงเงาให้ user-avatar-photo */
.user-avatar-photo { width: 50px; height: 50px; object-fit: cover; border-radius: 50%; border: 3px solid var(--dk); box-shadow: 2px 2px 0 var(--dk); flex-shrink: 0; }
.go-mom-face { font-size: 44px; flex-shrink: 0; } .go-mom-txt { font-family: var(--bfont); font-size: 15px; font-weight: 800; color: var(--dk); line-height: 1.55; }
.go-lesson-txt { font-family: var(--bfont); font-size: 14px; font-weight: 800; color: var(--dk); line-height: 1.6; }

.pc-body { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px; }
.pc-emo { font-size: 64px; filter: drop-shadow(3px 3px 0 var(--dk)); } .pc-title { font-size: 11px; color: var(--pk); text-shadow: 1px 1px 0 var(--dk); text-align: center; }
.pc-sub { font-family: var(--hfont); font-size: 20px; font-weight: 900; color: var(--dk); text-align: center; }
.pc-desc { font-family: var(--bfont); font-size: 14px; font-weight: 800; color: var(--dk); opacity: .8; text-align: center; line-height: 1.5; }

.tips-section { width: 100%; }
.tips-header {font-weight: 30; background: var(--cream); border: 4px solid var(--dk); box-shadow: none; padding: 10px; margin-bottom: 14px; border-radius: 12px; text-align: center; color: var(--pk); }
.tips-list { display: flex; flex-direction: column; gap: 12px; }
.tip-item { display: flex; box-shadow: none !important; } .tip-icon { width: 44px; background: var(--yel); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; border-right: 3px solid var(--dk); }
.tip-content { padding: 12px 14px; } .tip-title { font-family: var(--hfont); font-size: 15px; font-weight: 900; color: var(--pk); margin-bottom: 4px; }
.tip-body { font-family: var(--bfont); font-size: 13px; font-weight: 800; color: var(--dk); line-height: 1.4; }

/* ═══════ MODALS ═══════ */
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.6); z-index: 8000; display: flex; align-items: center; justify-content: center; padding: 24px; backdrop-filter: blur(8px); }
.modal-box { width: 100%; max-width: 330px; background: var(--cream); border: 4px solid var(--dk); box-shadow: none; overflow: hidden; border-radius: 20px; }
.pop-in { animation: popIn .22s cubic-bezier(.175,.885,.32,1.275); }

.mbox-head { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 3px solid var(--dk); }
.warn-head { background: var(--pk); color: var(--cream); font-weight: 900; } .hint-head { background: var(--lime); color: var(--dk); font-weight: 900; }
.mbox-body { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; }
.mbox-senior-row { display: flex; align-items: center; gap: 8px; }
.mbox-snr-lbl { font-size: 16px !important; letter-spacing: 1px; color: var(--pk); text-shadow: 1px 1px 0 var(--dk); font-weight: 900; }
.mbox-warn-txt, .mbox-hint-txt { font-family: var(--bfont); font-size: 15px; font-weight: 800; color: var(--dk); text-align: center; line-height: 1.5; }
.mbox-price { font-family: var(--pfont); font-size: 16px; color: var(--pk); text-shadow: 2px 2px 0 var(--dk); }
.mbox-btn-row { display: flex; gap: 10px; width: 100%; } .mbox-btn-row .fat-btn { flex: 1; }
.mbox-btn-row .fat-btn { background: var(--cream) !important; color: var(--dk) !important; border: 3px solid var(--dk) !important; transition: background 0.2s ease, transform 0.1s !important; box-shadow: none !important; }
.mbox-btn-row .fat-btn:hover { background: var(--pk) !important; color: var(--cream) !important; }
.mbox-hint-ico { font-size: 46px; filter: drop-shadow(3px 3px 0 var(--dk)); } .mbox-fb-ico { font-size: 50px; filter: drop-shadow(3px 3px 0 var(--dk)); }
.mbox-fb-head { font-size: 10px; color: var(--dk); text-align: center; line-height: 1.6; margin-bottom: 4px; font-weight: 900; }
.mbox-fb-exp { font-family: var(--bfont); font-size: 14px; font-weight: 800; color: var(--dk); text-align: center; line-height: 1.5; }

/* ═══════ SCROLLBAR ═══════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--yel); border-radius: 3px; border: 1px solid var(--dk); }

/* ═══════ STAGE CLEAR (สไตล์ Y2K) ═══════ */
.pixel-reward-box { background: var(--cream) !important; border: 4px solid var(--dk); border-radius: 20px; padding: 45px 20px 20px; width: 100%; max-width: 320px; position: relative; box-shadow: none !important; display: flex; flex-direction: column; align-items: center; margin-top: 30px; }
.pixel-ribbon { position: absolute; top: -24px; background: var(--pk) !important; border: 4px solid var(--dk) !important; padding: 8px 24px; color: var(--cream); font-family: var(--hfont), sans-serif; font-size: 26px; font-weight: 900; letter-spacing: 1px; text-shadow: 2px 2px 0 var(--dk); box-shadow: none; white-space: nowrap; z-index: 10; border-radius: 12px; }
.pixel-stars-row { display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 20px; }
.img-star { width: 65px; height: 65px; object-fit: contain; filter: drop-shadow(3px 3px 0 var(--dk)); transition: filter 0.3s; }
.star-mid { transform: translateY(-15px) scale(1.15); }
.star-off { filter: grayscale(100%) brightness(0.9) drop-shadow(3px 3px 0 var(--dk)) opacity(0.5); }
.img-star:not(.star-off) { filter: drop-shadow(4px 4px 0 var(--dk)) brightness(1.1) saturate(1.3) !important; }
.pixel-score-board { background: var(--lime) !important; border: 4px solid var(--dk) !important; border-radius: 12px; padding: 12px 16px; width: 100%; margin-bottom: 15px; }
.psb-row { display: flex; justify-content: space-between; align-items: center; color: var(--dk); font-family: var(--bfont); font-weight: 900; font-size: 15px; margin-bottom: 8px; }
.psb-row:last-child { margin-bottom: 0; }
.psb-row .ptxt { color: var(--pk); text-shadow: 1px 1px 0 var(--cream); font-size: 18px; }
.px-btn { background: var(--yel) !important; color: var(--dk) !important; border: 4px solid var(--dk) !important; box-shadow: none !important; }

/* ═══════ อัปเดตหน้า RESULT ═══════ */
.result-wrap { flex: 1 1 100% !important; width: 100% !important; height: 100% !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch !important; display: block !important; padding-top: 120px !important; padding-bottom: 80px !important; overflow: visible !important; }
.result-wrap > * { flex-shrink: 0 !important; margin-left: auto !important; margin-right: auto !important; margin-bottom: 20px !important; max-width: 320px !important; }
#screenResult.active { display: block !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch !important; }
.share-area { width: 100%; display: flex; flex-direction: column; gap: 16px; background: var(--pk); padding: 16px; border-radius: 20px; border: 4px solid var(--dk); box-shadow: none; }
.share-area, .tips-container { max-width: 300px !important; margin-left: auto !important; margin-right: auto !important; }

/* ปุ่มเซฟรูปและปุ่มกึ่งกลาง */
#screenResult .fat-btn, .result-wrap > button.fat-btn { margin-left: auto !important; margin-right: auto !important; color: var(--dk) !important; width: 220px !important; display: flex !important; justify-content: center !important; }
.save-btn, #screenResult .save-btn { background: var(--yel) !important; border: 4px solid var(--dk) !important; margin-top: 30px !important; margin-bottom: 30px !important; box-shadow: none !important; }
.save-btn:hover { background: var(--cream) !important; }
.result-wrap > button.g-btn, #screenResult .g-btn { margin-top: 35px !important; margin-bottom: 40px !important; }

.result-title-container { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 20px; width: 100%; }
.result-header-icon { width: 90px; height: auto; filter: drop-shadow(4px 4px 0 var(--dk)); animation: resultIconPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both; }
.result-title { font-size: 32px !important; letter-spacing: 2px; }
@keyframes resultTextBob { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-8px) scale(1.05); } }
.result-title span { display: inline-block; animation: resultTextBob 2s ease-in-out infinite; }
@keyframes resultIconPop { from { opacity: 0; transform: scale(0.5) rotate(-15deg); } to { opacity: 1; transform: scale(1) rotate(0deg); } }

/* ═══════ อัปเดตกล่องชื่อเกม (Custom Title Box) สไตล์ Y2K ═══════ */
/* ค้นหาโค้ดส่วนนี้ในไฟล์ของคุณ */
.custom-title-box { 
    background: var(--cream) !important; 
    border: 4px solid var(--dk) !important; 
    border-radius: 30px !important; 
    /* 👇 แก้ไข padding (ระยะขอบด้านใน) ตรงนี้ให้เล็กลง */
    padding: 35px 10px 15px !important; /* เดิม 35px 10px 25px ลดลงเพื่อไม่ให้กล่องดูใหญ่เกิน */
    position: relative; 
    box-shadow: none !important; 
    text-align: center; 
    margin-top: 8px; 
    overflow: visible !important; 
    z-index: 5; 
    /* 👇 เพิ่ม max-width เข้าไปเพื่อบีบขนาดกล่องไม่ให้กว้างเกินไป */
    max-width: 280px !important; /* ปรับขนาดตัวเลขนี้ได้ตามต้องการ (ค่ายิ่งน้อย กล่องยิ่งแคบ) */
    margin-left: auto !important; /* เพื่อให้กล่องอยู่กึ่งกลาง */
    margin-right: auto !important; /* เพื่อให้กล่องอยู่กึ่งกลาง */
}
.ctb-notch { position: absolute; top: -4px; left: 50%; transform: translateX(-50%); width: 70px; height: 12px; background: var(--cream); border: 4px solid var(--dk); border-top: none; border-radius: 0 0 8px 8px; }
.ctb-line-1 { font-family: var(--pfont); font-size: 22px; color: var(--yel); text-shadow: -2px -2px 0 var(--dk), 2px -2px 0 var(--dk), -2px 2px 0 var(--dk), 2px 2px 0 var(--dk), 0px 4px 0 var(--pk); margin-bottom: 8px; display: flex; justify-content: center; gap: 1px; }
.ctb-line-2 { font-family: var(--pfont); font-size: 20px; color: var(--lime); text-shadow: -2px -2px 0 var(--dk), 2px -2px 0 var(--dk), -2px 2px 0 var(--dk), 2px 2px 0 var(--dk), 0px 4px 0 var(--dk); margin-bottom: 18px; display: flex; justify-content: center; gap: 1px; }
/* ค้นหาโค้ดส่วนนี้ */
.ctb-line-3 { 
    font-family: 'Kanit', sans-serif; 
    /* 👇 เปลี่ยนขนาดฟอนต์ให้เล็กลง */
    font-size: 18px; /* เดิม 24px ลองปรับลดลง */
    font-weight: 900; 
    color: var(--pk); 
    text-shadow: -2px -2px 0 #FFF, 2px -2px 0 #FFF, -2px 2px 0 #FFF, 2px 2px 0 #FFF, 4px 4px 0 var(--pur); 
    margin-bottom: 12px; 
    transform: rotate(-2deg); 
}
/* ค้นหาโค้ดส่วนนี้ */
.ctb-subtitle { 
    font-family: var(--bfont); 
    /* 👇 เปลี่ยนขนาดฟอนต์ให้เล็กลง */
    font-size: 11px; /* เดิม 13px ลดลงเพื่อให้ดูพอดีกับกล่องที่แคบลง */
    font-weight: 900; 
    color: var(--dk); 
    letter-spacing: 0.5px; 
    opacity: 1; 
}

@keyframes letterBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.v-letter, .v-letter-blue { display: inline-block; animation: letterBob 1.5s ease-in-out infinite; }
.v-letter:nth-child(1) { animation-delay: 0.0s; } .v-letter:nth-child(2) { animation-delay: 0.1s; } .v-letter:nth-child(3) { animation-delay: 0.2s; } .v-letter:nth-child(4) { animation-delay: 0.3s; } .v-letter:nth-child(5) { animation-delay: 0.4s; } .v-letter:nth-child(6) { animation-delay: 0.5s; }
.v-letter-blue:nth-child(1) { animation-delay: 0.6s; } .v-letter-blue:nth-child(2) { animation-delay: 0.7s; } .v-letter-blue:nth-child(3) { animation-delay: 0.8s; } .v-letter-blue:nth-child(4) { animation-delay: 0.9s; } .v-letter-blue:nth-child(5) { animation-delay: 1.0s; } .v-letter-blue:nth-child(6) { animation-delay: 1.1s; } .v-letter-blue:nth-child(7) { animation-delay: 1.2s; }

.ctb-deco { position: absolute; filter: drop-shadow(3px 3px 0 var(--dk)); animation: decoFloat 3s ease-in-out infinite; z-index: 10; font-size: 32px; }
@keyframes decoFloat { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-8px) rotate(15deg); } }
.deco-1 { top: -20px; left: -15px; animation-delay: 0s; } .deco-2 { bottom: 20px; left: -20px; animation-delay: 0.5s; transform: rotate(-20deg); } .deco-3 { top: -15px; right: -15px; animation-delay: 1s; } .deco-4 { bottom: -15px; right: -15px; animation-delay: 1.5s; transform: rotate(20deg); }

/* ═══════ ปรับหน้า Intro ═══════ */
.intro-compact { padding: 20px 10px 10px !important; justify-content: flex-start !important; gap: -3px !important; }
.intro-coin-img { width: 280px !important; height: 280px !important; object-fit: contain; filter: drop-shadow(4px 4px 0px var(--dk));margin-bottom: -60px; }
.lock-clock { font-size: 30px !important; margin-bottom: 4px; }
.compact-title { margin-top: 0 !important; padding: 25px 10px 15px !important; transform: scale(1.0) !important; transform-origin: center top !important; margin-bottom: -10px !important; }
.lock-notifications { flex: none !important; gap: 8px !important; }
.compact-noti { padding: 12px 14px !important; border-radius: 16px !important; }
.compact-noti .noti-header { margin-bottom: 4px !important; padding-bottom: 4px !important; }
.compact-noti .noti-app { font-size: 13px !important; }
.compact-noti .noti-time { font-size: 11px !important; opacity: 0.8; }
.compact-noti .noti-desc { font-size: 13px !important; line-height: 1.4 !important; opacity: 0.9; }
.compact-noti .rule-item { margin-top: 2px !important; }
.noti-gif-icon { width: 22px !important; height: 22px !important; border-radius: 4px; vertical-align: middle; filter: drop-shadow(2px 2px 0px var(--dk)); }
.compact-slide { height: 56px !important; border-radius: 28px !important; margin-top: auto !important; }
.compact-slide .slide-text { line-height: 48px !important; font-size: 10px !important; color: var(--dk) !important;}
.compact-slide .slide-thumb { width: 48px !important; height: 48px !important; border-radius: 24px !important; top: 2px !important; left: 3px !important; background: var(--yel) !important;}

/* ═══════════════════════════════════════════════════
   PIXEL STAR INTERACTION & CURSOR (ADDED)
═══════════════════════════════════════════════════ */
.pixel-star-interact {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 4px #8BEA20) drop-shadow(0 0 12px rgba(139, 234, 32, 0.9));
  animation: pixelStarPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes pixelStarPop {
  0% { transform: scale(0) rotate(0deg); opacity: 0; }
  25% { transform: scale(1.5) rotate(-15deg); opacity: 1; }
  100% { transform: scale(0.5) rotate(30deg) translateY(-50px); opacity: 0; }
}

button, .slide-thumb, .char-card, .act-btn {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><rect x="8" y="0" width="4" height="4" fill="%238BEA20"/></svg>'), auto;
}

/* ═══════════════════════════════════════════════════
   CUSTOM PICTURE IN TITLE BOX (ADDED)
═══════════════════════════════════════════════════ */
.my-custom-pic {
  width: 45px;
  height: 45px;
  object-fit: cover;
  border-radius: 50%;
}

.ctb-deco::before {
  display: none !important;
}

.chat-avatar-style {
    width: 40px;          /* ขนาดความกว้าง */
    height: 40px;         /* ขนาดความสูง */
    border-radius: 50%;   /* ทำให้เป็นวงกลม */
    object-fit: cover;    /* ทำให้รูปไม่เบี้ยวเวลาอยู่ในวงกลม */
    border: 2px solid #fff; /* ขอบสีขาวนิดๆ ให้ดูป๊อปขึ้นมา */
    background-color: #f0f0f0; /* สีพื้นหลังเผื่อรูปโหลดไม่ขึ้น */
}

/* แอนิเมชันลอยขึ้น-ลง ให้ตัวละคร */
.char-image-display {
    animation: floatAnim 3s ease-in-out infinite;
}

@keyframes floatAnim {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

/* ลบเงาส่วนเกินที่อาจจะค้างอยู่ด้วย filter ออกทั้งหมด ยกเว้นรูปภาพ */
.modal-box, .char-card, .chat-bubble, .swipe-card, button {
    filter: drop-shadow(0 0 0 transparent) !important;
}

/* =========================================
   ปรับสัดส่วน UI หน้า STAGE CLEAR 
========================================= */

/* --- 1. ขยายขนาดดาวทั้ง 3 ดวงให้ใหญ่ขึ้น --- */
.img-star { 
    width: 85px !important;  /* เพิ่มจากเดิม 65px */
    height: 85px !important; 
}
.star-mid { 
    transform: translateY(-20px) scale(1.2) !important; /* ดันดาวตรงกลางให้ลอยและใหญ่ขึ้นอีกนิด */
}
.pixel-stars-row {
    gap: 22px !important; /* เพิ่มช่องไฟระหว่างดาวไม่ให้เบียดกันเกินไป */
    margin-bottom: 25px !important;
}

/* --- 2. ลดขนาดกรอบพูดคุยของพี่รหัส --- */
.clear-convo-panel {
    width: 75% !important; /* บีบความกว้างของกรอบให้แคบลงเหลือ 85% */
    margin: 0 auto 15px auto !important; /* ดันให้อยู่กึ่งกลางหน้าจอ */
}
.ccp-senior {
    padding: 8px !important; /* ลดระยะขอบฝั่งซ้าย (ฝั่งรูปโปรไฟล์) */
    min-width: 50px !important;
}
.ccp-avatar {
    width: 40px !important;  /* ย่อรูปโปรไฟล์รุ่นพี่ลง */
    height: 40px !important;
    font-size: 26px !important; /* เผื่อใช้เป็นอิโมจิ */
}
.ccp-bubble {
    font-size: 13.5px !important; /* ย่อขนาดตัวอักษรลง (จาก 16px) */
    padding: 10px !important;
    line-height: 1.5 !important;
}

/* --- 3. ขยายขนาดกรอบสรุปผล (ตอบผิด/ถูก/คำใบ้) --- */
.pixel-score-board, .clear-stat-card {
    padding: 18px 24px !important; /* ขยายกรอบให้พองขึ้น */
}
.psb-row, .csc-row {
    font-size: 17px !important; /* ขยายขนาดฟอนต์คำว่า ตอบถูก/ตอบผิด/ใช้คำใบ้ */
    margin-bottom: 12px !important; /* เพิ่มระยะห่างบรรทัดให้อ่านง่าย */
}
.psb-row:last-child {
    margin-bottom: 0 !important;
}
.psb-row .ptxt, .csc-val {
    font-size: 24px !important; /* ขยายขนาด "ตัวเลข" ผลลัพธ์ให้ใหญ่เบิ้มสะใจ (จาก 18px) */
    font-weight: 900 !important;
}

/* =========================================
   เปลี่ยนสีพื้นหลังและปุ่ม หน้า STAGE CLEAR 
========================================= */

/* --- 1. เปลี่ยนสีกรอบคุยของพี่รหัสเป็นสีขาว --- */
.clear-convo-panel, 
.ccp-senior {
    background-color: #B400FF !important; 
}

/* --- 2. เปลี่ยนสีกรอบสรุปช้อยส์ (ผิด/ถูก/คำใบ้) เป็นสีขาว --- */
.pixel-score-board, 
.clear-stat-card {
    background-color: #FFFFFF !important; 
}

/* --- 3. เปลี่ยนสีปุ่ม "ด่านต่อไป / ดูผลลัพธ์" เป็นสีเขียว --- */
#btnNextStage, 
.px-btn {
    background-color: #8BEA20 !important; /* สีเขียวสว่างแบบเกม Pixel */
    color: #111111 !important; /* ตัวอักษรสีดำเพื่อให้ตัดกับปุ่มและอ่านง่าย */
    border: 4px solid #111111 !important;
}

/* เอฟเฟกต์ตอนกดปุ่มสีเขียว */
#btnNextStage:active, 
.px-btn:active {
    background-color: #7AD11C !important; /* สีเขียวเข้มขึ้นนิดนึงตอนโดนกด */
}

.ccp-nametag {
    color: #FFFFFF !important; 
}

/* =========================================
   ปรับขนาดรูปภาพในหน้าปัดการ์ด (STAGES)
========================================= */

/* 1. ขยายความสูงของกล่องที่ครอบรูปภาพไว้ */
.card-emo-zone {
    height: 200px !important; /* เดิม 160px ลองเพิ่มเป็น 200px หรือมากกว่านั้นถ้าต้องการพื้นที่เพิ่ม */
}

/* 2. ขยายขนาดตัวรูปภาพด้านใน */
.card-emo-zone img {
    max-width: 160px !important;  /* เดิม 110px ขยายให้ใหญ่ขึ้น */
    max-height: 160px !important; /* เดิม 110px ขยายให้ใหญ่ขึ้น */
}

/* =========================================
   เปลี่ยนพื้นหลังรูปการ์ด (ลบลายเส้นทแยงมุมออก เปลี่ยนเป็นสีชมพู Gradient)
========================================= */

.card-emo-zone {
    /* ลบเส้นทแยงมุมออก และใส่ Gradient สีชมพูไล่สีแทน */
    background: linear-gradient(135deg, #FF99CC 0%, #FF4DA6 100%) !important;
}

/* =========================================
   แก้ไขรูป Game Over สไตล์ 16-bit Pixel Art
========================================= */
.user-main-photo {
    border: none !important;          /* ปิดเส้นขอบธรรมดาทิ้งไปเลย */
    border-radius: 0px !important;    /* ปิดความโค้งมนทั้งหมด */
    image-rendering: pixelated !important; 
    
    /* 👇 หัวใจหลักของ Pixel Border: ใช้การสร้างเงาสีขาวและดำซ้อนกันเพื่อวาดเป็นรอยหยักพิกเซล */
    box-shadow: 
        /* ชั้นใน: ขอบสีสว่างเพื่อให้ดูมีมิติ 3D นูนขึ้นมา */
        0 -4px 0 #fff, 
        0 4px 0 #fff, 
        -4px 0 0 #fff, 
        4px 0 0 #fff,
        /* ชั้นนอกสุด: เส้นขอบสีดำที่ถูกหั่นมุมให้เป็นรอยหยัก (Pixelated) */
        0 -8px 0 var(--dk), 
        0 8px 0 var(--dk), 
        -8px 0 0 var(--dk), 
        8px 0 0 var(--dk), 
        -4px -4px 0 var(--dk), 
        4px -4px 0 var(--dk), 
        -4px 4px 0 var(--dk), 
        4px 4px 0 var(--dk) !important;
        
    margin: 15px auto 25px auto !important; /* เว้นระยะห่างให้ขอบพิกเซลไม่ไปชนส่วนอื่น */
}

/* =========================================
   หน้าคุณแม่ใหญ่สะใจ + กรอบ Pixel
========================================= */
.user-avatar-photo {
    border: none !important;
    border-radius: 0px !important;    /* เปลี่ยนรูปโปรไฟล์แม่ให้เป็นทรงเหลี่ยม */
    image-rendering: pixelated !important;
    background-color: #fff;           /* ใส่พื้นหลังสีขาวเผื่อรูปแม่เป็นไฟล์โปร่งใส */
    
    /* สร้างขอบพิกเซลบางๆ ให้หน้าแม่ 1 ชั้น */
    box-shadow: 
        0 -3px 0 var(--dk), 
        0 3px 0 var(--dk), 
        -3px 0 0 var(--dk), 
        3px 0 0 var(--dk) !important;

    /* 👇 เทคนิคขยายภาพโดยไม่กระทบ Layout */
    transform: scale(1.6) translate(4px, 4px) !important; /* ขยายใหญ่ 60% และดันขยับลงมานิดนึงให้ดูเด่น */
    transform-origin: top left !important; /* ยึดมุมซ้ายบนเป็นหลักเวลาขยาย */
    
    position: relative;
    z-index: 10 !important;           /* ให้หน้าแม่ลอยอยู่ชั้นบนสุด */
    margin-right: 25px !important;    /* สั่งเว้นระยะด้านขวาหลอกๆ ไว้ ไม่ให้หน้าแม่ที่โดนขยายไปทับตัวอักษร */
    margin-bottom: 15px !important;
}

/* =========================================
   หน้าคุณแม่ (ไม่มีกรอบ ใหญ่ขึ้น และไม่ทับข้อความ)
========================================= */
.user-avatar-photo {
    /* 1. ขยายขนาดจริงของพื้นที่รูปเลย (ดันตัวหนังสือไปเองอัตโนมัติ) */
    width: 90px !important;           /* ปรับตัวเลขตรงนี้ให้ใหญ่/เล็กได้ตามต้องการ (เดิม 50px) */
    height: 90px !important;          
    flex-shrink: 0 !important;        /* บังคับไม่ให้รูปโดนข้อความบีบให้เล็กลง */
    
    /* 2. ลบกรอบและเงาออกทั้งหมด */
    border: none !important;          
    box-shadow: none !important;      
    border-radius: 0px !important;    /* ปิดความโค้งมน */
    background: transparent !important;
    
    /* 3. ล้างค่า transform ของเก่าทิ้ง (ตัวการที่ทำให้ภาพทับตัวหนังสือ) */
    transform: none !important;       
    
    image-rendering: pixelated !important; 
    margin-right: 12px !important;    /* เว้นระยะช่องว่างระหว่างหน้าแม่กับข้อความนิดนึง */
}

/* =========================================
   รูป Game Over (กรอบเหลี่ยม + เงาดำด้านขวาล่าง)
========================================= */
.user-main-photo {
    border: 4px solid var(--dk) !important;     /* เส้นขอบสีดำรอบรูป */
    border-radius: 0px !important;              /* เปลี่ยนเป็นขอบเหลี่ยม พิกเซลอาร์ต */
    image-rendering: pixelated !important; 
    
    /* 👇 เงาดำทึบตกกระทบไปทางขวาล่าง (ปรับตัวเลข 8px ให้กว้าง/แคบได้ตามใจชอบ) */
    box-shadow: 8px 8px 0 var(--dk) !important; 
    
    margin: 15px auto 25px auto !important;     /* จัดกึ่งกลาง และเว้นระยะเงาไม่ให้ชนขอบล่าง */
}

/* =========================================
   retro-alert-box (กรอบเหลี่ยม + เงา Checkerboard พิกเซล)
   สำหรับกล่องข้อความหน้า GAME OVER
========================================= */
.user-main-photo {
    position: relative;          /* จำเป็นสำหรับ Pseudo-elements */
    border: none !important;
    border-radius: 0px !important;
    image-rendering: pixelated !important;
    background-color: var(--cream);
    color: var(--dk);
    padding: 20px;
    
    /* 1. วาดเส้นขอบนอกสุดเป็นรอยหยักพิกเซล (Stepped Borders) */
    box-shadow: 
        /* ชั้นใน: ขอบสีสว่างเพื่อให้ดูมีมิติ 3D นูนขึ้นมา */
        0 -4px 0 #fff, 
        0 4px 0 #fff, 
        -4px 0 0 #fff, 
        4px 0 0 #fff,
        /* ชั้นนอกสุด: เส้นขอบสีดำที่ถูกหั่นมุมให้เป็นรอยหยัก */
        0 -8px 0 var(--dk), 
        0 8px 0 var(--dk), 
        -8px 0 0 var(--dk), 
        8px 0 0 var(--dk), 
        -4px -4px 0 var(--dk), 
        4px -4px 0 var(--dk), 
        -4px 4px 0 var(--dk), 
        4px 4px 0 var(--dk) !important;
    
    margin: 10px auto 10px auto !important;
    z-index: 5;
}

/* 2. สร้างเงาลายตารางหมากรุก (Alternating White/Black) ตกกระทบไปทางขวาล่าง */
.user-main-photo::after {
    content: '';
    position: absolute;
    z-index: -1;          /* ให้เงาลอยอยู่ชั้นล่างสุด */
    top: 8px;            /* ผลักเงาไปทางขวาล่าง 8px */
    left: 8px;
    width: 100%;
    height: 100%;
    
    /* 👇 หัวใจหลักของลายตารางหมากรุก (True Checkerboard Pattern) ด้วย linear-gradient 👇 */
    background-color: #fff; /* พื้นหลังเงาสีขาว */
    background-image: 
        linear-gradient(45deg, black 25%, transparent 25%), 
        linear-gradient(-45deg, black 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, black 75%), 
        linear-gradient(-45deg, transparent 75%, black 75%);
    background-size: 8px 8px; /* ขนาดตาราง (ยิ่งเล็กยิ่งดูพิกเซล) */
    background-position: 0 0, 0 4px, 4px -4px, -4px 0px; /* จัดตำแหน่งตารางให้สลับกัน */
    
    /* วาดขอบนอกของเงาให้เป็นรอยหยักด้วย */
    box-shadow: 
        0 -4px 0 var(--dk), 
        0 4px 0 var(--dk), 
        -4px 0 0 var(--dk), 
        4px 0 0 var(--dk),
        -4px -4px 0 var(--dk), 
        4px -4px 0 var(--dk), 
        -4px 4px 0 var(--dk), 
        4px 4px 0 var(--dk) !important;
    
    border-radius: 0px !important;
}

/* =========================================
   รูป Game Over (กรอบเหลี่ยม + เงาดำทึบด้านขวาล่าง แบบออริจินัล)
========================================= */
.user-main-photo {
    border: 4px solid var(--dk) !important;     /* เส้นขอบสีดำรอบรูป */
    border-radius: 0px !important;              /* เปลี่ยนเป็นขอบเหลี่ยม */
    image-rendering: pixelated !important; 
    
    /* 👇 เงาดำทึบตกกระทบไปทางขวาล่างแบบคลีนๆ */
    box-shadow: 8px 8px 0 var(--dk) !important; 
    
    margin: 7px auto 8px auto !important;     /* จัดกึ่งกลาง และเว้นระยะเงา */
}

/* =========================================
   รูป Game Over (กรอบเหลี่ยม + เงาดำทึบด้านขวาล่าง แบบออริจินัล)
========================================= */
.user-main-photo {
    border: 4px solid var(--dk) !important;     /* เส้นขอบสีดำรอบรูป */
    border-radius: 0px !important;              /* เปลี่ยนเป็นขอบเหลี่ยม */
    image-rendering: pixelated !important; 
    
    /* 👇 เงาดำทึบตกกระทบไปทางขวาล่างแบบคลีนๆ */
    box-shadow: 8px 8px 0 var(--dk) !important; 
    
    margin: 15px auto 25px auto !important;     /* จัดกึ่งกลาง และเว้นระยะเงา */
}
/* =========================================
   1. แก้ปัญหาไอคอนลอยกองอยู่ด้านบน (พื้นหลัง Intro & Result)
========================================= */
.fc-item { 
    position: absolute; 
    bottom: -50px; /* บังคับให้จุดเริ่มต้นซ่อนอยู่ใต้ขอบจอด้านล่าง */
    font-size: 18px; 
    opacity: 0.25; 
    animation: fcFloat linear infinite; 
    filter: drop-shadow(0 0 4px rgba(255,255,255,.6)); 
    will-change: transform; 
    image-rendering: pixelated; 
}

@keyframes fcFloat { 
    0% { transform: translateY(0) rotate(0deg); } 
    /* ดันขึ้นไป -1000px ซึ่งรับรองว่าทะลุความสูงจอมือถือ (844px) ขึ้นไปเนียนๆ แน่นอน */
    100% { transform: translateY(-1000px) rotate(360deg); } 
}

/* =========================================
   2. แก้เผื่อรูปในหน้าแชท (Chat Background) กองอยู่ด้านบนเหมือนกัน
========================================= */
.chat-float-icon { 
    position: absolute; 
    bottom: -50px; /* เริ่มจากใต้จอเหมือนกัน */
    opacity: 0.4; 
    animation: chatFloatUp linear infinite; 
    will-change: transform; 
    filter: drop-shadow(2px 2px 0 var(--cream)); 
    image-rendering: pixelated !important; 
}

@keyframes chatFloatUp {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-1000px) rotate(360deg); }
}