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

body {
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Malgun Gothic", sans-serif;
  background: #f1f5f9;
  color: #1f2937;
  overflow: hidden;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 8px 12px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #475569;
}

.tool input[type="color"] {
  width: 32px;
  height: 28px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: none;
  cursor: pointer;
}

.tool input[type="range"] {
  width: 110px;
}

.toolbar button {
  padding: 6px 12px;
  font-size: 14px;
  color: #1f2937;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
}

.toolbar button:hover {
  background: #eef2f7;
}

.toolbar button:active {
  background: #e2e8f0;
}

.status {
  flex: 1 1 160px;
  min-width: 0;
  font-size: 13px;
  color: #475569;
}

.status.ok {
  color: #15803d;
  font-weight: 600;
}

.status.fail {
  color: #b45309;
}

.stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 10px;
  font-size: 13px;
  background: #f1f5f9;
  border-radius: 999px;
}

.stat-label {
  color: #64748b;
}

.stat b {
  font-size: 15px;
  color: #0f172a;
}

.ranking {
  flex: 1 1 100%;
  font-size: 13px;
  color: #1d4ed8;
}

.stat.user b {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar button.primary {
  color: #ffffff;
  background: #2563eb;
  border-color: #2563eb;
  font-weight: 600;
}

.toolbar button.primary:hover {
  background: #1d4ed8;
}

.toolbar button:disabled {
  opacity: 0.5;
  cursor: default;
}

.board-wrap.locked #board {
  cursor: not-allowed;
}

.board-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  touch-action: none;
}

#board {
  position: absolute;
  inset: 0;
  display: block;
  background: #ffffff;
  touch-action: none;
  cursor: crosshair;
}
