/* Confluence — style.css */
:root{
  --bg:#0b1020;
  --panel:#0f172a;
  --ink:#e5e7eb;
  --muted:#94a3b8;
  --blue:#3b82f6;
  --red:#ef4444;
  --accent:#22c55e;
}

*{box-sizing:border-box}

html,body{
  height:100%;
  margin:0;
  background:linear-gradient(180deg,#0b1020,#0b1020 60%,#0c1226);
  color:var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", sans-serif;
}

.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; gap:12px;
  padding:10px 14px;
  background:rgba(15,23,42,.9);
  backdrop-filter: blur(6px);
  border-bottom:1px solid rgba(148,163,184,.2);
}
.topbar h1{ font-size: clamp(16px, 2.2vw, 22px); margin:0; }
.topbar .back{ color:var(--ink); text-decoration:none; padding:6px 10px; border:1px solid rgba(148,163,184,.35); border-radius:10px; }
.topbar .spacer{ flex:1; }

.container{
  max-width:1200px; margin:12px auto 20px; padding:0 12px;
  display:grid; grid-template-columns: 1fr 320px; gap:16px;
  align-items:start;
}
@media (max-width: 900px){
  .container{ grid-template-columns: 1fr; }
}

.panel{
  background:var(--panel);
  border:1px solid rgba(148,163,184,.2);
  border-radius:16px;
  padding:12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}

.left .panel{ margin-bottom:16px; }

.row{ display:flex; align-items:center; gap:12px; }
.row.wrap{ flex-wrap:wrap; }
.row.right{ justify-content:flex-end; }
.row.between{ justify-content:space-between; }

.turn-indicator{ display:flex; align-items:center; gap:8px; }
#turnDot{ width:10px; height:10px; border-radius:50%; background:var(--blue); display:inline-block; box-shadow:0 0 12px var(--blue); }

.score{ margin-left:auto; display:flex; gap:16px; color:var(--muted); }

.seg{ display:flex; border:1px solid rgba(148,163,184,.3); border-radius:10px; overflow:hidden; }
.seg .seg-btn, .seg .dir{
  background:none; color:var(--ink); border:0; padding:8px 10px; cursor:pointer;
}
.seg .seg-btn.active, .seg .dir.active{ background:rgba(148,163,184,.15); }

.control label{ display:block; font-size:12px; color:var(--muted); margin-bottom:4px; }

.primary{
  background:linear-gradient(180deg,#22c55e,#16a34a);
  border:1px solid rgba(34,197,94,.5);
  color:white; padding:8px 12px; border-radius:10px; cursor:pointer;
}
button{ background:rgba(148,163,184,.1); color:var(--ink); border:1px solid rgba(148,163,184,.25); padding:8px 12px; border-radius:10px; cursor:pointer; }
button:disabled{ opacity:.5; cursor:not-allowed; }

.board-wrap{ display:flex; justify-content:center; }
.board{
  width: min(92vw, 68vh);
  height: min(92vw, 68vh);
  max-width: 560px;
  max-height: 560px;
  display:grid;
  gap:4px;
  background: rgba(148,163,184,.12);
  padding:8px;
  border-radius:16px;
  border:1px solid rgba(148,163,184,.25);
}
@media (max-width: 900px){
  .board{ width: 100%; height: auto; aspect-ratio: 1/1; max-width:none; }
}

.cell{
  background: rgba(255,255,255,.03);
  border:1px solid rgba(148,163,184,.2);
  border-radius:12px;
  position:relative;
  display:flex; align-items:center; justify-content:center;
  touch-action: manipulation;
  user-select:none;
}
.cell:focus{ outline: 2px solid var(--accent); outline-offset: -2px; }

.tile{
  width:80%; height:80%;
  display:flex; align-items:center; justify-content:center;
  border-radius:10px; position:relative;
  transition: transform .12s ease, box-shadow .12s ease;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.05), 0 3px 10px rgba(0,0,0,.4);
}
.tile.arrow.player0{ background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.06), rgba(255,255,255,0)), linear-gradient(180deg, rgba(59,130,246,.8), rgba(59,130,246,.45)); }
.tile.arrow.player1{ background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.06), rgba(255,255,255,0)), linear-gradient(180deg, rgba(239,68,68,.8), rgba(239,68,68,.45)); }

.tile.dam.player0{ background: linear-gradient(180deg, rgba(14,165,233,.9), rgba(14,165,233,.6)); }
.tile.dam.player1{ background: linear-gradient(180deg, rgba(249,115,22,.9), rgba(249,115,22,.6)); }

.arrow-icon{
  width:50%; height:50%;
  border-style: solid;
  border-width: 12px 10px 0 10px;
  border-color: white transparent transparent transparent;
  transform-origin: 50% 65%;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.5));
}

.log{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height:1.4;
  height: 240px;
  overflow:auto;
  background: rgba(0,0,0,.25);
  border:1px solid rgba(148,163,184,.25);
  border-radius:10px;
  padding:8px;
}

h2{ margin: 6px 0 8px; font-size: 16px; }
.small{ color:var(--muted); font-size:12px; }

dialog{
  max-width: 760px;
  border:1px solid rgba(148,163,184,.25);
  border-radius:16px;
  background:var(--panel);
  color:var(--ink);
  padding:16px;
}
dialog::backdrop{ background: rgba(0,0,0,.5); }
