.arcade-desktop-icon {
  display:grid;
  width:48px;
  height:48px;
  grid-template-columns:1fr 1fr;
  place-items:center;
  border:1px solid rgba(255,255,255,.45);
  border-radius:10px;
  background:linear-gradient(145deg,#2b2a29,#171716);
  box-shadow:0 6px 15px rgba(0,0,0,.2),inset 0 1px rgba(255,255,255,.12);
  font-size:17px;
  letter-spacing:-8px;
  padding-right:8px;
}

.arcade-window {
  top:42px;
  left:max(82px,calc(50vw - 500px));
  width:min(1000px,calc(100vw - 100px));
  height:min(760px,calc(100vh - 90px));
  min-width:720px;
  min-height:570px;
  background:#1a1918;
  color:#f5f2ee;
}

.arcade-shell {
  display:grid;
  flex:1;
  min-height:0;
  grid-template-columns:190px minmax(0,1fr);
  background:#171615;
}

.arcade-sidebar {
  padding:18px 14px;
  border-right:1px solid rgba(255,255,255,.09);
  background:linear-gradient(180deg,#22211f,#191817);
}

.arcade-brand {
  margin-bottom:20px;
  padding:4px 6px 16px;
  border-bottom:1px solid rgba(255,255,255,.1);
}

.arcade-brand strong {
  display:block;
  font-size:16px;
  letter-spacing:.05em;
}

.arcade-brand small {
  display:block;
  margin-top:4px;
  color:#96918c;
  font-size:10px;
}

.arcade-game-item {
  display:flex;
  width:100%;
  min-height:52px;
  padding:9px 10px;
  align-items:center;
  gap:10px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:7px;
  background:rgba(255,255,255,.05);
  color:#fff;
  text-align:left;
}

.arcade-game-item.active {
  border-color:rgba(255,255,255,.22);
  background:rgba(255,255,255,.11);
}

.arcade-game-icon {
  display:grid;
  width:32px;
  height:32px;
  place-items:center;
  border-radius:6px;
  background:#0f0f0e;
  font-size:15px;
}

.arcade-game-item strong { display:block; font-size:12px; }
.arcade-game-item small { display:block; margin-top:2px; color:#96918c; font-size:9px; }

.gomoku-main {
  display:grid;
  min-width:0;
  min-height:0;
  padding:18px;
  grid-template-columns:minmax(410px,1fr) 230px;
  gap:18px;
}

.gomoku-board-wrap {
  display:flex;
  min-width:0;
  min-height:0;
  align-items:center;
  justify-content:center;
}

.gomoku-board-frame {
  position:relative;
  width:min(100%,620px);
  aspect-ratio:1;
  padding:12px;
  border:1px solid #806848;
  border-radius:10px;
  background:linear-gradient(145deg,#ba8c50,#8f6637);
  box-shadow:0 20px 40px rgba(0,0,0,.28),inset 0 1px rgba(255,255,255,.23);
}

.gomoku-canvas {
  display:block;
  width:100%;
  height:100%;
  border-radius:5px;
  background:#c99a5b;
  cursor:crosshair;
  touch-action:none;
}

.gomoku-canvas.waiting { cursor:progress; }

.gomoku-panel {
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:12px;
}

.gomoku-card {
  padding:13px;
  border:1px solid rgba(255,255,255,.1);
  border-radius:8px;
  background:rgba(255,255,255,.055);
}

.gomoku-card h2 {
  margin:0 0 8px;
  font-size:16px;
}

.gomoku-status {
  min-height:42px;
  color:#ddd8d2;
  font-size:12px;
  line-height:1.55;
}

.gomoku-players {
  display:grid;
  gap:7px;
}

.gomoku-player {
  display:flex;
  min-height:34px;
  padding:7px 8px;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  border-radius:5px;
  background:rgba(0,0,0,.16);
  font-size:11px;
}

.gomoku-stone-swatch {
  display:inline-block;
  width:17px;
  height:17px;
  margin-right:7px;
  border-radius:50%;
  vertical-align:-4px;
  box-shadow:0 2px 4px rgba(0,0,0,.35);
}

.gomoku-stone-swatch.black { background:#171717; border:1px solid #080808; }
.gomoku-stone-swatch.white { background:#f3f1ed; border:1px solid #b8b2aa; }

.gomoku-ai-badge {
  display:inline-flex;
  min-height:22px;
  padding:0 7px;
  align-items:center;
  border:1px solid rgba(255,255,255,.12);
  border-radius:999px;
  background:rgba(255,255,255,.06);
  color:#c8c3bd;
  font:700 9px/1 ui-monospace,SFMono-Regular,Consolas,monospace;
}

.gomoku-ai-badge.online { color:#dff8ec; border-color:rgba(166,236,202,.28); }
.gomoku-ai-badge.fallback { color:#f1d7a6; border-color:rgba(241,215,166,.25); }

.gomoku-comment {
  min-height:60px;
  padding:10px;
  border-left:3px solid rgba(255,255,255,.2);
  background:rgba(0,0,0,.14);
  color:#c8c3bd;
  font-size:11px;
  line-height:1.55;
}

.gomoku-actions { display:grid; gap:7px; margin-top:auto; }

.gomoku-button {
  min-height:38px;
  padding:0 12px;
  border:1px solid rgba(255,255,255,.15);
  border-radius:6px;
  background:rgba(255,255,255,.08);
  color:#fff;
  cursor:pointer;
  font-weight:700;
}

.gomoku-button:hover { background:rgba(255,255,255,.14); }
.gomoku-button.primary { background:#f0ede8; color:#24211f; }
.gomoku-button.primary:hover { background:#fff; }

.gomoku-rules {
  color:#99938d;
  font-size:9px;
  line-height:1.6;
}

@media(max-width:900px) {
  .arcade-window {
    inset:0 0 48px 0 !important;
    width:100% !important;
    height:auto !important;
    min-width:0;
    min-height:0;
    border-radius:0;
    transform:none !important;
  }

  .arcade-shell { grid-template-columns:1fr; }
  .arcade-sidebar { display:none; }
  .gomoku-main { grid-template-columns:minmax(0,1fr); overflow:auto; padding:12px; }
  .gomoku-board-frame { width:min(100%,620px); }
  .gomoku-panel { width:min(100%,620px); margin:0 auto; }
}
