:root{
  --bg:#0f1220;
  --card:#171a2b;
  --text:#f2f3ff;
  --muted:#b8bbd4;
  --line:rgba(255,255,255,.12);

  --p1:#39d98a;
  --p2:#4aa3ff;

  --accent:#ff4fd8;
  --win:#ffd36b;
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin-top:40px;
}

.wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 18px;
}

.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 18px;
}

.brand{
  display:flex;
  gap:10px;
  align-items:center;
}

.brandLogo{
  width:80px;
  height:80px;
}

.brandTitle{
  font-weight:800;
  font-size:20px;
  letter-spacing:.2px;
}

.brandSub{
  color:var(--muted);
  font-size:12px;
  margin-top:2px;
}

.main{
  display:grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
}

.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.cardTitle{
  font-weight:800;
  margin-bottom: 10px;
}

.inputs{
  display:grid;
  gap:10px;
}

.field span{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px;
}

.field input{
  width:100%;
  padding:10px 10px;
  border-radius:10px;
  border:1px solid var(--line);
  background:#101328;
  color:var(--text);
  outline:none;
}

.field input:focus{
  border-color: rgba(255,79,216,.55);
}

.line{
  height:1px;
  background: var(--line);
  margin: 12px 0;
}

.scores{
  display:grid;
  gap:10px;
}

.scoreItem{
  display:flex;
  gap:10px;
  align-items:center;
}

.scoreGap{
  margin-top: 8px;
}

.dot{
  width:12px;
  height:12px;
  border-radius:50%;
}

.dotP1{background:var(--p1);}
.dotP2{background:var(--p2);}

.scoreName{
  font-weight:700;
  font-size:14px;
}

.scoreValue{
  color:var(--muted);
  margin-top: 6px;
}

.turn{
  display:flex;
  align-items:center;
  gap:10px;
}

.turnGapTop{
  margin-top: 14px;
}

.turnDot{
  width:12px;
  height:12px;
  border-radius:50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(255,79,216,.45);
}

.turnText{
  font-weight:700;
}

.buttons{
  display:grid;
  gap:10px;
}

.btn{
  border:none;
  border-radius: 12px;
  padding: 10px 12px;
  cursor:pointer;
  background:#232845;
  color:var(--text);
  font-weight:700;
}

.btn:disabled{
  opacity:.5;
  cursor:not-allowed;
}

.btnPrimary{
  background:#3a3fff;
}

.btnDanger{
  background:#ff3b5c;
}

.btnGhost{
  background:transparent;
  border:1px solid var(--line);
}

.sound{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.hint{
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.how{
  margin-top: 12px;
  display:none;
}

.para{
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.boardArea{
  min-width: 0;
}

.boardTop{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 10px;
}

.badge{
  background:#232845;
  border:1px solid var(--line);
  padding:6px 10px;
  border-radius: 999px;
  font-weight:800;
  font-size:12px;
}

.board{
  display:grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  background:#0c0f1f;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  max-width: 620px;
}

.cell{
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  display:grid;
  place-items:center;
  cursor:pointer;
}

.cell:hover{
  border-color: rgba(255,79,216,.28);
}

.stone{
  width: 70%;
  height: 70%;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
}

.s1{ background: var(--p1); }
.s2{ background: var(--p2); }

.last{
  outline: 2px solid rgba(255,79,216,.75);
  outline-offset: 2px;
}

.win{
  outline: 2px solid var(--win);
  outline-offset: 2px;
}

.footerBar{
  max-width: 620px;
  margin-top: 10px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  color: var(--muted);
  font-size: 13px;
}

.heart{
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.4));
}

.authorName{
  color: #4aa3ff;
  font-weight: 800;
}

.footerRight{
  display:flex;
  gap:10px;
  align-items:center;
}

.iconLink{
  display:inline-flex;
  align-items:center;
}

.iconImg{
  width:18px;
  height:18px;
  opacity:.9;
}

.iconImg:hover{
  opacity:1;
}

.overlay{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.6);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 16px;
}

.hidden{ display:none; }

.modal{
  width: min(420px, 92vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  text-align:center;
}

.modalTitle{
  font-weight:900;
  font-size: 18px;
}

.modalText{
  color: var(--muted);
  margin: 10px 0 14px;
  line-height: 1.45;
}