:root{
  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --muted-surface: #EEF2F7;

  --text: #1F2937;
  --muted: #6B7280;

  --border: #E5E7EB;

  --brand: #2563EB;
  --brand2: #0EA5A4;
  --brandSoft: #E0F2FE;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 10px 30px rgba(0,0,0,.10);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

a{ color: inherit; text-decoration: none; }
a:hover{ color: var(--brand); }

body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI",
               Roboto, Arial, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", sans-serif;

  display:flex;
  align-items:center;
  justify-content:center;
  min-height:100vh;
  padding: 18px;
}

/* ===== Game Root ===== */
#game-root{
  width: min(96vw, 760px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 18px;

  display:flex;
  flex-direction:column;
  gap: 12px;
}

/* ===== Header ===== */
.header-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
}

h1{
  margin:0;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.lang-toggle{
  display:flex;
  gap: 8px;
  align-items:center;
}

.toggle-btn{
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  cursor:pointer;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}

.toggle-btn:hover{
  border-color: rgba(37,99,235,.35);
  background: var(--brandSoft);
}

.toggle-btn.active{
  border-color: rgba(37,99,235,.75);
  color: var(--brand);
  background: rgba(37,99,235,.06);
}

/* ===== Description ===== */
.desc{
  margin:0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

/* ===== Panels ===== */
.panel{
  border: 1px solid var(--border);
  background: var(--muted-surface);
  border-radius: 14px;
  padding: 12px;
}

/* ===== Status ===== */
.status-row{
  display:flex;
  flex-wrap:wrap;
  gap: 10px 12px;
  align-items:center;
  justify-content:space-between;
}

.badge{
  display:inline-flex;
  gap: 8px;
  align-items:center;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.badge strong{ font-weight: 800; }

.badge.neutral{ border-color: rgba(37,99,235,.25); }
.badge.yin{ border-color: rgba(14,165,164,.35); }
.badge.yang{ border-color: rgba(37,99,235,.35); }

/* ===== Progress ===== */
.progress{
  margin-top: 10px;
  height: 10px;
  background: #e9eef6;
  border-radius: 999px;
  position:relative;
  overflow:hidden;
  border: 1px solid var(--border);
}

.progress .marker{
  position:absolute;
  top:-5px;
  width: 14px;
  height: 20px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--brand), var(--brand2));
  box-shadow: 0 6px 16px rgba(37,99,235,.25);
}

/* ===== Cards ===== */
.cards{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 640px){
  .cards{ grid-template-columns: 1fr; }
  body{ padding: 12px; }
}

.card-btn{
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 14px;
  padding: 12px;
  cursor:pointer;
  text-align:left;

  display:flex;
  gap: 10px;
  align-items:flex-start;
  min-height: 92px;

  transition: transform .12s ease,
              box-shadow .12s ease,
              border-color .12s ease,
              background .12s ease;

  box-shadow: var(--shadow-sm);
}

.card-btn:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37,99,235,.25);
  background: #fbfdff;
}

.card-btn.yin{ border-left: 4px solid var(--brand2); }
.card-btn.yang{ border-left: 4px solid var(--brand); }
.card-btn.neutral{ border-left: 4px solid rgba(31,41,55,.22); }

.emoji{
  font-size: 28px;
  line-height: 1;
}

.card-text{
  display:flex;
  flex-direction:column;
  gap: 4px;
}

.card-name{
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.card-meta{
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

/* ===== Footer / Help ===== */
.help{
  margin:0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.actions{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.action-btn{
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  cursor:pointer;
  color: var(--text);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.action-btn:hover{
  border-color: rgba(37,99,235,.35);
  background: var(--brandSoft);
}

.action-btn.primary{
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
}

.action-btn.primary:hover{
  filter: brightness(.98);
}

.small{
  font-size: 12px;
  color: var(--muted);
}

