/* ================= MonBlock — cổng game ================= */
:root {
  --bg: #0d1117;
  --panel: #151c26;
  --panel-2: #1b2431;
  --line: #2b3646;
  --txt: #e8eef6;
  --muted: #93a3b8;
  --accent: #ffd76a;
  --b1: #ff6b5b;
  --b2: #ffd76a;
  --b3: #4fd18b;
  --b4: #4f9dff;
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 500px at 15% -10%, #1e2a3c 0%, transparent 60%),
    radial-gradient(700px 420px at 100% 0%, #241c33 0%, transparent 55%),
    var(--bg);
  color: var(--txt);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.hidden { display: none !important; }

/* ---------- thanh trên ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 18px 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--txt);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  grid-template-columns: 13px 13px;
  gap: 3px;
  transform: rotate(-8deg);
}
.brand-mark i { width: 13px; height: 13px; border-radius: 4px; display: block; }
.brand-mark i:nth-child(1) { background: var(--b1); }
.brand-mark i:nth-child(2) { background: var(--b2); }
.brand-mark i:nth-child(3) { background: var(--b3); }
.brand-mark i:nth-child(4) { background: var(--b4); }

.brand-name { font-size: 22px; font-weight: 800; letter-spacing: .3px; }
.brand-name b { color: var(--accent); font-weight: 800; }

.acct-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 55vw;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--txt);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.acct-chip:hover { border-color: #3c4b60; }
.acct-chip.in { border-color: #3a5a45; }
.acct-av {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--panel-2);
  font-size: 18px;
}
.acct-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- khung ---------- */
.wrap {
  flex: 1;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 8px 18px 28px;
}

.hello { margin: 14px 2px 20px; }
.hello h1 { margin: 0 0 6px; font-size: clamp(22px, 4.2vw, 32px); line-height: 1.2; }
.hello p { margin: 0; color: var(--muted); max-width: 640px; line-height: 1.5; }

/* ---------- lưới game ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--txt);
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
a.game-card:hover, a.game-card:focus-visible {
  transform: translateY(-3px);
  border-color: #46607d;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
  outline: none;
}
a.game-card:active { transform: translateY(0) scale(.99); }

.gc-art {
  position: relative;
  height: 140px;
  display: grid;
  place-items: center;
  background: var(--panel-2);
}
.gc-art span { font-size: 64px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35)); }

/* sân cỏ: sọc cắt cỏ + vạch giữa sân */
.theme-pitch .gc-art {
  background:
    radial-gradient(circle at 50% 50%, transparent 34px, rgba(255, 255, 255, .55) 35px, rgba(255, 255, 255, .55) 37px, transparent 38px),
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(255, 255, 255, .55) calc(50% - 1px), rgba(255, 255, 255, .55) calc(50% + 1px), transparent calc(50% + 1px)),
    repeating-linear-gradient(90deg, #2f8f4e 0 34px, #2a8146 34px 68px);
}

.gc-body { padding: 14px 16px 6px; flex: 1; }
.gc-name { font-size: 19px; font-weight: 800; }
.gc-tag { margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.gc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.gc-chips i {
  font-style: normal;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
}
.gc-me { margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--b3); }

.gc-play {
  margin: 10px 16px 16px;
  padding: 11px;
  border-radius: 12px;
  background: var(--accent);
  color: #1c1608;
  font-weight: 800;
  text-align: center;
}

.game-card.soon { border-style: dashed; background: transparent; }
.game-card.soon .gc-art { background: transparent; opacity: .55; }
.game-card.soon .gc-body { padding-bottom: 18px; }

/* ---------- thẻ / form ---------- */
.card {
  max-width: 460px;
  margin: 10px auto 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.card h2 { margin: 22px 0 10px; font-size: 16px; }
.card h3 { margin: 18px 0 8px; font-size: 14px; color: var(--muted); }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--bg);
}
.tab {
  padding: 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.tab.active { background: var(--panel-2); color: var(--txt); }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }

input[type="text"], input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--txt);
  font: inherit;
  font-size: 16px;
}
input:focus { outline: none; border-color: var(--b4); }

.avatars { display: flex; flex-wrap: wrap; gap: 6px; }
.av {
  width: 44px;
  height: 44px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--bg);
  font-size: 24px;
  cursor: pointer;
}
.av.active { border-color: var(--accent); background: var(--panel-2); }

.btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--accent); color: #1c1608; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--txt); }
.btn-link { background: transparent; color: var(--muted); font-weight: 600; }
.btn-sm { width: auto; display: inline-block; margin: 0; padding: 7px 12px; font-size: 13px; }

.row-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.msg {
  margin: 4px 0 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #3a1f22;
  color: #ffb3a8;
  font-size: 14px;
}
.msg.ok { background: #1d3326; color: #9fe3b6; }

.note { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 14px 0 0; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }

/* ---------- hồ sơ ---------- */
.pf-head { display: flex; align-items: center; gap: 14px; }
.pf-av {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--panel-2);
  font-size: 38px;
}
.pf-name { font-size: 22px; font-weight: 800; }
.pf-code { color: var(--muted); font-size: 14px; margin-top: 2px; }
.pf-code b { color: var(--accent); letter-spacing: .5px; user-select: all; }

.pf-game {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: var(--panel-2);
}

/* ---------- bạn bè ---------- */
.fr-add { display: flex; gap: 8px; }
.fr-add .btn { width: auto; margin: 0; white-space: nowrap; padding: 0 14px; }
.fr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: var(--panel-2);
}
.fr-av { font-size: 24px; }
.fr-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fr-info b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-info small { color: var(--muted); }
.fr-acts { display: flex; gap: 6px; }

/* ---------- chân trang ---------- */
.foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 18px 22px;
  color: var(--muted);
  font-size: 13px;
}

.updatebar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  z-index: 10;
}
.updatebar button {
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #1c1608;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 520px) {
  .topbar { padding: 12px 14px 4px; }
  .wrap { padding: 4px 14px 24px; }
  .grid { grid-template-columns: 1fr; }
  .gc-art { height: 120px; }
  .card { padding: 16px; }
}

/* ---------- thẻ mời cài app ---------- */
.install-card {
  display: flex;
  gap: 14px;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid #3a5a45;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #17251d, var(--panel));
}
.install-card.urgent { border-color: var(--accent); background: linear-gradient(135deg, #2a2412, var(--panel)); }
.ic-icon img { width: 56px; height: 56px; border-radius: 14px; display: block; }
.ic-body { flex: 1; min-width: 0; }
.ic-body b { font-size: 17px; }
.ic-body p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.ic-steps { margin: 10px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.ic-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ic-actions .btn-link { padding: 7px 4px; }

/* ---------- mời bạn bè ---------- */
.invite-hero, .invite-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 6px;
  padding: 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #2a2412, var(--panel));
}
.invite-strip { justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; border-color: var(--line); background: var(--panel); }
.invite-strip span { color: var(--muted); font-size: 14px; }
.ih-av {
  display: grid;
  place-items: center;
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--panel-2);
  font-size: 36px;
}
.ih-body { flex: 1; min-width: 0; }
.ih-body b { font-size: 18px; }
.ih-body p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.auth-invite {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #2a2412;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.invite-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
}
.invite-box p { margin: 6px 0 10px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.invite-link {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--accent);
  font-size: 14px;
  word-break: break-all;
  user-select: all;
}

.toast {
  position: fixed;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: #1d3326;
  border: 1px solid #3a5a45;
  color: #c7f5d5;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  z-index: 20;
}

/* bàn cờ vua: ô vuông xen kẽ */
.theme-chess .gc-art {
  background:
    repeating-conic-gradient(#b58863 0% 25%, #f0d9b5 0% 50%) 0 0 / 46px 46px;
}
.theme-chess .gc-art span { color: #1b1b1b; text-shadow: 0 0 2px #fff, 0 4px 10px rgba(0, 0, 0, .4); }
.on-dot { color: #4fd18b; font-weight: 700; }

/* ---------- static game + guide links (generated by scripts/seo/build.js; crawlable without JS) ---------- */
.seo-links { width: 100%; max-width: 1080px; margin: 8px auto 0; padding: 0 18px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.seo-links h2 { margin: 18px 0 4px; font-size: 16px; color: var(--txt); }
.seo-links p { margin: 4px 0; }
.seo-links ul { margin: 6px 0; padding-left: 18px; }
.seo-links a { color: var(--accent); font-weight: 700; }
