* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 0%, #2b3a52, #12161f 70%);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #e8eef7;
  padding: 16px;
  overflow-x: hidden;
}

.wrap {
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

h1 {
  font-size: 20px;
  margin: 0;
  text-align: center;
  letter-spacing: 6px;
  font-weight: 600;
  color: #ffd89b;
  text-shadow: 0 2px 12px rgba(255,200,100,.25);
}

.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

button, select {
  font: inherit;
  font-size: 14px;
  padding: 9px 18px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  color: #e8eef7;
  cursor: pointer;
  transition: .18s;
  outline: none;
}

button:hover:not(:disabled),
select:hover { background: rgba(255,255,255,0.16); }

button:active:not(:disabled) { transform: translateY(1px); }

button:disabled { opacity: .38; cursor: not-allowed; }

select option { background: #1b2230; }

#board {
  display: block;
  width: 100%;
  max-width: 552px;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(0,0,0,.55);
  cursor: pointer;
  touch-action: manipulation;
}

.about-icon-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 38, 54, 0.85);
  border: 1px solid rgba(255,255,255,0.15);
  color: #ffd89b;
  z-index: 35;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  transition: .2s;
}

.about-icon-btn:hover { background: rgba(60,72,96,.95); transform: scale(1.06); }
.about-icon-btn:active { transform: scale(0.96); }
.about-icon-btn svg { width: 22px; height: 22px; display: block; }

#toastContainer {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 300px;
}

.toast {
  padding: 8px 13px;
  border-radius: 9px;
  font-size: 13px;
  letter-spacing: .5px;
  line-height: 1.4;
  box-shadow: 0 8px 26px rgba(0,0,0,.45);
  opacity: 0;
  transform: translateX(-18px);
  transition: opacity .25s ease, transform .25s ease;
  backdrop-filter: blur(8px);
  color: #dde6f2;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(30, 38, 54, 0.96);
}

.toast.show { opacity: 1; transform: translateX(0); }

.toast.info    { color: #dde6f2; border-color: rgba(255,255,255,0.14); background: rgba(30,38,54,.96); }
.toast.success { color: #9ff5b0; border-color: rgba(80,255,140,.35);   background: rgba(24,50,36,.96); }
.toast.warn    { color: #ffe08a; border-color: rgba(255,200,80,.4);    background: rgba(58,46,20,.96); }
.toast.error   { color: #ff9c9c; border-color: rgba(255,80,80,.4);     background: rgba(60,26,32,.96); }

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
  z-index: 40;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.open { opacity: 1; visibility: visible; }

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 300px;
  max-width: 88vw;
  background: linear-gradient(180deg, #1e2636, #161c28);
  border-left: 1px solid rgba(255,255,255,0.1);
  box-shadow: -14px 0 40px rgba(0,0,0,.55);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,.1,.3,1);
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.sidebar.open { transform: translateX(0); }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 3px;
  color: #ffd89b;
  flex: none;
}

.sidebar-close {
  padding: 0;
  width: 32px;
  height: 32px;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: #b9c6da;
}

.sidebar-body {
  padding: 24px 18px;
  overflow-y: auto;
  flex: 1;
}

.about-version {
  font-size: 14px;
  letter-spacing: 1.5px;
  color: #c8dcff;
  text-align: left;
  font-variant-numeric: tabular-nums;
  padding: 8px 0;
}