/* ==========================================================================
   FM5 CITY — ธีมดำ-ฟ้าสำหรับหน้าร้าน (/store/) และแผงจัดการ (/admin/)
   โหลดหลังสุดเพื่อทับโทนฟ้าเดิมของ css/style.css + store.css + admin.css
   ให้หน้าตาเป็นชุดเดียวกับหน้าแรก (css/landing.css)
   ========================================================================== */

:root {
  /* พื้นและการ์ด */
  --bg-main: #0c0c0e;
  --bg-card: #161619;
  --bg-card-hover: #1d1d21;
  --bg-elevated: #222227;
  --bg-hud: rgba(14, 14, 17, 0.88);

  /* สีหลัก: ฟ้า-น้ำเงินตามโลโก้ ZERO CITY (ชื่อตัวแปรเดิม --blue/--cyan ยังถูกใช้ทั่วโค้ด จึงชี้ไปที่แดงแทน) */
  --blue: #0ea5ff;
  --blue-hover: #38b6ff;
  --cyan: #0ea5ff;
  --cyan-bright: #5cc8ff;

  /* ข้อความ */
  --text-1: #f5f5f7;
  --text-2: #b9b9c2;
  --text-3: #80808b;
  --text-muted: #5c5c66;

  /* ฟอนต์เดียวกับหน้าแรก */
  --font-brand: 'Outfit', 'Kanit', sans-serif;
  --font-display: 'Outfit', 'Kanit', sans-serif;
  --font-heading: 'Kanit', 'Outfit', sans-serif;
  --font-body: 'Kanit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-label: 'Outfit', 'Kanit', sans-serif;
  --font-hud: 'Outfit', 'Kanit', sans-serif;

  /* มุมตัดเฉียงแบบ HUD ฟ้าเดิม → ไม่ใช้ (หน้าแรกใช้มุมโค้งเล็ก) */
  --clip-game-sm: none;
  --clip-game-btn: none;
  --clip-game-card: none;
  --clip-game-lg: none;

  --cc-radius-line: rgba(255, 255, 255, 0.08);
  --cc-line-strong: rgba(255, 255, 255, 0.16);
}

body {
  background: #0c0c0e;
  font-family: var(--font-body);
  font-weight: 300;
}

/* พื้นหลังหน้า: แสงแดงจาง ๆ มุมบน แทนตารางเส้นฟ้า */
body::before {
  background:
    radial-gradient(ellipse 70% 40% at 80% -5%, rgba(14, 165, 255, 0.12), transparent 70%),
    radial-gradient(ellipse 60% 35% at 0% 0%, rgba(37, 99, 235, 0.06), transparent 70%) !important;
}

h1, h2, h3, h4,
.cc-title,
.cc-h1,
.cc-h2 {
  font-family: var(--font-heading);
  font-weight: 700;
}

