/* app.css — โทนฟ้าขาว Aurora Minimal */

/* ================== RESET & ROOT ================== */
*,
*::before,
*::after{
  box-sizing:border-box;
}

:root{
  --bg:#eff6ff;              /* ฟ้าอ่อนทั้งหน้า */
  --card:#ffffff;
  --border:#e5e7eb;
  --accent:#3b82f6;          /* ฟ้านีออนหลัก */
  --accent-soft:#dbeafe;
  --accent2:#2563eb;         /* ฟ้าเข้มใช้กับตัวเลข/ปุ่ม */
  --text-main:#0f172a;
  --text-soft:#6b7280;
  --danger:#ef4444;
  --success:#16a34a;
  --radius-lg:18px;
  --radius-md:12px;
  --shadow-soft:0 18px 40px rgba(15,23,42,0.12);
}

html,body{
  margin:0;
  padding:0;
  min-height:100%;
  background:
    radial-gradient(circle at 0% 0%,#e0f2fe 0,#eff6ff 30%,transparent 60%),
    radial-gradient(circle at 100% 0%,#e0e7ff 0,#eff6ff 35%,transparent 65%),
    linear-gradient(to bottom,#eff6ff,#e5e7eb);
  color:var(--text-main);
  font-family:"Kanit",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

/* ================== TOP BAR (ใช้กับ nav ใหม่) ================== */
.topbar{
  position:sticky;
  top:0;
  z-index:30;
  backdrop-filter:blur(14px);
  background:linear-gradient(to right,rgba(255,255,255,0.98),rgba(219,234,254,0.96));
  border-bottom:1px solid rgba(59,130,246,0.25);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 18px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
}
.brand-logo{
  width:34px;
  height:34px;
  border-radius:999px;
  background:radial-gradient(circle at 30% 20%,#6366f1,#0ea5e9);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-size:18px;
  box-shadow:0 0 14px rgba(59,130,246,0.75);
}
.brand-title{
  font-weight:600;
  font-size:15px;
}
.brand-tagline{
  font-size:12px;
  color:var(--text-soft);
}
/* ================== WHEEL (SPINZ STYLE) ================== */
.wheel-wrap{
  margin:28px auto 18px;
  width:320px;
  height:320px;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* pointer สามเหลี่ยมหัวชี้ลง */
.wheel-pointer{
  position:absolute;
  top:-22px;
  left:50%;
  transform:translateX(-50%);
  width:0;
  height:0;
  border-left:14px solid transparent;
  border-right:14px solid transparent;
  border-top:26px solid #f97316;
  filter:drop-shadow(0 2px 4px rgba(0,0,0,0.4));
  z-index:5;
}

/* วงล้อ */
.wheel-body{
  position:relative;
  width:320px;
  height:320px;
  border-radius:50%;
  border:10px solid #facc15;   /* เปลี่ยนสีขอบได้ตรงนี้ */
  background:#020617;
  overflow:hidden;
  box-shadow:0 15px 40px rgba(15,23,42,0.65);
}

/* กลุ่ม segment ทั้งก้อน */
#wheel-segments{
  position:absolute;
  inset:0;
  transform-origin:50% 50%;
  display:block; /* กัน flex เก่ามาแทรก */
}

/* segment = เต็มวงหมุนรอบกลาง */
.wheel-segment{
  position:absolute;
  inset:0;
  transform-origin:50% 50%;
}

/* กล่องของรางวัลในแต่ละช่อง: วางไว้กลางวงก่อน แล้วค่อยดันออกตามรัศมี */
.wheel-seg-inner{
  position:absolute;
  top:50%;
  left:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  transform-origin:50% 50%;
}

/* รูปรางวัลในวงล้อให้เป็นวงกลม */
.wheel-seg-img{
  width:72px;
  height:72px;
  border-radius:50%;
  object-fit:cover;
  border:3px solid rgba(15,23,42,0.85);
  box-shadow:0 0 0 3px #0f172a, 0 6px 12px rgba(0,0,0,0.6);
}

/* ถ้ามี label เดิมอยู่ -> ซ่อน */
.wheel-seg-label{
  display:none !important;
}

/* เส้นแบ่งช่อง */
.wheel-lines{
  position:absolute;
  inset:0;
  pointer-events:none;
}
.wheel-line{
  position:absolute;
  top:50%;
  left:50%;
  width:2px;
  height:50%;
  background:#fbbf24;
  transform-origin:50% 0%;
  opacity:0.6;
}

/* วงกลมกลางข้อความ */
.wheel-center{
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%, -50%);
  width:90px;        /* ขนาดวงกลาง */
  height:90px;
  border-radius:50%;
  background:#ffffff;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 6px 16px rgba(0,0,0,0.45);
  z-index:3;
  overflow:hidden;   /* กันรูปล้น */
}
.wheel-center img{
  width:70%;      /* ปรับอัตราส่วนได้ */
  height:auto;
  object-fit:contain;
  pointer-events:none;
}
/* ========= DESKTOP NAV ========= */
.topnav{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
}

.topnav a{
  text-decoration:none;
  color:var(--text-soft);
  padding:6px 12px;
  border-radius:999px;
  border:1px solid transparent;
  transition:.18s ease;
}

.topnav a:hover{
  color:#1d4ed8;
  border-color:#bfdbfe;
  background:#dbeafe;
}

.topnav .btn-cta{
  background:linear-gradient(to right,#3b82f6,#6366f1);
  color:#eff6ff;
  border:none;
  box-shadow:0 10px 22px rgba(37,99,235,0.55);
  font-weight:600;
}

/* user credit เล็ก ๆ มุมขวา */
.nav-user-credit{
  font-size:12px;
  color:#1d4ed8;
  padding:0 6px;
}

/* ========= HAMBURGER (ใช้ร่วมกับ input.nav-toggle) ========= */
.nav-toggle{
  display:none;
}

.nav-toggle-btn{
  display:none;
  cursor:pointer;
  flex-direction:column;
  gap:4px;
  padding:6px 8px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,0.35);
  background:#eff6ff;
  transition:.18s ease;
}

.nav-toggle-btn span{
  width:20px;
  height:2px;
  border-radius:999px;
  background:#0f172a;
}

.nav-toggle-btn:hover{
  background:#e0f2fe;
}

/* ================== LAYOUT ================== */
.main-wrap{
  max-width:1120px;
  margin:0 auto;
  padding:20px 14px 40px;
}

/* ================== HERO ================== */
.hero-shell{
  display:grid;
  grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);
  gap:16px;
  margin-bottom:20px;
}

.hero-card{
  border-radius:22px;
  background:linear-gradient(135deg,#eff6ff,#ffffff);
  border:1px solid #dbeafe;
  padding:18px 18px;
  box-shadow:var(--shadow-soft);
}
.hero-card h1{
  margin:0 0 8px;
  font-size:26px;
}
.hero-card p{
  margin:0 0 8px;
  font-size:14px;
  color:var(--text-soft);
}
.hero-tags{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:6px;
}
.hero-tags span{
  padding:4px 10px;
  border-radius:999px;
  border:1px solid #bfdbfe;
  background:#dbeafe;
  font-size:11px;
  color:#1e3a8a;
}

/* ================== USER SUMMARY ================== */
.user-summary{
  border-radius:22px;
  background:#ffffff;
  border:1px solid #dbeafe;
  padding:16px;
  box-shadow:var(--shadow-soft);
}
.user-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
}
.user-label{
  font-size:12px;
  color:var(--text-soft);
}
.user-name{
  font-size:16px;
  font-weight:600;
}
.user-credit{
  font-size:18px;
  font-weight:700;
  color:var(--accent2);
}
.user-role{
  font-size:11px;
  color:#1d4ed8;
  padding:2px 9px;
  border-radius:999px;
  background:#e0f2fe;
}

/* ================== SECTIONS / CARDS ================== */
.section-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin:0 0 10px;
}
.section-title{
  font-size:18px;
  font-weight:600;
}
.section-sub{
  font-size:13px;
  color:var(--text-soft);
}

.game-category-title{
  margin-top:14px;
  margin-bottom:6px;
  font-size:14px;
  font-weight:600;
  color:#1e3a8a;
}
.card-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
  gap:12px;
}
.game-card{
  border-radius:18px;
  background:var(--card);
  border:1px solid var(--border);
  padding:10px 10px 12px;
  box-shadow:0 10px 25px rgba(15,23,42,0.08);
}
.game-card-header{
  display:flex;
  align-items:center;
  gap:10px;
}
.game-thumb{
  width:56px;
  height:56px;
  border-radius:14px;
  object-fit:cover;
  border:1px solid #e5e7eb;
  background:#eff6ff;
}
.game-name{
  font-size:15px;
  font-weight:600;
}
.game-meta{
  font-size:12px;
  color:var(--text-soft);
}
.game-price{
  color:var(--accent2);
  font-weight:600;
}
.game-play-btn{
  margin-top:8px;
  text-align:right;
}

/* generic card */
.card-basic{
  border-radius:18px;
  background:#ffffff;
  border:1px solid #e5e7eb;
  padding:16px;
  box-shadow:var(--shadow-soft);
}

/* ================== BUTTONS ================== */
.btn-main{
  display:inline-block;
  border:none;
  border-radius:999px;
  padding:8px 18px;
  font-size:13px;
  font-weight:600;
  background:linear-gradient(to right,#3b82f6,#6366f1);
  color:#eff6ff;
  text-decoration:none;
  cursor:pointer;
  box-shadow:0 10px 22px rgba(37,99,235,0.55);
}
.btn-main:hover{
  filter:brightness(1.05);
}
.btn-soft{
  display:inline-block;
  border-radius:999px;
  padding:7px 14px;
  border:1px solid #e5e7eb;
  background:#eff6ff;
  font-size:13px;
  text-decoration:none;
  color:#0f172a;
}
.btn-soft:hover{
  background:#e0f2fe;
}

/* ================== GAME PLAY LAYOUT ================== */
.game-play-shell{
  display:grid;
  grid-template-columns:minmax(0,1.3fr) minmax(0,0.9fr);
  gap:14px;
}
.game-panel{
  border-radius:18px;
  background:#ffffff;
  border:1px solid #e5e7eb;
  padding:14px 14px 16px;
  box-shadow:var(--shadow-soft);
}
.game-panel-title{
  font-size:16px;
  font-weight:600;
}
.game-panel-sub{
  font-size:13px;
  color:var(--text-soft);
}



/* ================== BOX ================== */
.box-wrap{
  margin:16px auto 10px;
  width:220px;
  height:170px;
  position:relative;
}
.box-body{
  position:absolute;
  inset:40px 10px 0;
  border-radius:12px;
  background:linear-gradient(to top,#e0f2fe,#f9fafb);
  border:1px solid #dbeafe;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:600;
}
.box-lid{
  position:absolute;
  left:6px;
  right:6px;
  height:42px;
  top:12px;
  border-radius:12px 12px 6px 6px;
  background:linear-gradient(to right,#3b82f6,#6366f1);
  transform-origin:50% 100%;
  transition:transform .6s ease-out;
}
.box-lid-open{
  transform:rotate(-20deg) translateY(-6px);
}

/* ================== CSGO STRIP ================== */
.csgo-strip-shell{
  position:relative;
  overflow:hidden;
  border-radius:var(--radius-md);
  border:1px solid #e5e7eb;
  background:#eff6ff;
  height:120px;
  margin:12px 0;
  box-shadow:0 10px 25px rgba(15,23,42,0.10);
}

.csgo-strip{
  display:flex;
  gap:8px;
  position:absolute;
  left:0;
  top:50%;
  transform:translateY(-50%);
  transition:transform 2.8s cubic-bezier(.08,.9,.15,1);
  z-index:1;
}

.csgo-item{
  min-width:100px;
  height:82px;
  border-radius:12px;
  border:1px solid #e5e7eb;
  background:#ffffff;
  font-size:11px;
  padding:6px 6px 4px;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  align-items:center;
  text-align:center;
  overflow:hidden;
  box-shadow:0 6px 14px rgba(15,23,42,0.08);
}

.csgo-item img{
  max-width:80%;
  max-height:46px;
  border-radius:8px;
  object-fit:contain;
  background:#e0f2fe;
  margin-bottom:4px;
  display:block;
}

.csgo-item div{
  font-size:11px;
  line-height:1.2;
  color:#0f172a;
}

/* เส้นแดงชี้กลาง */
.csgo-pointer-line{
  position:absolute;
  inset:15px 50%;
  width:0;
  border-left:3px solid #ef4444;
  box-shadow:0 0 10px rgba(239,68,68,0.8);
  z-index:5;
}

/* ================== RESULT ================== */
.result-box{
  margin-top:10px;
  font-size:13px;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid #e5e7eb;
  background:#eff6ff;
  min-height:28px;
}
.result-image-wrap{
  margin:6px 0 4px;
  display:flex;
  justify-content:center;
}
.result-image{
  width:120px;
  height:120px;
  border-radius:16px;
  border:1px solid #e5e7eb;
  object-fit:cover;
  background:#e0f2fe;
}

/* ================== AUTH ================== */
.auth-shell{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px 14px;
}
.auth-card{
  width:100%;
  max-width:420px;
  padding:18px 16px 18px;
  border-radius:22px;
  background:#ffffff;
  border:1px solid #e5e7eb;
  box-shadow:var(--shadow-soft);
}
.auth-card h1{
  margin:0 0 6px;
  font-size:20px;
}
.auth-sub{
  margin:0 0 12px;
  font-size:13px;
  color:var(--text-soft);
}
.auth-form{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.auth-form label{
  font-size:13px;
  color:var(--text-soft);
  display:flex;
  flex-direction:column;
  gap:4px;
}
.auth-form input{
  border-radius:10px;
  border:1px solid #d1d5db;
  padding:7px 9px;
  background:#eff6ff;
  color:var(--text-main);
  font-family:inherit;
  font-size:13px;
}
.auth-alert{
  border-radius:10px;
  padding:8px 10px;
  font-size:12px;
  margin-bottom:10px;
}
.auth-alert-danger{
  background:#fee2e2;
  border:1px solid #fecaca;
  color:#b91c1c;
}
.auth-footnote{
  margin-top:10px;
  font-size:11px;
  color:var(--text-soft);
}

/* ================== FOOTER ================== */
.footer{
  padding:16px;
  font-size:11px;
  text-align:center;
  color:var(--text-soft);
}

/* ================== RESPONSIVE ================== */
@media (max-width:800px){
  .topbar{
    padding:8px 12px;
  }

  .hero-shell{
    grid-template-columns:minmax(0,1fr);
  }

  .game-play-shell{
    grid-template-columns:minmax(0,1fr);
  }

  /* แปลง topnav เป็นเมนูเลื่อนลง */
  .topnav{
    position:absolute;
    top:100%;
    left:0;
    right:0;
    margin-top:4px;
    padding:8px 12px 10px;
    flex-direction:column;
    align-items:flex-start;
    background:rgba(255,255,255,0.98);
    border-bottom:1px solid rgba(59,130,246,0.25);
    box-shadow:0 10px 25px rgba(15,23,42,0.18);
    display:none;
  }

  .topnav a,
  .topnav .nav-user-credit{
    width:100%;
    padding:7px 10px;
    border-radius:10px;
  }

  .nav-toggle-btn{
    display:flex;
  }

  /* เมื่อ checkbox ถูกติ๊กให้โชว์เมนู */
  .nav-toggle:checked ~ .topnav{
    display:flex;
  }

}