/* Terra-Anvil — เว็บไซต์ (landing / login / บัญชี)
   ใช้โทนเดียวกับในเกมเป๊ะ: พื้นน้ำตาลเข้ม + ทอง #e8b94c + ตัวอักษรครีม
   หน้าเว็บเลื่อนได้ (ต่างจาก style.css ของตัวเกมที่ล็อก overflow:hidden) */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #14120f; --panel: #1e1b17; --panel2: #282420; --line: #3a342c;
  --tx: #efe9dd; --dim: #9a9184; --gold: #e8b94c; --cry: #7fc7e8; --ok: #7fd1b9; --bad: #e87f7f;
  --cream: #ffe6a3;
  --wrap: 1120px;
}
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--tx); font-size: 16px; line-height: 1.65;
  font-family: system-ui, -apple-system, 'Segoe UI', 'Noto Sans Thai', sans-serif;
  -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }

/* ── ปุ่ม (ทองแบบเดียวกับปุ่มในเกม) ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(#f0c25a, #d09b2c); color: #241a03; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; padding: 13px 26px; border-radius: 11px; transition: transform .1s, filter .15s; }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--tx); border: 1px solid #5a5344; font-weight: 500; }
.btn.ghost:hover { background: #ffffff0e; filter: none; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; transform: none; filter: none; }

/* ── แถบบนสุด ── */
.nav { position: sticky; top: 0; z-index: 50; background: #14120fd9; backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 22px; height: 62px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: 1.2px;
  color: var(--cream); font-size: 15px; }
.brand img { width: 28px; height: 28px; }
.nav nav { display: flex; gap: 20px; margin-left: auto; font-size: 14px; color: var(--dim); }
.nav nav a:hover { color: var(--cream); }
.nav .acts { display: flex; gap: 9px; align-items: center; }
.nav .btn { padding: 9px 17px; font-size: 14px; }
@media (max-width: 860px) { .nav nav { display: none; } .nav .acts { margin-left: auto; } }
/* จอมือถือ: ห้ามให้ชื่อแบรนด์/ปุ่มตัดคำเป็นสองบรรทัด ("เข้าสู่ / ระบบ") */
.brand, .nav .btn { white-space: nowrap; }
@media (max-width: 420px) {
  .nav .wrap { gap: 10px; padding: 0 14px; }
  .brand { font-size: 13px; letter-spacing: .6px; }
  .nav .acts { gap: 6px; }
  .nav .btn { padding: 8px 12px; font-size: 13px; }
}

