:root {
  --wq-brand-a: #22d3ee;
  --wq-brand-b: #8b5cf6;
  --wq-ink: #243f5e;
  --wq-surface: #f8fafc;
  --wq-surface-muted: #e2e8f0;
  --wq-border: rgba(148, 163, 184, 0.45);
  --wq-text: #0f172a;
  --wq-text-muted: #475569;
  --wq-radius-lg: 16px;
  --wq-radius-md: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--wq-text);
  text-align: center;
  background: #f3efe6;
}

html[data-bc-theme="dark"] body {
  color: #e2e8f0;
  background: linear-gradient(180deg, #243f5e 0%, #304d6e 100%);
}

.wq-shell {
  min-height: 100vh;
  padding: 16px 14px 20px;
}

.game_box,
.menu_setup {
  display: none;
}

.menu_box {
  max-width: 420px;
  margin: 0 auto;
}

.menu_init,
.menu_setup {
  padding: 18px 16px 20px;
  border-radius: var(--wq-radius-lg);
  border: 1px solid var(--wq-border);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 40px -18px rgba(15, 23, 42, 0.35);
}

html[data-bc-theme="dark"] .menu_init,
html[data-bc-theme="dark"] .menu_setup {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(255, 255, 255, 0.1);
}

.menu_title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
}

.menu_lead {
  margin: 0 0 16px;
  color: var(--wq-text-muted);
  font-size: 0.92rem;
}

html[data-bc-theme="dark"] .menu_lead {
  color: #94a3b8;
}

.menu_box a {
  display: block;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: var(--wq-radius-md);
  text-decoration: none;
  color: #0f172a;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(139, 92, 246, 0.14));
  border: 1px solid rgba(34, 211, 238, 0.35);
}

html[data-bc-theme="dark"] .menu_box a {
  color: #f8fafc;
}

.menu_box a:hover {
  border-color: rgba(34, 211, 238, 0.65);
}

.menu_info {
  text-align: left;
}

.menu_fh {
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  border-radius: 999px;
  border: 1px solid var(--wq-border);
  background: rgba(148, 163, 184, 0.12);
  cursor: pointer;
  position: relative;
}

.menu_fh::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 9px;
  height: 9px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(2px, -2px);
}

.menu_field {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--wq-radius-md);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.menu_field legend {
  padding: 0 4px;
  font-weight: 600;
}

.menu_field label {
  display: block;
  margin-top: 6px;
}

.game_box {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
}

.wq-board-stage {
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  border-radius: calc(var(--wq-radius-lg) + 2px);
  background: transparent;
  border: 0;
  box-shadow: none;
}

html[data-bc-theme="dark"] .wq-board-stage {
  background: transparent;
  border-color: transparent;
}

.wq-board-glow {
  display: none;
}

.wq-board-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 8px;
  border-radius: var(--wq-radius-lg);
  background: linear-gradient(180deg, #8b5a2b 0%, #5c3a1e 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 247, 237, 0.28),
    inset 0 -10px 18px rgba(0, 0, 0, 0.18);
}

html[data-bc-theme="dark"] .wq-board-frame {
  background: linear-gradient(180deg, #334155 0%, #0f172a 100%);
}

.goban-title {
  min-height: 1.25rem;
  margin-bottom: 8px;
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 600;
}

.goban-board-host {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#goban-board {
  position: relative;
  display: inline-block;
  line-height: 0;
  vertical-align: top;
}

#goban-board canvas.ShadowLayer,
#goban-board canvas.StoneLayer,
#goban-board canvas.PenLayer {
  position: absolute;
  top: 0;
  left: 0;
}

.bn_box {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

html[data-bc-board-fullscreen="true"],
html[data-bc-board-fullscreen="true"] body {
  height: 100%;
  overflow: hidden;
}

html[data-bc-board-fullscreen="true"] .wq-shell {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  padding: 6px 8px 8px;
}

html[data-bc-board-fullscreen="true"] .game_box {
  display: flex;
  flex: 1;
  flex-direction: column;
  max-width: none;
  min-height: 0;
  width: 100%;
}

html[data-bc-board-fullscreen="true"] .wq-board-stage {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

html[data-bc-board-fullscreen="true"] .wq-board-frame {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 6px;
}

html[data-bc-board-fullscreen="true"] .goban-board-host {
  align-items: center;
  flex: 1;
  min-height: 0;
}

html[data-bc-board-fullscreen="true"] .bn_box {
  flex-shrink: 0;
  margin-top: 8px;
}

.bn_box input[type="button"] {
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--wq-text);
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

html[data-bc-theme="dark"] .bn_box input[type="button"] {
  background: rgba(15, 23, 42, 0.88);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.12);
}

.bn_box input[type="button"]:hover {
  border-color: rgba(34, 211, 238, 0.55);
}

@media (max-width: 639px) {
  .wq-shell {
    padding-inline: 10px;
  }

  .bn_box input[type="button"] {
    padding-inline: 10px;
  }
}
