/* TGTT Bot web — theme lấy màu từ thegioitutien.com, font free tương đương.
   Nếu có license: thả web/assets/fonts/UTM-CAFETA.ttf -> tự dùng font đó. */

@font-face {
  font-family: 'UTM Cafeta';
  src: url('assets/fonts/UTM-CAFETA.ttf') format('truetype');
  font-display: swap;
}
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700&family=Be+Vietnam+Pro:wght@400;500;600&display=swap&subset=vietnamese');

/* [hidden] phải thắng các rule display:grid/flex (vd .stack) */
[hidden] { display: none !important; }

:root {
  --bg: #f4ead2;          /* nền sáng như web gốc (kem ấm) */
  --paper: #fbf3df;       /* panel giấy sáng */
  --paper-2: #f3e7c8;
  --ink: #3c2412;
  --jade: #0f6e57;
  --gold: #c07d1e;        /* vàng đồng đậm hơn cho dễ đọc trên nền sáng */
  --gold-glow: #e8a83a;
  --hp: #c0392b;
  --mp: #2e86c1;
  --line: #b98d55;        /* viền nâu nhạt */
  --line-strong: #6b4a2e;
  --title: 'UTM Cafeta', 'Baloo 2', system-ui, sans-serif;
  --body: 'UTM Cafeta', 'Be Vietnam Pro', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 640px at 50% 0%, #eef4e5 0%, var(--bg) 58%, #efe1bf 100%),
    var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .title { font-family: var(--title); color: var(--gold); letter-spacing: .3px; margin: 0 0 .45em; font-weight: 700; }
h1 { font-size: 1.9rem; text-shadow: 0 2px 0 var(--ink), 0 0 18px rgba(255,210,74,.35); }
h2 { font-size: 1.25rem; }
a { color: var(--jade); text-decoration: none; }
a:hover { color: var(--gold); }

/* ---- panel giấy cổ + khung góc CSS ---- */
.panel {
  position: relative;
  background: linear-gradient(180deg, #fdf7e8 0%, var(--paper) 45%, var(--paper-2) 100%);
  border: 3px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 5px 0 rgba(60,36,18,.45), inset 0 0 0 2px rgba(255,255,255,.55);
  padding: 18px 20px;
}
.panel::before, .panel::after,
.panel > .corner-tl, .panel > .corner-br { /* 4 góc trang trí */
  content: ""; position: absolute; width: 16px; height: 16px;
  border: 3px solid var(--gold); pointer-events: none;
}
.panel::before { top: -3px; left: -3px; border-right: 0; border-bottom: 0; }
.panel::after  { top: -3px; right: -3px; border-left: 0; border-bottom: 0; }
.panel .corner-tl { bottom: -3px; left: -3px; border-right: 0; border-top: 0; }
.panel .corner-br { bottom: -3px; right: -3px; border-left: 0; border-top: 0; }

.panel h2 { border-bottom: 2px dashed var(--line); padding-bottom: 6px; }
.panel h2 small { color: var(--jade); }

/* ---- nút kiểu game ---- */
.btn {
  font-family: var(--title); font-size: 15px;
  color: var(--paper); background: var(--jade);
  border: 3px solid var(--ink); border-radius: 6px;
  padding: 7px 16px; cursor: pointer;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform .05s, box-shadow .05s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn.gold { background: var(--gold); }
.btn.red { background: var(--hp); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.sm { font-size: 13px; padding: 4px 10px; box-shadow: 0 3px 0 var(--ink); }

input, select {
  font-family: var(--body); font-size: 14px;
  background: #fffaf0; color: var(--ink);
  border: 2px solid var(--line); border-radius: 5px; padding: 6px 9px;
}
label { font-size: 14px; font-weight: 500; }

/* ---- thanh HP/MP ---- */
.bar { height: 12px; background: rgba(60,36,18,.35); border: 2px solid var(--ink); border-radius: 7px; overflow: hidden; }
.bar > i { display: block; height: 100%; }
.bar.hp > i { background: var(--hp); }
.bar.mp > i { background: var(--mp); }
.bar.exp > i { background: var(--gold); }

/* ---- tag trạng thái ---- */
.tag { font-family: var(--title); font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 2px solid var(--ink); }
.tag.on { background: #d7ecd9; }
.tag.off { background: #f2d7d5; }
.tag.wait { background: #f6ecc9; }

/* ---- bảng ---- */
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { padding: 8px 10px; border-bottom: 1px solid rgba(107,74,46,.35); text-align: left; }
table.grid th { font-family: var(--title); color: var(--ink); background: rgba(201,150,47,.18); }
table.grid tr:hover td { background: rgba(255,250,240,.5); }
table.grid tr.sel td { background: rgba(15,110,87,.14); }

/* ---- layout ---- */
.wrap { max-width: 1400px; margin: 0 auto; padding: 20px; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.brand { font-family: var(--title); font-size: 26px; color: var(--gold); text-shadow: 0 1px 0 #fff, 0 3px 6px rgba(60,36,18,.25); }
.brand small { color: rgba(60,36,18,.6); font-size: 13px; }
.cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.muted { color: rgba(60,36,18,.62); font-size: 13px; }
pre, code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

/* ---- login ---- */
.login-center { min-height: 100vh; display: grid; place-items: center; }
.login-center .panel { width: 360px; }