/* แถบด้านบน */
.cc-topbar {
  background: rgba(12, 12, 14, 0.9) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* การ์ด/แผงทุกชนิด: มุมโค้งเล็ก ขอบบาง */
.cc-card,
.cc-panel,
.cc-card-img,
.cc-product-img {
  border-radius: 6px;
}

.cc-card {
  background: #161619;
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.cc-card:hover {
  border-color: rgba(14, 165, 255, 0.45);
}

.cc-panel {
  background: #151518;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

/* ปุ่ม: แดงทึบ / เทาเข้ม เหมือนหน้าแรก */
.btn {
  border-radius: 4px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: #0ea5ff !important;
  border-color: #0ea5ff !important;
  color: #fff !important;
  box-shadow: 0 10px 26px -12px rgba(14, 165, 255, 0.6);
}

.btn-primary:hover {
  background: #38b6ff !important;
  border-color: #38b6ff !important;
}

.btn-secondary,
.btn-ghost,
.btn-outline {
  background: #2a2a2e;
  border-color: #2a2a2e;
  color: #f5f5f7;
}

.btn-secondary:hover,
.btn-ghost:hover,
.btn-outline:hover {
  background: #38383d;
  border-color: #38383d;
}

/* ช่องกรอก (ล็อกอิน dev, ค้นหา, ฟอร์มแอดมิน) */
input,
select,
textarea {
  border-radius: 4px !important;
  background-color: #111114 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #f5f5f7;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #0ea5ff !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 255, 0.18) !important;
  outline: none;
}

::selection {
  background: rgba(14, 165, 255, 0.35);
}

/* สีฟ้าที่เขียนตายตัวไว้เดิม → แดง */
.cc-badge-blue,
.cc-state-blue {
  color: #5cc8ff !important;
  background: rgba(14, 165, 255, 0.14) !important;
}

/* ภาพแทนสินค้า (ไม่มีรูป): ไล่สีแดงเข้ม */
.cc-card-img,
.cc-product-img {
  background:
    radial-gradient(circle at 50% 40%, rgba(14, 165, 255, 0.16), transparent 65%),
    #18181c !important;
}

/* ==========================================================================
   หน้าล็อกอิน (บัญชีของฉัน / ตรวจสอบคำสั่งซื้อ / แผงจัดการ)
   ========================================================================== */
.cc-login {
  position: relative;
  background:
    linear-gradient(180deg, rgba(14, 165, 255, 0.08), transparent 45%),
    #151518 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-top: 3px solid #0ea5ff !important;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}

/* ไอคอนวงกลมหัวการ์ดล็อกอิน */
.cc-state-icon {
  color: #0ea5ff !important;
  background: rgba(14, 165, 255, 0.12) !important;
  border-color: rgba(14, 165, 255, 0.3) !important;
  border-radius: 50% !important;
}

/* ลิงก์ทั่วไป */
a:not(.btn) {
  text-decoration-color: rgba(14, 165, 255, 0.6);
}

/* หน้าล็อกอินแผงจัดการ / สถานะว่าง: การ์ดเดียวกับหน้าล็อกอินร้าน */
.cc-state {
  padding: 2.4rem 1.5rem 2.2rem;
  background:
    linear-gradient(180deg, rgba(14, 165, 255, 0.08), transparent 45%),
    #151518;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 3px solid #0ea5ff;
  border-radius: 8px;
}

.cc-state h3 {
  font-family: var(--font-heading);
  font-weight: 700;
}

/* ปุ่มเข้าสู่ระบบ (dev) ในหน้าล็อกอิน */
.cc-dev-login .btn,
.cc-dev-login button {
  width: 100%;
  background: #2a2a2e;
  border-color: #2a2a2e;
  color: #f5f5f7;
}

.cc-dev-login .btn:hover,
.cc-dev-login button:hover {
  background: #38383d;
}


/* ==========================================================================
   แถบเลื่อน (scrollbar) สีชมพู
   ========================================================================== */
/* Firefox ใช้ scrollbar-color; Chrome/Edge ใช้ ::-webkit-scrollbar ด้านล่าง (ถ้าตั้ง scrollbar-color ใน Chrome ลายไล่สีจะหาย) */
@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: thin;
    scrollbar-color: #0ea5ff #141417;
  }
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #141417;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #5cc8ff 0%, #0ea5ff 45%, #2563eb 100%);
  border: 2px solid #141417;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(14, 165, 255, 0.55);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #8bd8ff 0%, #38b6ff 45%, #0ea5ff 100%);
}

::-webkit-scrollbar-corner {
  background: #141417;
}

/* ==========================================================================
   หน้า "บัญชีของฉัน" — แดชบอร์ด 2 คอลัมน์ โปร่ง อ่านง่าย
   ========================================================================== */
.acc {
  max-width: 1080px;
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.acc-title {
  margin-bottom: 1.75rem;
}

.acc-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}

.acc-side,
.acc-main {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

.acc-side {
  position: sticky;
  top: calc(var(--cc-topbar-h, 64px) + 1.5rem);
}

/* การ์ดพื้นฐาน */
.acc-card {
  padding: 1.5rem;
  background: #141417;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

.acc-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.acc-h {
  margin: 0 0 1rem;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.acc-card-head .acc-h {
  margin: 0;
}

.acc-link {
  font-size: 0.85rem;
  color: #5cc8ff;
  text-decoration: none;
}

.acc-link:hover {
  text-decoration: underline;
}

.acc-muted {
  margin: 0;
  color: #80808b;
  font-size: 0.9rem;
  line-height: 1.6;
}

.acc-full {
  width: 100%;
  margin-top: 1.1rem;
  justify-content: center;
}

/* โปรไฟล์ */
.acc-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem 1.75rem;
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(14, 165, 255, 0.18), transparent 70%),
    #141417;
  border-top: 3px solid #0ea5ff;
}

.acc-avatar {
  width: 88px;
  height: 88px;
  margin-bottom: 1rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 4px rgba(14, 165, 255, 0.18), 0 12px 30px -10px rgba(14, 165, 255, 0.6);
}

.acc-avatar-initial {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
}

.acc-name {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
}

.acc-email {
  margin-top: 0.2rem;
  font-size: 0.88rem;
  color: #9a9aa5;
  overflow-wrap: anywhere;
}

.acc-role {
  margin-top: 0.85rem;
  padding: 0.2rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  color: #c9c9d2;
  background: rgba(255, 255, 255, 0.07);
}

.acc-role.is-admin {
  color: #fff;
  background: #0ea5ff;
}

.acc-since {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: #6f6f7a;
}

/* เมนูลัด */
.acc-menu {
  display: grid;
  padding: 0.5rem;
}

.acc-menu a,
.acc-menu button {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.85rem 1rem;
  font: inherit;
  font-size: 0.95rem;
  color: #e4e4ea;
  text-align: left;
  text-decoration: none;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.acc-menu a:hover,
.acc-menu button:hover {
  background: rgba(255, 255, 255, 0.05);
}

.acc-menu svg:first-child {
  color: #5cc8ff;
}

.acc-menu-chev {
  margin-left: auto;
  opacity: 0.4;
}

.acc-menu .acc-menu-logout {
  margin-top: 0.25rem;
  color: #a5a5b0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0 0 8px 8px;
}

.acc-menu .acc-menu-logout svg:first-child {
  color: #a5a5b0;
}

/* ความปลอดภัย */
.acc-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem 1rem;
  margin: 0;
  font-size: 0.88rem;
}

.acc-kv dt {
  color: #80808b;
}

.acc-kv dd {
  margin: 0;
  text-align: right;
  font-weight: 500;
}

/* สถิติ */
.acc-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.acc-stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem 1.25rem 1.3rem;
  background: #141417;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

.acc-stat-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 0.6rem;
  border-radius: 10px;
  color: #5cc8ff;
  background: rgba(14, 165, 255, 0.12);
}

.acc-stat strong {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.acc-stat > span:last-child {
  font-size: 0.82rem;
  color: #80808b;
}

.acc-stat.is-amber .acc-stat-icon {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.14);
}

/* แจ้งเตือน */
.acc-notices {
  display: grid;
  gap: 0.75rem;
}

.acc-notice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  font-size: 0.92rem;
  color: inherit;
  text-decoration: none;
  border-radius: 12px;
}

.acc-notice.is-amber {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.acc-notice.is-red {
  color: #ffb3c0;
  background: rgba(14, 165, 255, 0.08);
  border: 1px solid rgba(14, 165, 255, 0.32);
}

/* คำสั่งซื้อล่าสุด */
.acc-orders {
  list-style: none;
  margin: 0;
  padding: 0;
}

.acc-orders li + li {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.acc-orders a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0.5rem;
  margin: 0 -0.5rem;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.acc-orders a:hover {
  background: rgba(255, 255, 255, 0.035);
}

.acc-order-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.acc-order-main strong {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-order-main small {
  font-size: 0.8rem;
  color: #80808b;
}

.acc-order-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex: none;
}

.acc-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 0.25rem;
  color: #80808b;
}

.acc-empty p {
  margin: 0;
}

/* บัญชีเกม */
.acc .cc-accounts-list {
  margin: 0 0 0.5rem;
}

.acc .cc-accounts-list li {
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.acc .cc-accounts-list li + li {
  margin-top: 0.5rem;
}

.acc-link-box {
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.acc-link-box summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 0 0.25rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: #5cc8ff;
  list-style: none;
  cursor: pointer;
}

.acc-link-box summary::-webkit-details-marker {
  display: none;
}

.acc-sum-chev {
  margin-left: auto;
  transform: rotate(90deg);
  transition: transform 0.2s ease;
}

.acc-link-box[open] .acc-sum-chev {
  transform: rotate(-90deg);
}

/* ส่วนเชื่อมโยงที่ฝังอยู่ในการ์ด: ไม่ต้องมีกรอบซ้อน */
.acc-link-box .cc-panel {
  margin-top: 0.75rem;
  padding: 0;
  background: none !important;
  border: 0 !important;
}

.acc-link-box .cc-panel .cc-h3 {
  display: none;
}

.acc-link-box .cc-text {
  line-height: 1.65;
}

/* ---------- แท็บเล็ต / มือถือ ---------- */
@media (max-width: 900px) {
  .acc-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .acc-side {
    position: static;
  }

  /* มือถือ: โปรไฟล์ → สถิติ → แจ้งเตือน → คำสั่งซื้อ → บัญชีเกม → เมนู → ความปลอดภัย */
  .acc-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .acc-side,
  .acc-main {
    display: contents;
  }

  .acc-profile { order: 1; }
  .acc-stats { order: 2; }
  .acc-notices { order: 3; }
  .acc-recent { order: 4; }
  .acc-games { order: 5; }
  .acc-menu { order: 6; }
  .acc-security { order: 7; }

  .acc-grid > * ,
  .acc-grid .acc-profile,
  .acc-grid .acc-stats,
  .acc-grid .acc-notices,
  .acc-grid .acc-card {
    margin-bottom: 1.1rem;
  }

  .acc-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
}

@media (max-width: 560px) {
  .acc {
    padding-top: 1.25rem;
  }

  .acc-title {
    margin-bottom: 1.25rem;
  }

  .acc-card {
    padding: 1.25rem;
  }

  .acc-stat {
    padding: 1rem;
  }

  .acc-stat strong {
    font-size: 1.35rem;
  }

  .acc-empty {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- บัญชี: ตัวละครในเกม / หีบรายวัน / แถวการเชื่อมโยง ---------- */
.acc-block {
  display: block;
}

.cc-account-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex: none;
}

.acc .cc-accounts-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.acc-players-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.acc-players-list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.acc-players-list li + li {
  margin-top: 0.5rem;
}

.acc-player-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.acc-player-main small {
  font-size: 0.78rem;
}

.acc-player-coins {
  flex: none;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fbbf24;
  white-space: nowrap;
}

.acc-recovery-btn {
  flex: none;
}

.acc-recovery {
  flex-basis: 100%;
  margin: 0.25rem 0 0;
  padding: 0.5rem 0.65rem;
  background: rgba(251, 191, 36, 0.08);
  border-left: 3px solid #fbbf24;
  border-radius: 6px;
  font-size: 0.85rem;
  word-break: break-word;
}

.acc-recovery code {
  font-family: var(--font-hud);
  letter-spacing: 0.08em;
  font-weight: 700;
}

.acc-daily-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.acc-daily-streak {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  color: #fbbf24;
}

.acc-daily-streak strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
}

.acc-daily-streak small {
  color: #80808b;
}

.acc-notice .btn {
  margin-left: auto;
  flex: none;
}
