/* Đại hội võ lâm — game.iikanzi.jp
   Phong cách: giấy washi + mực + son (朱) + kim (金). Web-only, có tầng desktop. */
:root {
  --paper: #f4efe3;
  --paper-2: #ece4d2;
  --card: #fffdf8;
  --ink: #211d36;
  --ink-2: #2f294a;
  --line: #e2d9c4;
  --vermilion: #c5402c;
  --vermilion-d: #9c2f20;
  --gold: #b8892f;
  --gold-soft: #e9d3a0;
  --jade: #2f8f6b;
  --text: #2a2440;
  --muted: #726a8a;
  --shadow: 0 6px 22px rgba(33, 29, 54, .10);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--paper);
  background-image: radial-gradient(circle at 12% 8%, #fbf7ee 0, transparent 42%),
                    radial-gradient(circle at 88% 4%, #efe6d4 0, transparent 40%);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px clamp(16px, 4vw, 40px);
  background: var(--ink);
  color: #f5f0e4;
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 2px 14px rgba(0,0,0,.18);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .seal {
  width: 40px; height: 40px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 22px; font-weight: 700;
  color: #fff; background: var(--vermilion);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.18);
}
.brand .b-txt { line-height: 1.15; min-width: 0; }
.brand .b-txt b { font-size: 16px; letter-spacing: .3px; display: block; }
.brand .b-txt span { font-size: 11.5px; color: #c9c1dd; }
.topbar .tag { font-size: 12px; color: #cfc7a5; white-space: nowrap; }

/* ---------- Layout ---------- */
.wrap { max-width: 1000px; margin: 0 auto; padding: clamp(18px, 3vw, 34px) clamp(16px, 4vw, 40px) 60px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius); background: var(--ink);
  color: #f6f1e6; padding: clamp(22px, 4vw, 40px);
  box-shadow: var(--shadow); margin-bottom: 26px;
}
.hero .kanji-mark {
  position: absolute; right: -14px; top: -30px; font-size: 190px; line-height: 1;
  color: rgba(197,64,44,.16); font-weight: 700; user-select: none; pointer-events: none;
}
.hero h1 { margin: 0 0 8px; font-size: clamp(22px, 3.4vw, 30px); letter-spacing: .5px; }
.hero p { margin: 0; max-width: 40ch; color: #d7cfe6; font-size: 14.5px; line-height: 1.65; }

/* ---------- Section ---------- */
.sec { margin: 30px 0 14px; }
.sec h2 { margin: 0 0 4px; font-size: 18px; letter-spacing: .3px; }
.sec .hint { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- Level chips ---------- */
.levels { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  border: 1.5px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 9px 18px; font-size: 15px; font-weight: 600;
  color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px;
  transition: transform .08s, border-color .15s, background .15s;
}
.chip small { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.chip:hover { border-color: var(--gold); }
.chip[aria-pressed="true"] {
  background: var(--ink); color: #f5f0e4; border-color: var(--ink);
}
.chip[aria-pressed="true"] small { color: var(--gold-soft); }
.chip:active { transform: scale(.97); }

/* ---------- Game grid ---------- */
.games { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.gcard {
  position: relative; text-align: left; border: 1px solid var(--line);
  background: var(--card); border-radius: var(--radius); padding: 18px 18px 16px;
  box-shadow: var(--shadow); transition: transform .1s, box-shadow .15s;
  display: flex; flex-direction: column; gap: 8px; min-height: 130px;
}
.gcard.play:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(33,29,54,.15); }
.gcard .ic { font-size: 30px; line-height: 1; }
.gcard h3 { margin: 0; font-size: 16.5px; }
.gcard p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55; }
.gcard .badge {
  position: absolute; top: 14px; right: 14px; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
}
.gcard .badge.duo { background: #f6e3df; color: var(--vermilion-d); }
.gcard .badge.solo { background: #e3efe9; color: #1f6b4f; }
.gcard.soon { opacity: .72; }
.gcard.soon::after {
  content: "Sắp ra"; position: absolute; bottom: 14px; right: 16px;
  font-size: 11.5px; font-weight: 600; color: var(--gold);
}
.gcard.play { cursor: pointer; }

/* ---------- Cổng về núi + trang bị ---------- */
.portal {
  margin-top: 30px; border-radius: var(--radius); border: 1px dashed var(--gold);
  background: linear-gradient(180deg, #fffdf7, #f7efdd);
  padding: 20px clamp(16px,3vw,26px); display: flex; flex-wrap: wrap;
  align-items: center; gap: 16px; justify-content: space-between;
}
.portal .p-txt b { display: block; font-size: 16px; }
.portal .p-txt span { font-size: 13px; color: var(--muted); }
.portal .p-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  border: 1.5px solid var(--ink); background: var(--ink); color: #f5f0e4;
  border-radius: 999px; padding: 11px 20px; font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  transition: transform .08s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #2a2008; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.gear { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.gear .lbl { font-size: 12.5px; color: var(--muted); }
.gear a {
  font-size: 13px; text-decoration: none; color: var(--ink-2); font-weight: 600;
  border-bottom: 1.5px solid var(--gold-soft); padding-bottom: 1px;
}
.gear a:hover { border-color: var(--gold); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); background: #efe7d6;
  padding: 26px clamp(16px,4vw,40px); color: var(--muted); font-size: 13px;
}
.site-footer .fwrap { max-width: 1000px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; }
.site-footer a { text-decoration: none; color: var(--ink-2); }
.site-footer a:hover { color: var(--vermilion); }
.site-footer .cp { flex-basis: 100%; color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ---------- Game view ---------- */
.game { max-width: 640px; margin: 0 auto; }
.gtop { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.gtop .back { background: none; border: none; color: var(--muted); font-size: 14px; padding: 6px; }
.gstats { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); }
.gstats b { font-size: 17px; }
.progress { height: 6px; background: var(--paper-2); border-radius: 999px; overflow: hidden; margin-bottom: 22px; }
.progress > i { display: block; height: 100%; background: var(--vermilion); transition: width .3s; }
.qcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px 22px; text-align: center;
}
.qcard .q-kanji { font-size: clamp(76px, 22vw, 120px); line-height: 1; margin: 6px 0 4px; color: var(--ink); }
.qcard .q-ask { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.opts { display: grid; gap: 12px; }
.opt {
  border: 1.5px solid var(--line); background: #fff; border-radius: 12px;
  padding: 15px 16px; font-size: 16px; color: var(--text); text-align: left;
  transition: border-color .12s, background .12s, transform .08s;
}
.opt:hover { border-color: var(--gold); }
.opt:active { transform: scale(.99); }
.opt.correct { border-color: var(--jade); background: #e7f4ee; color: #1c6047; font-weight: 600; }
.opt.wrong { border-color: var(--vermilion); background: #fbe9e5; color: var(--vermilion-d); }
.opt[disabled] { cursor: default; }
.combo { margin-top: 16px; font-size: 14px; color: var(--gold); min-height: 20px; font-weight: 600; }

/* End screen */
.end { text-align: center; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px 24px; }
.end .stars { font-size: 40px; letter-spacing: 6px; margin: 6px 0 10px; }
.end h2 { margin: 0 0 6px; }
.end .score { font-size: 15px; color: var(--muted); margin-bottom: 22px; }
.end .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 560px) {
  .topbar .tag { display: none; }
  .portal { flex-direction: column; align-items: flex-start; }
}
