* { box-sizing: border-box; }
:root{
  --bg: #f2f2f2;
  --card: #ffffff;
  --border: #cfcfcf;
  --border2: #e3e3e3;
  --text: #222;
  --muted: #666;
  --btn: #2f80ed;
  --btn2:#1f6fd6;
  --shadow: 0 1px 0 rgba(0,0,0,.04);
  --radius: 10px;
}

body{
  margin:0;
  font-family: Arial, Helvetica, system-ui, -apple-system, Segoe UI, Roboto;
  background: var(--bg);
  color: var(--text);
}

.page{
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px;
}

/* Header giống style web game cổ điển */
.top{
  display:flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.brand{
  display:flex;
  align-items:center;
  gap: 10px;
}

.logo{
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fffbe6;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 20px;
}

.title{
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .2px;
}
.subtitle{
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.hud{
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap: wrap;
}
.hud-item{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 14px;
  box-shadow: var(--shadow);
}

.btn{
  border: 1px solid var(--btn);
  background: var(--btn);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover{ background: var(--btn2); border-color: var(--btn2); }
.btn-ghost{
  background: white;
  color: var(--btn);
  border: 1px solid var(--border);
}
.btn-ghost:hover{
  background: #f6faff;
  border-color: #b7d3ff;
}

/* Layout */
.grid{
  display:grid;
  grid-template-columns: 1fr 320px;
  gap: 12px;
  align-items:start;
}
@media (max-width: 950px){
  .grid{ grid-template-columns: 1fr; }
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
}

.game{
  padding: 12px;
}

.game-head{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  border-bottom: 1px solid var(--border2);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.game-title{
  font-weight: 800;
}

.tag{
  display:inline-block;
  font-size: 12px;
  color: #333;
  background: #f7f7f7;
  border: 1px solid var(--border2);
  padding: 4px 8px;
  border-radius: 999px;
  margin-left: 6px;
}

/* Board wrapper */
.board-wrap{
  padding: 6px;
  background: #fafafa;
  border: 1px solid var(--border2);
  border-radius: 8px;
}

/* Board responsive - không tràn */
.board{
  --cols: 16;
  display:grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 6px;
}

/* Cell kiểu “Pikachu cổ điển online” */
.cell{
  aspect-ratio: 1 / 1;
  border: 1px solid #bdbdbd;
  border-radius: 6px;
  background: #ffffff;
  display:flex;
  align-items:center;
  justify-content:center;

  font-size: clamp(18px, 2.2vw, 28px);
  line-height: 1;
  user-select:none;
  cursor: pointer;
}
.cell:hover{
  background:#f2f6ff;
  border-color:#98b8ff;
}
.cell.selected{
  outline: 2px solid #2f80ed;
  outline-offset: -2px;
}
.cell.empty{
  background: transparent;
  border: 1px dashed #d8d8d8;
}

.game-foot{
  margin-top: 10px;
  border-top: 1px solid var(--border2);
  padding-top: 10px;
}
.note{
  font-size: 12px;
  color: var(--muted);
}

/* Side */
.card-title{
  font-weight: 800;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border2);
  padding-bottom: 8px;
}

.info{
  display:grid;
  gap: 8px;
}
.info-row{
  display:flex;
  justify-content: space-between;
  font-size: 14px;
  color: #333;
}

.lb{
  display:grid;
  gap: 8px;
}
.lb-row{
  display:flex;
  justify-content: space-between;
  padding: 6px 8px;
  background: #fafafa;
  border: 1px solid var(--border2);
  border-radius: 8px;
  font-size: 14px;
}
.lb-row.muted{
  color: var(--muted);
}

.help{
  margin: 0;
  padding-left: 18px;
  color: #333;
  font-size: 14px;
  line-height: 1.6;
}