/* ── ฮีโร่ (คีย์อาร์ตเต็มจอ) ── */
.hero { position: relative; min-height: min(88vh, 760px); display: flex; align-items: center;
  background: #0e0c0a center/cover no-repeat; padding: 74px 0 56px; overflow: hidden; }
.hero::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, #100e0bf2 0%, #100e0bcc 38%, #100e0b40 68%, #100e0b8c 100%),
              linear-gradient(#100e0b55, transparent 30%, #14120f 100%); }
.hero .wrap { position: relative; z-index: 1; }
.hero-in { max-width: 610px; }
.eyebrow { display: inline-block; font-size: 12px; letter-spacing: 2.4px; text-transform: uppercase;
  color: var(--gold); border: 1px solid #6b5828; background: #2b241399; padding: 5px 13px;
  border-radius: 20px; margin-bottom: 20px; }
.hero h1 { font-size: clamp(40px, 8vw, 76px); font-weight: 900; letter-spacing: clamp(3px, 1vw, 7px);
  line-height: 1.02; color: var(--cream); text-shadow: 0 3px 0 #8a5a2a, 0 10px 30px #000c; }
.hero .tag { font-size: clamp(17px, 2.4vw, 21px); color: #f0dfc0; margin-top: 16px; font-weight: 600; }
.hero p.lede { color: #cdc2b0; margin-top: 14px; font-size: 16.5px; max-width: 52ch; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.hero .cta .btn { padding: 15px 30px; font-size: 16px; }

.facts { display: flex; flex-wrap: wrap; gap: 30px 42px; margin-top: 42px;
  padding-top: 26px; border-top: 1px solid #ffffff1a; }
.facts div { min-width: 76px; }
.facts b { display: block; font-size: 27px; font-weight: 800; color: var(--cream); line-height: 1.15;
  font-variant-numeric: tabular-nums; }
.facts span { font-size: 12.5px; color: var(--dim); }

/* ── ส่วนเนื้อหา ── */
section { padding: 84px 0; }
section.alt { background: linear-gradient(#171410, #14120f); border-block: 1px solid var(--line); }
.head { max-width: 760px; margin-bottom: 42px; }
.head .kicker { font-size: 12px; letter-spacing: 2.4px; text-transform: uppercase; color: var(--gold); }
/* ไทยไม่ตัดคำเอง — balance กันหัวข้อเหลือคำโดดบรรทัดสุดท้าย ('สาย' ห้อยเดี่ยว) */
.head h2 { font-size: clamp(27px, 4.2vw, 38px); font-weight: 800; margin-top: 11px; color: var(--cream);
  letter-spacing: .5px; line-height: 1.22; text-wrap: balance; }
.head p { color: var(--dim); margin-top: 12px; font-size: 16px; }

/* ลูปหลักของเกม */
.loop { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 16px; }
.loop .step { position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: 15px; padding: 24px 21px; }
.loop .step .n { font-size: 11px; letter-spacing: 2px; color: var(--gold); font-weight: 700; }
.loop .step h3 { font-size: 18px; margin: 9px 0 8px; color: var(--cream); }
.loop .step p { font-size: 14.5px; color: var(--dim); line-height: 1.6; }
.loop .step::after { content: '→'; position: absolute; right: -19px; top: 50%; transform: translateY(-50%);
  color: #5c5442; font-size: 19px; z-index: 1; }
.loop .step:last-child::after { content: '↺'; color: var(--gold); }
@media (max-width: 700px) { .loop .step::after { display: none; } }

/* การ์ดแมป */
.maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 17px; }
.mapc { position: relative; border: 1px solid var(--line); border-radius: 15px; overflow: hidden;
  background: var(--panel); transition: transform .18s, border-color .18s; }
.mapc:hover { transform: translateY(-3px); border-color: #6b5828; }
.mapc .ph { aspect-ratio: 3 / 2; background: #22201c center/cover no-repeat; }
.mapc .ov { position: absolute; inset: auto 0 0 0; padding: 42px 16px 14px;
  background: linear-gradient(transparent, #12100de6 46%); }
.mapc h3 { font-size: 16.5px; color: var(--cream); }
.mapc .sub { font-size: 13px; color: #bcb2a2; margin-top: 3px; }
.lvpill { position: absolute; top: 11px; left: 11px; font-size: 11.5px; font-weight: 700;
  background: #12100dd9; border: 1px solid #6b5828; color: var(--gold); padding: 3px 10px; border-radius: 20px; }
.lvpill.boss { border-color: #a3452e; color: #f0a08a; }

/* อาชีพ */
.jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 14px; }
.jobc { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); }
.jobc .ph { aspect-ratio: 3 / 4; background: #22201c center/cover no-repeat; }
.jobc .cap { padding: 11px 13px 13px; }
.jobc b { display: block; font-size: 15px; color: var(--cream); }
.jobc span { font-size: 12.5px; color: var(--dim); }

/* ระบบเด่น */
.feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 17px; }
.feat { background: var(--panel); border: 1px solid var(--line); border-radius: 15px; padding: 26px 23px; }
.feat.hi { border-color: #6b5828; background: linear-gradient(158deg, #2b2413, var(--panel)); }
.feat h3 { font-size: 19px; color: var(--cream); margin-bottom: 11px; }
.feat p { color: var(--dim); font-size: 14.5px; }
.feat ul { margin: 13px 0 0 17px; color: var(--dim); font-size: 14px; }
.feat li { margin-top: 6px; }
.feat li b { color: var(--tx); }

/* ของรางวัล */
.rw { display: grid; grid-template-columns: 1.05fr .95fr; gap: 46px; align-items: center; }
@media (max-width: 900px) { .rw { grid-template-columns: 1fr; gap: 32px; } }
.rwlist { display: flex; flex-direction: column; gap: 11px; }
.rwitem { display: flex; align-items: center; gap: 14px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 13px; padding: 15px 17px; }
.rwitem .ic { width: 40px; height: 40px; flex: 0 0 auto; border-radius: 10px; background: #33291399;
  border: 1px solid #6b5828; display: grid; place-items: center; color: var(--gold); font-size: 19px; }
.rwitem .gr { flex: 1; min-width: 0; }
.rwitem b { display: block; font-size: 15px; color: var(--cream); }
.rwitem span { font-size: 13px; color: var(--dim); }
.rwitem .cost { font-weight: 800; color: var(--gold); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 40px 0 54px; color: var(--dim); font-size: 13.5px; }
footer .wrap { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
footer .sp { margin-left: auto; display: flex; gap: 18px; }
footer a:hover { color: var(--cream); }

/* ── หน้า login / บัญชี ── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 34px 20px;
  background: #0e0c0a center/cover no-repeat fixed; }
.auth::before { content: ''; position: fixed; inset: 0; background: #100e0bd9; }
.authbox { position: relative; width: min(430px, 100%); background: #1c1915f2; backdrop-filter: blur(6px);
  border: 1px solid #4a4235; border-radius: 17px; padding: 34px 30px 30px;
  box-shadow: 0 22px 60px #000a; }
.authbox .brand { justify-content: center; margin-bottom: 7px; font-size: 17px; }
.authbox h1 { font-size: 22px; text-align: center; color: var(--cream); font-weight: 800; }
.authbox .sub { text-align: center; color: var(--dim); font-size: 13.5px; margin-top: 7px; margin-bottom: 24px; }

.tabs { display: flex; background: var(--panel2); border: 1px solid var(--line); border-radius: 11px;
  padding: 4px; margin-bottom: 20px; }
.tabs button { flex: 1; background: transparent; border: 0; color: var(--dim); font: inherit;
  font-size: 14px; padding: 9px; border-radius: 8px; cursor: pointer; }
.tabs button.on { background: #3d3527; color: var(--cream); font-weight: 700; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--dim); margin-bottom: 6px; }
.field input, .field select { width: 100%; background: var(--panel2); color: var(--tx); border: 1px solid #4a4238;
  border-radius: 10px; padding: 12px 14px; font: inherit; font-size: 15px; }
.field input:focus, .field select:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px #e8b94c22; }
.field .hint { font-size: 11.5px; color: #7d7568; margin-top: 5px; }
/* Safari/iOS ปล่อยไว้จะสูงไม่เท่า input อื่น — บังคับความสูงให้เท่ากันทั้งแถว */
.field select { appearance: none; height: 46px;
  background-image: linear-gradient(45deg, transparent 50%, #9a9184 50%), linear-gradient(135deg, #9a9184 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px; background-repeat: no-repeat; }
.field input[type=date] { height: 46px; }
.field input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.7); cursor: pointer; }

/* ประเทศ + วันเกิด วางคู่กันในแถวเดียว — จอแคบค่อยตกบรรทัด */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 400px) { .two { grid-template-columns: 1fr; gap: 0; } }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 12px; cursor: pointer;
  font-size: 13px; color: #c4bbab; line-height: 1.5; }
.check input { width: 17px; height: 17px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--gold); cursor: pointer; }
.legal { font-size: 11.5px; color: #7d7568; line-height: 1.55; margin-bottom: 16px; }

.msg { border-radius: 10px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 15px; display: none; }
.msg.on { display: block; }
.msg.err { background: #3a1c1c; border: 1px solid #6e3232; color: #f0b3b3; }
.msg.ok { background: #1c3327; border: 1px solid #2f5d47; color: #a8e0c6; }

.alt-links { text-align: center; margin-top: 17px; font-size: 13px; color: var(--dim); }
.alt-links button { background: 0; border: 0; color: var(--gold); font: inherit; font-size: 13px;
  cursor: pointer; text-decoration: underline; padding: 0; }
.backlink { display: block; text-align: center; margin-top: 22px; font-size: 13px; color: var(--dim); }
.backlink:hover { color: var(--cream); }

/* บัญชีผู้เล่น */
.acct { max-width: 860px; margin: 0 auto; padding: 34px 22px 80px; }
.purse { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 13px; margin: 22px 0 34px; }
.purse .p { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 17px 19px; }
.purse .p span { font-size: 12px; color: var(--dim); }
.purse .p b { display: block; font-size: 25px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.purse .p.gold b { color: var(--gold); } .purse .p.cry b { color: var(--cry); } .purse .p.stam b { color: var(--ok); }
.rwitem .btn { padding: 9px 17px; font-size: 13.5px; }
.hist { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.hist .r { display: flex; gap: 13px; padding: 13px 17px; border-top: 1px solid var(--line); font-size: 14px; }
.hist .r:first-child { border-top: 0; }
.hist .r .st { margin-left: auto; font-size: 12px; color: var(--dim); }
.empty { color: var(--dim); font-size: 14px; padding: 19px; text-align: center; }
