﻿@charset "utf-8";
/* =========================
   1) ฟอนต์ & รีเซ็ตพื้นฐาน
   ========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 18px;
}

body {
  /* ---- อัปเดตฟอนต์ใหม่ ---- */
  font-family: 'Itim', system-ui, -apple-system, sans-serif;
  margin: 0;
  min-height: 100vh;
  color: #5D4037;

  /* ---- พื้นหลัง ---- */
  background-image: url('../images/background.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}


/* =========================
   2) กล่องเกมกลางหน้า
   ========================= */
.game-container {
  width: 92vw;
  max-width: 900px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 32px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1), 0 5px 10px rgba(0,0,0,0.05);
  padding: 32px 40px;
  text-align: center;
  overflow: hidden;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.4);
}

h1 {
  font-family: 'Itim', sans-serif;
  color: #ff80ab;
  margin: 0 0 10px;
  font-size: 2.8rem;
  line-height: 1.2;
  text-shadow: 2px 2px 0 #fff, 4px 4px 0 rgba(255,128,171,0.3);
}

.small-note,
.progress-text {
  color: #a1887f;
  font-size: 1rem;
  margin-top: 2px;
}

/* =========================
   3) โซนตัวละคร/คำถาม
   ========================= */
.customer {
  margin-top: 12px;
}

.customer img {
  max-width: 250px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 14px;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,0.15));
  transition: transform 0.3s ease-in-out;
}
.customer img:hover {
  transform: scale(1.05) rotate(-2deg);
}

.question-box {
  background: #fff;
  border: 3px solid #ffd180;
  padding: 18px 20px;
  border-radius: 20px;
  font-size: 1.5rem;
  color: #5D4037;
  margin: 0 auto 24px;
  line-height: 1.5;
  box-shadow: 0 4px 0 #ffab40;
}

/* =========================
   4) ฟอร์ม (ช่องกรอกชื่อ / คำตอบ)
   ========================= */
.form-group {
  margin-top: 24px;
}

.game-container input[type="text"],
.game-container input[type="number"] {
  padding: 12px 16px;
  font-size: 1.25rem;
  border: 3px solid #ccc;
  border-radius: 16px;
  width: 280px;
  max-width: 100%;
  text-align: center;
  transition: all .2s;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
  font-family: 'Itim', sans-serif;
}

.game-container input[type="number"] {
  width: 160px;
}

.game-container input:focus {
  outline: none;
  border-color: #ff80ab;
  box-shadow: 0 0 0 4px rgba(255,128,171,0.25);
}

/* =========================
   5) ปุ่ม (โฉมใหม่)
   ========================= */
button {
  padding: 14px 28px;
  font-size: 1.3rem;
  font-family: 'Itim', sans-serif;
  color: #5D4037;
  background: #a5d6a7;
  border: none;
  border-radius: 16px;
  border-bottom: 5px solid #66bb6a;
  cursor: pointer;
  transition: all 0.15s ease-out;
  margin-top: 16px;
}

button:hover {
  background: #9ccc65;
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(102,187,106,0.3);
}

button:active {
  transform: translateY(1px);
  border-bottom-width: 2px;
  box-shadow: none;
}

.btn-logout {
  background: #bdbdbd;
  border-bottom-color: #757575;
}
.btn-logout:hover {
  background: #9e9e9e;
  box-shadow: 0 8px 18px rgba(117,117,117,0.2);
}

/* =========================
   6) หน้าผลลัพธ์
   ========================= */
.result-container h1 { font-size: 2.2rem; }
.result-container h1.correct { color: #66bb6a; text-shadow: 2px 2px 0 #fff; }
.result-container h1.incorrect { color: #ef5350; text-shadow: 2px 2px 0 #fff; }

.result-container p {
    font-size: 1.2rem;
    margin: 6px 0 10px;
}

.result-container .btn-next {
  background: #81d4fa;
  border-bottom-color: #29b6f6;
}
.result-container .btn-next:hover {
  background: #4fc3f7;
  box-shadow: 0 8px 18px rgba(41,182,246,0.25);
}

/* =========================
   7) Layout หน้าแรก และส่วนท้าย
   ========================= */
.main-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.credits {
  margin-top: 24px;
  padding: 10px 24px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  backdrop-filter: blur(5px);
  max-width: 500px;
  
  font-size: 0.95rem;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  text-align: center;
}

/* =========================
   8) สไตล์สำหรับฟีเจอร์ใหม่
   ========================= */
/* 1. สไตล์สำหรับแถบแสดงท็อปปิ้ง */
.topping-bar {
  background: rgba(0,0,0,0.05);
  border-radius: 99px;
  padding: 8px;
  margin: -10px auto 20px;
  min-height: 56px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 80%;
}
.topping-bar img {
  width: 40px;
  height: 40px;
}
.topping-bar.summary img {
  width: 50px;
  height: 50px;
}
.final-ice-cream {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 2px dashed #ddd;
}
.final-ice-cream h3 {
  margin: 0 0 12px;
  color: #a1887f;
}

/* 2. สไตล์สำหรับมาสคอตคุณลุงหมี */
.bear-owner-ui {
  position: fixed;
  bottom: 0;
  left: 20px;
  width: 160px;
  height: auto;
  z-index: 10;
  pointer-events: none;
  animation: bobbing-bear 3s ease-in-out infinite;
}

@keyframes bobbing-bear {
  0%, 100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-15px) rotate(2deg);
  }
}

/* =========================
   9) ตอบสนองหน้าจอเล็ก
   ========================= */
@media (max-width: 600px) {
  html { font-size: 17px; }
  .game-container { padding: 22px 18px; }
  .customer img { max-width: 180px; }
  .question-box { font-size: 1.2rem; padding: 14px 16px; }
  button { width: 100%; margin: 10px 0 0; }
  .credits { max-width: 90%; }
  .bear-owner-ui {
    width: 120px;
    left: 5px;
  }
}